Message ID | 20230921150622.599232-1-christophe.roullier@foss.st.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp5137162vqi; Thu, 21 Sep 2023 14:03:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEdYyWEtEDY9k10yU8saQI6V3trcjVJw0R3XZsuL57Mb9nVTlBNC5kgH9e0A5e9rcAF72IH X-Received: by 2002:a17:902:bc44:b0:1c3:9aa7:66e1 with SMTP id t4-20020a170902bc4400b001c39aa766e1mr5760821plz.69.1695330236308; Thu, 21 Sep 2023 14:03:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695330236; cv=none; d=google.com; s=arc-20160816; b=tsYY9RBK6wwGF0JLytf8nTXk5Va9NvUMvyxvkk6ya7AVBQXC9RG0F/Rv0q6/7uSt8M JdE6grYsK2sn+ShLSKpMi2/AzTHMTRUeVh9E6tHfQhATYOgS4Qr3d4EctzWfp+n5Ddl0 +mutZ7nbhppCd6FUbMo/piSPIXAENY3SR3f4a1Qq1MoqyPFdZtJyY02IfNGRzjRZ1qaR 9vURDwoRWT6/uR5HkiZe7QfNxU8NC9xdnsijd0SWqSlMs48+kYLJ3KyW2Jyp9z6/fn79 1QoXRY3pQ+RKeiTFMuVvQ+xgqs3fuA+V2V9neev9BSQfxa7pBVydJK3bfgRY9/Q2sBor TeoA== 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=3TMA1x9FuXniAWJkqPGs7vBSLWsQf/CGt0HLqhBW5IA=; fh=Nrq3/ZyqAmcldX4TnYQJDytRSUiD1vJeQNniXh+eWjo=; b=Yzb0H7YY+sT/0+JBTXg+fagxDVIJv7Phxl8/b9eQgLfOFnG6abwC+ewKwiosh6lWQW Akx0aWNuwpQDRkSxhestY6y70nxZS3L7y6TNbaZNQ7hNVUSCLEr49u42eWsJfrFitga7 CU/fZrMg1DS1Q2QquQNJt3GeZmFbzxOgM2Y1W5s+6KP5wgF+gMFCBd4KTc4aA+UwX4/o yLGhvCyDQ6ax7clnEEN84xKknosEt5MxDQt69J74BUBDwbbQ4n8DA46Y9DjDfFYgotHm s8MtjYHFKHXkd/Ey1ZzeZ2rUOJTlBlLaDEWm3BLPPnhyVwmIFMd3hpveadOdbp4hdQA9 3mug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=NJmMKWjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j8-20020a170903024800b001c1e1fe16cbsi2431043plh.255.2023.09.21.14.03.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 14:03:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@foss.st.com header.s=selector1 header.b=NJmMKWjC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=foss.st.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id AEF0C8258990; Thu, 21 Sep 2023 10:29:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229927AbjIUR3S (ORCPT <rfc822;pwkd43@gmail.com> + 29 others); Thu, 21 Sep 2023 13:29:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230307AbjIUR2e (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 21 Sep 2023 13:28:34 -0400 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 702334F3AE; Thu, 21 Sep 2023 10:15:58 -0700 (PDT) Received: from pps.filterd (m0369458.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 38LB4M0P001980; Thu, 21 Sep 2023 17:06:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=selector1; bh=3TMA1x9 FuXniAWJkqPGs7vBSLWsQf/CGt0HLqhBW5IA=; b=NJmMKWjCNJtH6fcmDfxlUWn M5UP8/Js1p0XhnooZBBrNrbSeIN0zwzSrZwWYPL5DWnnib2CFrAqKabflPLCLkrz vSEbTlPuKlTyfZLw6pWGtQRJemUSAAph7OeXO87/vNg3WWHrucEKkLBMMkggpUTI a5QFzq+lUnbs4P+jaR/2XikhpNHBYiVueLOE+UFksZ30oyAZYMBLRnN7n5W2NeVR qDEA9p1VH6D89lHm5tYUAQPQmc9dk2UEeWbpzgkMWPr7RzFrS4h1XrR8mYaRHTE2 3pN+2kCOYLu/KuGAS/Plw7ZHpm5CG8xPS9CheoSOIXX/7FbL43aeSxwxYIc59eg= = Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3t5nx0u3fy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Sep 2023 17:06:52 +0200 (MEST) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7CF01100064; Thu, 21 Sep 2023 17:06:51 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 754EA252250; Thu, 21 Sep 2023 17:06:51 +0200 (CEST) Received: from localhost (10.201.21.249) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Thu, 21 Sep 2023 17:06:48 +0200 From: Christophe Roullier <christophe.roullier@foss.st.com> To: "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com>, Richard Cochran <richardcochran@gmail.com>, Jose Abreu <joabreu@synopsys.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Christophe Roullier <christophe.roullier@foss.st.com> CC: <netdev@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-stm32@st-md-mailman.stormreply.com>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH 0/7] Series to deliver Ethernets for STM32MP13 Date: Thu, 21 Sep 2023 17:06:15 +0200 Message-ID: <20230921150622.599232-1-christophe.roullier@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.201.21.249] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-21_13,2023-09-21_01,2023-05-22_02 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 21 Sep 2023 10:29:36 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777682597946552008 X-GMAIL-MSGID: 1777682597946552008 |
Series |
Series to deliver Ethernets for STM32MP13
|
|
Message
Christophe Roullier
Sept. 21, 2023, 3:06 p.m. UTC
STM32MP13 is STM32 SOC with 2 GMACs instances This board have 2 RMII phy: -Ethernet1: RMII with crystal -Ethernet2: RMII without crystal Rework dwmac glue to simplify management for next stm32 Christophe Roullier (7): dt-bindings: net: add STM32MP13 compatible in documentation for stm32 net: ethernet: stmmac: rework glue to simplify management for next stm32 net: ethernet: stmmac: add management of stm32mp13 for stm32 ARM: dts: stm32: add ethernet1 and ethernet2 support on stm32mp13 ARM: dts: stm32: add ethernet1/2 RMII pins for STM32MP13F-DK board ARM: dts: stm32: add ethernet1 and ethernet2 for STM32MP135F-DK board ARM: multi_v7_defconfig: Add MCP23S08 pinctrl support .../devicetree/bindings/net/stm32-dwmac.yaml | 140 +++++++++-- arch/arm/boot/dts/st/stm32mp13-pinctrl.dtsi | 71 ++++++ arch/arm/boot/dts/st/stm32mp131.dtsi | 31 +++ arch/arm/boot/dts/st/stm32mp133.dtsi | 30 +++ arch/arm/boot/dts/st/stm32mp135f-dk.dts | 48 ++++ arch/arm/configs/multi_v7_defconfig | 1 + .../net/ethernet/stmicro/stmmac/dwmac-stm32.c | 226 +++++++++++++----- 7 files changed, 459 insertions(+), 88 deletions(-)
Comments
Yo, On Thu, Sep 21, 2023 at 05:06:16PM +0200, Christophe Roullier wrote: > New STM32 SOC have 2 GMACs instances. > GMAC IP version is SNPS 4.20. > > Signed-off-by: Christophe Roullier <christophe.roullier@foss.st.com> > --- > .../devicetree/bindings/net/stm32-dwmac.yaml | 140 +++++++++++++++--- > 1 file changed, 118 insertions(+), 22 deletions(-) > > diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > index fc8c96b08d7d..75836916c38c 100644 > --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > @@ -22,15 +22,17 @@ select: > enum: > - st,stm32-dwmac > - st,stm32mp1-dwmac > + - st,stm32mp13-dwmac > required: > - compatible > > -allOf: > - - $ref: snps,dwmac.yaml# > - > properties: > compatible: > oneOf: > + - items: > + - enum: > + - st,stm32mp13-dwmac > + - const: snps,dwmac-4.20a The enum just below this is also for the 4.20a, no? Why not just put this mp13 compatible into that enum? > - items: > - enum: > - st,stm32mp1-dwmac > @@ -72,27 +74,69 @@ properties: > - eth-ck > - ptp_ref > > - st,syscon: Please try to avoid defining properties inside if/then/else sections and only move the variable bits if possible. > - $ref: /schemas/types.yaml#/definitions/phandle-array > - items: > - - items: > - - description: phandle to the syscon node which encompases the glue register > - - description: offset of the control register > + phy-supply: > + description: PHY regulator > + > + st,ext-phyclk: > description: > - Should be phandle/offset pair. The phandle to the syscon node which > - encompases the glue register, and the offset of the control register > + set this property in RMII mode when you have PHY without crystal 50MHz and want to > + select RCC clock instead of ETH_REF_CLK. or in RGMII mode when you want to select > + RCC clock instead of ETH_CLK125. > + type: boolean > > st,eth-clk-sel: > + deprecated: true Why have these been marked as deprecated? That doesn't appear to be mention in the commit message & sounds like it should be a different commit. > description: > set this property in RGMII PHY when you want to select RCC clock instead of ETH_CLK125. > type: boolean > > st,eth-ref-clk-sel: > + deprecated: true Ditto. > description: > set this property in RMII mode when you have PHY without crystal 50MHz and want to > select RCC clock instead of ETH_REF_CLK. > type: boolean > > +allOf: > + - $ref: snps,dwmac.yaml# > + - if: > + properties: > + compatible: > + contains: > + enum: > + - st,stm32mp1-dwmac > + - st,stm32-dwmac > + then: > + properties: > + st,syscon: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + items: > + - items: > + - description: phandle to the syscon node which encompases the glue register > + - description: offset of the control register > + description: > + Should be phandle/offset pair. The phandle to the syscon node which > + encompases the glue register, and the offset of the control register > + - if: > + properties: > + compatible: > + contains: > + enum: > + - st,stm32mp13-dwmac You've got 2 if/then sections containing tests for 3 compatibles. There are only 2 compatibles total right now & 3 with the patch, so it looks like you'd get away with if/then/else instead. > + then: > + properties: > + st,syscon: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + items: > + - items: > + - description: phandle to the syscon node which encompases the glue register > + - description: offset of the control register > + - description: field to set mask in register > + description: > + Should be phandle/offset pair. The phandle to the syscon node which > + encompases the glue register, the offset of the control register and > + the mask to set bitfield in control register > + > required: > - compatible > - clocks > @@ -112,24 +156,36 @@ examples: > compatible = "st,stm32mp1-dwmac", "snps,dwmac-4.20a"; I don't understand why this existing example is changing. Thanks, Conor. > reg = <0x5800a000 0x2000>; > reg-names = "stmmaceth"; > - interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>; > - interrupt-names = "macirq"; > + interrupts-extended = <&intc GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>, > + <&exti 70 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names = "macirq", > + "eth_wake_irq"; > clock-names = "stmmaceth", > - "mac-clk-tx", > - "mac-clk-rx", > - "ethstp", > - "eth-ck"; > + "mac-clk-tx", > + "mac-clk-rx", > + "eth-ck", > + "ptp_ref", > + "ethstp"; > clocks = <&rcc ETHMAC>, > - <&rcc ETHTX>, > - <&rcc ETHRX>, > - <&rcc ETHSTP>, > - <&rcc ETHCK_K>; > + <&rcc ETHTX>, > + <&rcc ETHRX>, > + <&rcc ETHCK_K>, > + <&rcc ETHPTP_K>, > + <&rcc ETHSTP>; > st,syscon = <&syscfg 0x4>; > + snps,mixed-burst; > snps,pbl = <2>; > + snps,en-tx-lpi-clockgating; > snps,axi-config = <&stmmac_axi_config_0>; > snps,tso; > phy-mode = "rgmii"; > - }; > + > + stmmac_axi_config_0: stmmac-axi-config { > + snps,wr_osr_lmt = <0x7>; > + snps,rd_osr_lmt = <0x7>; > + snps,blen = <0 0 0 0 16 8 4>; > + }; > + }; > > - | > //Example 2 (MCU example) > @@ -161,3 +217,43 @@ examples: > snps,pbl = <8>; > phy-mode = "mii"; > }; > + > + - | > + #include <dt-bindings/interrupt-controller/arm-gic.h> > + #include <dt-bindings/clock/stm32mp1-clks.h> > + #include <dt-bindings/reset/stm32mp1-resets.h> > + #include <dt-bindings/mfd/stm32h7-rcc.h> > + //Example 4 > + ethernet3: ethernet@5800a000 { > + compatible = "st,stm32mp13-dwmac", "snps,dwmac-4.20a"; > + reg = <0x5800a000 0x2000>; > + reg-names = "stmmaceth"; > + interrupts-extended = <&intc GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>, > + <&exti 68 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names = "macirq", > + "eth_wake_irq"; > + clock-names = "stmmaceth", > + "mac-clk-tx", > + "mac-clk-rx", > + "eth-ck", > + "ptp_ref", > + "ethstp"; > + clocks = <&rcc ETHMAC>, > + <&rcc ETHTX>, > + <&rcc ETHRX>, > + <&rcc ETHCK_K>, > + <&rcc ETHPTP_K>, > + <&rcc ETHSTP>; > + st,syscon = <&syscfg 0x4 0xff0000>; > + snps,mixed-burst; > + snps,pbl = <2>; > + snps,axi-config = <&stmmac_axi_config_1>; > + snps,tso; > + phy-mode = "rmii"; > + > + stmmac_axi_config_1: stmmac-axi-config { > + snps,wr_osr_lmt = <0x7>; > + snps,rd_osr_lmt = <0x7>; > + snps,blen = <0 0 0 0 16 8 4>; > + }; > + }; > -- > 2.25.1 >