Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp934912lqs; Wed, 6 Mar 2024 00:54:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVKt+WoQr2dBwKdLH1LQxo+18MKd+scggt607MYP0zQoN2mRGsApnrxiYMxfYU3idAcd7FJK4v0I+q6Gx1xFcFkwUzEfCSdjc4C5Ck58w== X-Google-Smtp-Source: AGHT+IFHc9iZpBa7yfyxu0mij0/uXnYZpwCRYj4dVfnwCFIsXAu+H+b6qBb1y4F8Dc555NimjM4g X-Received: by 2002:ac8:5d49:0:b0:42e:b74f:88e9 with SMTP id g9-20020ac85d49000000b0042eb74f88e9mr5017956qtx.48.1709715253888; Wed, 06 Mar 2024 00:54:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709715253; cv=pass; d=google.com; s=arc-20160816; b=fMFVgN3FF6XRrKo72bOc3TqGyjVFtD4cJ5UmJV8q69ipzjcqwWQB/O0nxWSOjQj4fX /GMKcOCugmIAOdaISn+Tc53Mxyo5uzspVgIYT0MB4NDkmBAf1EYY4SXkIGM2nyasqSKg paZXrobzLHnH3Hn44z4aaXksQDKVbAwVp3P9uB7xDO16lwBlopTVC1ut+Cgw/rz+LNQy F40F5HM7UEkWOntJ5zoNyZjfgUuzXAvzY+BtKwr2JJBZndQdjZdJyAlzj6nA8ll0nbUT vr7slfH/cbN/PQ83U7b6qyZfuYHFkdvOjv7wSPwrAqm0czW3X8zCXkX7faLRFqGi39lj 9H7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=2fH5QepJx8IuAFwUBYkPuE2itC1Pi1QElG9EGrvCcqA=; fh=Yek51KtWkuS8F9wIb61YhKBdNUJJ2f/R79g/JeL1hhg=; b=KHFj1RbZvo/aSrwH6d0XFIvZszsrb6AQDc73aRogRJcQ52YQEthpaosUVC4G5GMV5Y Vsps5CGRIGhtybwqUecuDCb+o+XXrWsTh8piyAO8BY5k6rx550i05jDr8iaSHtmyUwIP mMV3PRI+4HsOfgxjiyd2w5bnR2nApU31DcNW7ckFxGZzu+oWxAiH+arSgQHKNZfxnufp +FirrJwfR2rMmxrlIdmvLv8MhK0/H7av9LcSu9W7FIUPcqSMMRz509XVdmZmhAJ0f8HA ToArLXTZk3Fk4G7aGZMSMc6jMmMOn72E+0eWmpwBIEZ4dBvrxSEGv4xP438e+I9nGV4Y 3Iow==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Pf2sSFdh; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-93545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c9-20020ac87dc9000000b0042ef4bc24e0si5776747qte.398.2024.03.06.00.54.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 00:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=Pf2sSFdh; arc=pass (i=1 spf=pass spfdomain=microchip.com dkim=pass dkdomain=microchip.com dmarc=pass fromdomain=microchip.com); spf=pass (google.com: domain of linux-kernel+bounces-93545-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93545-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=REJECT dis=NONE) header.from=microchip.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 8E29E1C209AB for ; Wed, 6 Mar 2024 08:54:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 588315DF24; Wed, 6 Mar 2024 08:51:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Pf2sSFdh" 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 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