From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A4325D919; Wed, 6 Mar 2024 08:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=68.232.153.233 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715118; cv=none; b=F1E0CPG5JgQGrwqsNp5oJHKgvZOO2IOLTMz40X4CcWx0GHJR6nFCsyCIt8DVeEhxlMk0fRzXCm/CHL6sha2qypMhzT5vUANZ/2T7q660p6VVePsw9V6Mb2c9pTWmFIlHCDOjGrEBQtZa6kjxlLG/o7uPnoGxvPofjj03zs5NhMU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709715118; c=relaxed/simple; bh=C7wNFMq+Tb6UBHNzMe8Yv9vypVbu/w3sH598lfI8tLg=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZPyd8ruqGqcxemAjGFosI8qjJVPLYtFvLeljaTq8TkVxeuF7Fj4HMXg2f/4XYGHRlyBnvlBIGwBI4X4vG5ZDg2Oq0oF2ntO86ONwJA+gYJo/jYipskeiAXwO3pvwLdmXjiRiVqoJF1Fje1RiMUe8feZm1npM28LhxCOw08pHc+o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com; spf=pass smtp.mailfrom=microchip.com; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b=Pf2sSFdh; arc=none smtp.client-ip=68.232.153.233 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=microchip.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=microchip.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Pf2sSFdh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1709715117; x=1741251117; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=C7wNFMq+Tb6UBHNzMe8Yv9vypVbu/w3sH598lfI8tLg=; b=Pf2sSFdhiueusHtsHqmg1/NqxthdjU1MF/QzTX2YXEiWkVgF0CSE4z8G y7dBDyoGy7GNkSHayw5LLi7fMvC7x2CMQBbdG6j3nhR8d4f5LnDpGNbqP i5tPI1gafztx5ctbTdSbDQHFPudivVLqnDP++1hCGooVVauPCOKH24CR0 IfeONoZjQU+6lYxKgKt7U38xZG/yG7Og21O0rBkaDa3y9J0scxpWZ6sW+ JHxCWCU0viEmPHOrpxthaK8Wei4EaDOAUErYeS62r5Dcxh43KGflianmm qmQTYGMqOoivIPrL8iLQWoPYtiGK7gC/uNlUgM7W28WT0uQMAo+JYELT6 g==; X-CSE-ConnectionGUID: j7Lxr73nSs+FyDFfEdnQPQ== X-CSE-MsgGUID: BvQivwjJQWS/LiInTU3jzg== X-IronPort-AV: E=Sophos;i="6.06,207,1705388400"; d="scan'208";a="248037241" X-Amp-Result: SKIPPED(no attachment in message) Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 06 Mar 2024 01:50:48 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Wed, 6 Mar 2024 01:50:34 -0700 Received: from CHE-LT-I17164LX.microchip.com (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Wed, 6 Mar 2024 01:50:25 -0700 From: Parthiban Veerasooran To: , , , , , , , , , , , , , , , , , , , CC: , , , , , , Parthiban Veerasooran Subject: [PATCH net-next v3 00/12] Add support for OPEN Alliance 10BASE-T1x MACPHY Serial Interface Date: Wed, 6 Mar 2024 14:20:05 +0530 Message-ID: <20240306085017.21731-1-Parthiban.Veerasooran@microchip.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain This patch series contain the below updates, - Adds support for OPEN Alliance 10BASE-T1x MACPHY Serial Interface in the net/ethernet/oa_tc6.c. Link to the spec: ----------------- https://opensig.org/download/document/OPEN_Alliance_10BASET1x_MAC-PHY_Serial_Interface_V1.1.pdf - Adds driver support for Microchip LAN8650/1 Rev.B1 10BASE-T1S MACPHY Ethernet driver in the net/ethernet/microchip/lan865x/lan865x.c. Link to the product: -------------------- https://www.microchip.com/en-us/product/lan8650 Testing Details: ---------------- The driver performance was tested using iperf3 in the below two setups separately. Setup 1: -------- Node 0 - Raspberry Pi 4 with LAN8650 MAC-PHY Node 1 - Raspberry Pi 4 with EVB-LAN8670-USB USB Stick Setup 2: -------- Node 0 - SAMA7G54-EK with LAN8650 MAC-PHY Node 1 - Raspberry Pi 4 with EVB-LAN8670-USB USB Stick Achieved maximum of 9.4 Mbps. Some systems like Raspberry Pi 4 need performance mode enabled to get the proper clock speed for SPI. Refer below link for more details. https://github.com/raspberrypi/linux/issues/3381#issuecomment-1144723750 Changes: v2: - Removed RFC tag. - OA TC6 framework configured in the Kconfig and Makefile to compile as a module. - Kerneldoc headers added for all the API methods exposed to MAC driver. - Odd parity calculation logic updated from the below link, https://elixir.bootlin.com/linux/latest/source/lib/bch.c#L348 - Control buffer memory allocation moved to the initial function. - struct oa_tc6 implemented as an obaque structure. - Removed kthread for handling mac-phy interrupt instead threaded irq is used. - Removed interrupt implementation for soft reset handling instead of that polling has been implemented. - Registers name in the defines changed according to the specification document. - Registers defines are arranged in the order of offset and followed by register fields. - oa_tc6_write_register() implemented for writing a single register and oa_tc6_write_registers() implemented for writing multiple registers. - oa_tc6_read_register() implemented for reading a single register and oa_tc6_read_registers() implemented for reading multiple registers. - Removed DRV_VERSION macro as git hash provided by ethtool. - Moved MDIO bus registration and PHY initialization to the OA TC6 lib. - Replaced lan865x_set/get_link_ksettings() functions with phy_ethtool_ksettings_set/get() functions. - MAC-PHY's standard capability register values checked against the user configured values. - Removed unnecessary parameters validity check in various places. - Removed MAC address configuration in the lan865x_net_open() function as it is done in the lan865x_probe() function already. - Moved standard registers and proprietary vendor registers to the respective files. - Added proper subject prefixes for the DT bindings. - Moved OA specific properties to a separate DT bindings and corrected the types & mistakes in the DT bindings. - Inherited OA specific DT bindings to the LAN865x specific DT bindings. - Removed sparse warnings in all the places. - Used net_err_ratelimited() for printing the error messages. - oa_tc6_process_rx_chunks() function and the content of oa_tc6_handler() function are split into small functions. - Used proper macros provided by network layer for calculating the MAX_ETH_LEN. - Return value of netif_rx() function handled properly. - Removed unnecessary NULL initialization of skb in the oa_tc6_rx_eth_ready() function removed. - Local variables declaration ordered in reverse xmas tree notation. v3: - Completely redesigned all the patches. - Control and data interface patches are divided into multiple small patches. - Device driver APIs added in the oa-tc6-framework.rst file. - Code readability improved in all the patches. - Defined macros wherever is possible. - Changed RESETC to STATUS0_RESETC for improving the readability. - Removed OA specific DT bindings. - Used default configurations defined in the OA spec. - All variables are named properly as per OA spec for more redability. - Bigger functions are split into multiple smaller functions. - DT binding check is done. - Phy mask is removed in phy scanning. - Used NET_RX_DROP to compare the rx packet submission status. - Indentation in the Kconfig file corrected. - Removed CONFIG_OF and CONFIG_ACPI ifdefs. - Removed MODULE_ALIAS(). Parthiban Veerasooran (12): Documentation: networking: add OPEN Alliance 10BASE-T1x MAC-PHY serial interface net: ethernet: oa_tc6: implement register write operation net: ethernet: oa_tc6: implement register read operation net: ethernet: oa_tc6: implement software reset net: ethernet: oa_tc6: implement error interrupts unmasking net: ethernet: oa_tc6: implement internal PHY initialization net: ethernet: oa_tc6: enable open alliance tc6 data communication net: ethernet: oa_tc6: implement transmit path to transfer tx ethernet frames net: ethernet: oa_tc6: implement receive path to receive rx ethernet frames net: ethernet: oa_tc6: implement mac-phy interrupt microchip: lan865x: add driver support for Microchip's LAN865X MAC-PHY dt-bindings: net: add Microchip's LAN865X 10BASE-T1S MACPHY .../bindings/net/microchip,lan865x.yaml | 80 ++ Documentation/networking/oa-tc6-framework.rst | 491 +++++++ MAINTAINERS | 15 + drivers/net/ethernet/Kconfig | 15 + drivers/net/ethernet/Makefile | 1 + drivers/net/ethernet/microchip/Kconfig | 1 + drivers/net/ethernet/microchip/Makefile | 1 + .../net/ethernet/microchip/lan865x/Kconfig | 19 + .../net/ethernet/microchip/lan865x/Makefile | 6 + .../net/ethernet/microchip/lan865x/lan865x.c | 350 +++++ drivers/net/ethernet/oa_tc6.c | 1235 +++++++++++++++++ include/linux/oa_tc6.h | 23 + 12 files changed, 2237 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/microchip,lan865x.yaml create mode 100644 Documentation/networking/oa-tc6-framework.rst create mode 100644 drivers/net/ethernet/microchip/lan865x/Kconfig create mode 100644 drivers/net/ethernet/microchip/lan865x/Makefile create mode 100644 drivers/net/ethernet/microchip/lan865x/lan865x.c create mode 100644 drivers/net/ethernet/oa_tc6.c create mode 100644 include/linux/oa_tc6.h -- 2.34.1