Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2639953rdb; Fri, 22 Sep 2023 04:53:17 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF0wXqSU7mmU5ZVVbGbWfG7rhrFJTjoLggzcojXTjGZ1D786stOPkrI0QjhVtBkoa7lqnpd X-Received: by 2002:a05:6870:4724:b0:1bf:54b9:800 with SMTP id b36-20020a056870472400b001bf54b90800mr9036858oaq.59.1695383596824; Fri, 22 Sep 2023 04:53:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695383596; cv=none; d=google.com; s=arc-20160816; b=s+VyvNMYT23XJLBr6JD4N7Ru77bSbjoVhsTbNMYsNXDcP4ejgzJomPmnKNPebBkcKs T8L95I3I2H83otSgKh6FHmZ9hbt4tHD3PBA2IE9KaaKQOeaQDtEdDae4fwv2NO4s76Wc Ms3b+ZLPVZ67v/sXmu2/+ePXXm/l1Cy/DBR/tH1hWhJehnKK+Ft+F7VlTC/Pr0TRnyu9 dLg4nFWBXTJvErHhUyiTZc/jDlbSbQZqkzLY1yhnY8VLZUTE7g6iTlo8Jeiv3+XreBOm qFnAFDwxtPwqS0Mt31DmN4/sAVCathhfLYOpY76zqVKuy/uHaVNf/rJjt3EKq3pdmxPY 2/ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mdQkwo7AKU2jWngZI4IOXQr3B+NIo3I82H+D0CkJIMA=; fh=75T00YJZjP1VnnukYxwUJJMr+VOVWvyplUnZyxgYQRM=; b=ppXi/WYShOvbdgXAnS4tLKt1hqOSjY7rNoSk1CJfuhbgHMwHJkJ0azKoM9uydLieq3 6Cxi2QpwxfBMVIAElGI+0o0U84eY7BNReicmjal7m/B/dwOVtUkq7XMr156+lcAWslaA fzvRHkJD0lI5VD6cRplv8Orw+5QaJeIgYcqwwVKNj617n/803tF9VG9KBJqHfsYxYbJ9 w4WsKFN6vwHMGm25daBRsRxwN1yuUcO7swN0iK850ZNkDC479Ux5ImCZyr+Inc8UZYuD 131UTm9q5jnrq8gkrL6wVfeN1ImhlwnZKvTDY6wc2/i/4d97gO8Apq9Brxt2an2tlUw+ cWoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z5j69Vsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id y1-20020a636401000000b00578c914490bsi3751865pgb.494.2023.09.22.04.53.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 04:53:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Z5j69Vsp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 63B5B85C6441; Fri, 22 Sep 2023 04:43:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233769AbjIVLnU (ORCPT + 99 others); Fri, 22 Sep 2023 07:43:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233384AbjIVLnT (ORCPT ); Fri, 22 Sep 2023 07:43:19 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31529FB for ; Fri, 22 Sep 2023 04:43:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D9C7C433C8; Fri, 22 Sep 2023 11:43:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695382992; bh=UL8TH12yxhaIMYvyUi/thvzlbWtFsgDinsXcxmzB5uA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Z5j69VsppTky9oLNhaaNt7S9yZ8FTOTxkyDyKDzfbrKb1yeXrzLzHjw8r4jZWPAmq dYVRdIMzUWVC1o3rmhaRK0EA/BAPl1F3QFP+S9wB0MB3kzjXvgGF4o8bo1OwA6G2Z/ XSXjsseo7vWGeZtHEsaP2Tz7+/sFlQtAPUcQUeUP750ScNPcjB0qFk+PjPuTYU9/ze 37p7LaL35yaXqVglDgrwxxRw/pL+S3UuJCCeH5lvZJtnp8oEn/mJRtyVQpOmB1n0zK y4BNOl6kjKD7UiIKjF5VFgV4zmZT3/JHPENsh+kdi5SAHJvcGtl+E/QfJ0xHGClrnT CL5dEyCIS9DSQ== Date: Fri, 22 Sep 2023 12:43:06 +0100 From: Conor Dooley To: Christophe Roullier Cc: "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , 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: Re: [PATCH 1/7] dt-bindings: net: add STM32MP13 compatible in documentation for stm32 Message-ID: <20230922-surface-graduate-a269a700e5c5@spud> References: <20230921150622.599232-1-christophe.roullier@foss.st.com> <20230921150622.599232-2-christophe.roullier@foss.st.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="y7/hylnc6AQ95TsF" Content-Disposition: inline In-Reply-To: <20230921150622.599232-2-christophe.roullier@foss.st.com> X-Spam-Status: No, score=-4.4 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_NONE,SPF_PASS 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 04:43:18 -0700 (PDT) --y7/hylnc6AQ95TsF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Christophe Roullier > --- > .../devicetree/bindings/net/stm32-dwmac.yaml | 140 +++++++++++++++--- > 1 file changed, 118 insertions(+), 22 deletions(-) >=20 > diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Doc= umentation/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 > =20 > -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 > =20 > - 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 regist= er > + set this property in RMII mode when you have PHY without crystal 5= 0MHz 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 > =20 > 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 i= nstead of ETH_CLK125. > type: boolean > =20 > st,eth-ref-clk-sel: > + deprecated: true Ditto. > description: > set this property in RMII mode when you have PHY without crystal 5= 0MHz and want to > select RCC clock instead of ETH_REF_CLK. > type: boolean > =20 > +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 encompas= es the glue register > + - description: offset of the control register > + description: > + Should be phandle/offset pair. The phandle to the syscon nod= e 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 encompas= es 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 nod= e which > + encompases the glue register, the offset of the control regi= ster and > + the mask to set bitfield in control register > + > required: > - compatible > - clocks > @@ -112,24 +156,36 @@ examples: > compatible =3D "st,stm32mp1-dwmac", "snps,dwmac-4.20a"; I don't understand why this existing example is changing. Thanks, Conor. > reg =3D <0x5800a000 0x2000>; > reg-names =3D "stmmaceth"; > - interrupts =3D ; > - interrupt-names =3D "macirq"; > + interrupts-extended =3D <&intc GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH= >, > + <&exti 70 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names =3D "macirq", > + "eth_wake_irq"; > clock-names =3D "stmmaceth", > - "mac-clk-tx", > - "mac-clk-rx", > - "ethstp", > - "eth-ck"; > + "mac-clk-tx", > + "mac-clk-rx", > + "eth-ck", > + "ptp_ref", > + "ethstp"; > clocks =3D <&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 =3D <&syscfg 0x4>; > + snps,mixed-burst; > snps,pbl =3D <2>; > + snps,en-tx-lpi-clockgating; > snps,axi-config =3D <&stmmac_axi_config_0>; > snps,tso; > phy-mode =3D "rgmii"; > - }; > + > + stmmac_axi_config_0: stmmac-axi-config { > + snps,wr_osr_lmt =3D <0x7>; > + snps,rd_osr_lmt =3D <0x7>; > + snps,blen =3D <0 0 0 0 16 8 4>; > + }; > + }; > =20 > - | > //Example 2 (MCU example) > @@ -161,3 +217,43 @@ examples: > snps,pbl =3D <8>; > phy-mode =3D "mii"; > }; > + > + - | > + #include > + #include > + #include > + #include > + //Example 4 > + ethernet3: ethernet@5800a000 { > + compatible =3D "st,stm32mp13-dwmac", "snps,dwmac-4.20a"; > + reg =3D <0x5800a000 0x2000>; > + reg-names =3D "stmmaceth"; > + interrupts-extended =3D <&intc GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH= >, > + <&exti 68 IRQ_TYPE_LEVEL_HIGH>; > + interrupt-names =3D "macirq", > + "eth_wake_irq"; > + clock-names =3D "stmmaceth", > + "mac-clk-tx", > + "mac-clk-rx", > + "eth-ck", > + "ptp_ref", > + "ethstp"; > + clocks =3D <&rcc ETHMAC>, > + <&rcc ETHTX>, > + <&rcc ETHRX>, > + <&rcc ETHCK_K>, > + <&rcc ETHPTP_K>, > + <&rcc ETHSTP>; > + st,syscon =3D <&syscfg 0x4 0xff0000>; > + snps,mixed-burst; > + snps,pbl =3D <2>; > + snps,axi-config =3D <&stmmac_axi_config_1>; > + snps,tso; > + phy-mode =3D "rmii"; > + > + stmmac_axi_config_1: stmmac-axi-config { > + snps,wr_osr_lmt =3D <0x7>; > + snps,rd_osr_lmt =3D <0x7>; > + snps,blen =3D <0 0 0 0 16 8 4>; > + }; > + }; > --=20 > 2.25.1 >=20 --y7/hylnc6AQ95TsF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZQ19ygAKCRB4tDGHoIJi 0uJ2AQDYMHSxhPUAaxKOHWJ6DyhZftPWpUilt+MV/PUTA3814gEAqkENVdWxZsMn IiIRijrOe3RpmdB14TsJ6QPhUyr+mgg= =e7lu -----END PGP SIGNATURE----- --y7/hylnc6AQ95TsF--