Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp5145047rwr; Sun, 23 Apr 2023 22:36:02 -0700 (PDT) X-Google-Smtp-Source: AKy350ZbrCHcojstruD7WTZNZbgfMkV4ol7QS0xCFpZcvmFo5koyq1uPhTgoHFpRp7Ndq6tP8nkH X-Received: by 2002:a05:6a00:134b:b0:63b:646d:9165 with SMTP id k11-20020a056a00134b00b0063b646d9165mr16877191pfu.26.1682314561806; Sun, 23 Apr 2023 22:36:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682314561; cv=none; d=google.com; s=arc-20160816; b=byBFvNDm07mbp/ZKSUduFCt0zD5W5aYn1lZTv+8s8aHnonqyKfpoiXHGFqvsM3VpUG xx8TJLJnuoU8W95sAOcftGosRwlmItVaYIX7clLffJoExomAsvh/OFWYQAQO+nxxYjLQ PhbtnlV3AY788qBfXtasEHbabKobN+bXB5sDNC58m+eeT/XD1IfKpl9Env10R3oqyn6x wU8hXIOJPZvrplHJK5yGEkGJ3iu2reZGRs1adx418rgcUj4EIG1ZQMOxV+9yYq2bF+Wm PU3IBFR+QTI0yNiJF3G/nJiGLugaHaXhosxi9+8XPNV8MN8+uNj2P/OVqTiDKHEWEbog EmFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=BrB0RCivFs+NE13J+xWDij4MRP3eSr/zOZpAorPXKnQ=; b=aKftay8H5J8codShCNMw4VLw27R9CDDlmdHK2Kcu7A2amfbrI8BHEbnPUkMYGFFrc9 w0IF8V1lIglxQCrgVFyaSV+53u5nqsGTo+vzmN/W0UTwKQeu1VOVkJPSgQu2caQdan+E zGo0SpZE73R1vKhwf9lf2N4BrfNoP+hYZSwBtps2wqD2Z8UrY6QpAYlNrnB295d9lO6k Lmt7lHu14iwhaXMApPQCSZEp5NSLsIK1ByhoOIvLUj8fFvDgqPLtPvTiyIdOOfvFg9RM tEnWfB54Xvlm0qB9sfOSNC4YVm69Iny90R2DHUUahWFcxJ9uvA563Fed/6yu/Iua+9s+ 5r3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=c6vpiR2T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b7-20020aa78ec7000000b0063b56b7ba82si10480029pfr.189.2023.04.23.22.35.45; Sun, 23 Apr 2023 22:36:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=c6vpiR2T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230399AbjDXFdW (ORCPT + 99 others); Mon, 24 Apr 2023 01:33:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbjDXFdU (ORCPT ); Mon, 24 Apr 2023 01:33:20 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CDDD2D7E; Sun, 23 Apr 2023 22:33:18 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 33O5WaDl001627; Mon, 24 Apr 2023 00:32:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1682314356; bh=BrB0RCivFs+NE13J+xWDij4MRP3eSr/zOZpAorPXKnQ=; h=From:To:CC:Subject:Date; b=c6vpiR2T6aD5/WF1g4cQjKObCsdInlXJbz809JCTgCwzsja6GwCi1uFmgXEjWjDt2 kBU1+WyLPyBS26NNQuqbM46vgYo6u5w+SISCN63cIyeukYpq0SHo+9e8NchmhIxbDX EjctIGeGSxoPNW9//OzqJSKMPe3CESCM5r43eSFI= Received: from DFLE109.ent.ti.com (dfle109.ent.ti.com [10.64.6.30]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 33O5WaLI055984 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 24 Apr 2023 00:32:36 -0500 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16; Mon, 24 Apr 2023 00:32:36 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.16 via Frontend Transport; Mon, 24 Apr 2023 00:32:36 -0500 Received: from fllv0122.itg.ti.com (fllv0122.itg.ti.com [10.247.120.72]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 33O5WaZd119151; Mon, 24 Apr 2023 00:32:36 -0500 Received: from localhost (uda0501179.dhcp.ti.com [10.24.69.114]) by fllv0122.itg.ti.com (8.14.7/8.14.7) with ESMTP id 33O5WY0O016190; Mon, 24 Apr 2023 00:32:35 -0500 From: MD Danish Anwar To: "Andrew F. Davis" , Tero Kristo , Suman Anna , Roger Quadros , YueHaibing , MD Danish Anwar , Vignesh Raghavendra , Krzysztof Kozlowski , Rob Herring , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , , Randy Dunlap , Richard Cochran CC: , , , , , , , Subject: [RFC PATCH v6 0/2] Introduce ICSSG based ethernet Driver Date: Mon, 24 Apr 2023 11:02:31 +0530 Message-ID: <20230424053233.2338782-1-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The Programmable Real-time Unit and Industrial Communication Subsystem Gigabit (PRU_ICSSG) is a low-latency microcontroller subsystem in the TI SoCs. This subsystem is provided for the use cases like the implementation of custom peripheral interfaces, offloading of tasks from the other processor cores of the SoC, etc. The subsystem includes many accelerators for data processing like multiplier and multiplier-accumulator. It also has peripherals like UART, MII/RGMII, MDIO, etc. Every ICSSG core includes two 32-bit load/store RISC CPU cores called PRUs. The above features allow it to be used for implementing custom firmware based peripherals like ethernet. This series adds the YAML documentation and the driver with basic EMAC support for TI AM654 Silicon Rev 2 SoC with the PRU_ICSSG Sub-system. running dual-EMAC firmware. This currently supports basic EMAC with 1Gbps and 100Mbps link. 10M and half-duplex modes are not yet supported because they require the support of an IEP, which will be added later. Advanced features like switch-dev and timestamping will be added later. This series depends on a patch series [1] which is yet to be merged. The seires [1] is posted to SoC tree, has already been reviewed and is ready to be merged. Currently I am posting this series as RFC to get it reviewed. Once [1] is merged, this series can also be merged. This is the v6 of the patch series [v1]. This version of the patchset addresses the comments made on [v5] of the series. Changes from v5 to v6 : *) Added RB tag of Andrew Lunn in patch 2 of this series. *) Addressed Rob's comment on patch 1 of the series. *) Rebased patchset on next-20230421 linux-next. Changes from v4 to v5 : *) Re-arranged properties section in ti,icssg-prueth.yaml file. *) Added requirement for minimum one ethernet port. *) Fixed some minor formatting errors as asked by Krzysztof. *) Dropped SGMII mode from enum mii_mode as SGMII mode is not currently supported by the driver. *) Added switch-case block to handle different phy modes by ICSSG driver. Changes from v3 to v4 : *) Addressed Krzysztof's comments and fixed dt_binding_check errors in patch 1/2. *) Added interrupt-extended property in ethernet-ports properties section. *) Fixed comments in file icssg_switch_map.h according to the Linux coding style in patch 2/2. Added Documentation of structures in patch 2/2. Changes from v2 to v3 : *) Addressed Rob and Krzysztof's comments on patch 1 of this series. Fixed indentation. Removed description and pinctrl section from ti,icssg-prueth.yaml file. *) Addressed Krzysztof, Paolo, Randy, Andrew and Christophe's comments on patch 2 of this seires. *) Fixed blanklines in Kconfig and Makefile. Changed structures to const as suggested by Krzysztof. *) Fixed while loop logic in emac_tx_complete_packets() API as suggested by Paolo. Previously in the loop's last iteration 'budget' was 0 and napi_consume_skb would wrongly assume the caller is not in NAPI context Now, budget won't be zero in last iteration of loop. *) Removed inline functions addr_to_da1() and addr_to_da0() as asked by Andrew. *) Added dev_err_probe() instead of dev_err() as suggested by Christophe. *) In ti,icssg-prueth.yaml file, in the patternProperties section of ethernet-ports, kept the port name as "port" instead of "ethernet-port" as all other drivers were using "port". Will change it if is compulsory to use "ethernet-port". [1] https://lore.kernel.org/all/20230414045542.3249939-1-danishanwar@ti.com/ [v1] https://lore.kernel.org/all/20220506052433.28087-1-p-mohan@ti.com/ [v2] https://lore.kernel.org/all/20220531095108.21757-1-p-mohan@ti.com/ [v3] https://lore.kernel.org/all/20221223110930.1337536-1-danishanwar@ti.com/ [v4] https://lore.kernel.org/all/20230206060708.3574472-1-danishanwar@ti.com/ [v5] https://lore.kernel.org/all/20230210114957.2667963-1-danishanwar@ti.com/ Thanks and Regards, Md Danish Anwar MD Danish Anwar (1): dt-bindings: net: Add ICSSG Ethernet Roger Quadros (1): net: ti: icssg-prueth: Add ICSSG ethernet driver .../bindings/net/ti,icssg-prueth.yaml | 184 ++ drivers/net/ethernet/ti/Kconfig | 13 + drivers/net/ethernet/ti/Makefile | 2 + drivers/net/ethernet/ti/icssg_classifier.c | 369 ++++ drivers/net/ethernet/ti/icssg_config.c | 448 ++++ drivers/net/ethernet/ti/icssg_config.h | 200 ++ drivers/net/ethernet/ti/icssg_ethtool.c | 326 +++ drivers/net/ethernet/ti/icssg_mii_cfg.c | 104 + drivers/net/ethernet/ti/icssg_mii_rt.h | 150 ++ drivers/net/ethernet/ti/icssg_prueth.c | 1863 +++++++++++++++++ drivers/net/ethernet/ti/icssg_prueth.h | 247 +++ drivers/net/ethernet/ti/icssg_switch_map.h | 234 +++ 12 files changed, 4140 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/ti,icssg-prueth.yaml create mode 100644 drivers/net/ethernet/ti/icssg_classifier.c create mode 100644 drivers/net/ethernet/ti/icssg_config.c create mode 100644 drivers/net/ethernet/ti/icssg_config.h create mode 100644 drivers/net/ethernet/ti/icssg_ethtool.c create mode 100644 drivers/net/ethernet/ti/icssg_mii_cfg.c create mode 100644 drivers/net/ethernet/ti/icssg_mii_rt.h create mode 100644 drivers/net/ethernet/ti/icssg_prueth.c create mode 100644 drivers/net/ethernet/ti/icssg_prueth.h create mode 100644 drivers/net/ethernet/ti/icssg_switch_map.h -- 2.34.1