From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 39B05C25B76 for ; Thu, 6 Jun 2024 00:21:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ti2QrJcAHDRQqg54qhHuw+vm2lYxe//H7MYrt+hQqF8=; b=UXlekOSoQi2mSk 6+dxOZksV5Pz7Wwn1TbGBgA6G5qi5a8o0jq23WCjvE2WCIGV+9zgcB5bd5u5XPdp3HpFQd5UGazDy R0HJ1hIdDBT/OEHv3TFpvOl4wZiPdWItcQQiVRWCZF7l9fNyLE5aeIaNMoEdbSXYW2ZMJhe7DuuX9 jGYat6KWNmIlMEWZOg7y8wqjHU0EmY2JyPzavHmVgzCz1S3WLQekGJ5UnSqi2TZMGN9gPFmdIq39m uh9kF/KC1wA/MWUiCaF75dI5g5GZhm6KzV4dbtt+luI2Uahw80+arbXJlIRUzoVMv4Hd0b61NeJAk weYeUg+OK/yq981O9H7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sF0so-00000007wmj-48IP; Thu, 06 Jun 2024 00:21:34 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sF0sl-00000007wm8-3cdU for linux-arm-kernel@lists.infradead.org; Thu, 06 Jun 2024 00:21:33 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 1FEBBCE1877; Thu, 6 Jun 2024 00:21:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11EADC2BD11; Thu, 6 Jun 2024 00:21:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717633289; bh=0eqwJwhSDudfIsQGh0ug1pR2nn0XzPNrcqHG9ZVooZo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=CNpBr32h9yuMuy3yQWmdzA992nM0YscVDDU+fePYeKMrz2XPrvz4qpbbfaNBylmgu UAry4ljCEaibcrHuCEk8Skkox4YS3ZiSOietntDckKfJl09TEridoFIwLY2PM5/qvd gG4S4EHeSk/MBknaSFI35L2z1nIX52XM8yEV5KovqZokvsnewF1cdQYxGNds73KqLO 18eDogdGvH82Z25Toi2xnVkES985Zln1jJwUprn4jTfsjNqUpSw5O8/isPmLYcRu+Y P3v1mCugSqAMB2EA43vZH25iEdtBNi5+qlMcW7qqvFuD5kh+YbaHKLKWtvW0bjq73v eiW3dDWgagiGA== Date: Wed, 5 Jun 2024 18:21:26 -0600 From: Rob Herring To: Krzysztof Kozlowski Cc: Christophe ROULLIER , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Krzysztof Kozlowski , Conor Dooley , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Jose Abreu , Liam Girdwood , Mark Brown , Marek Vasut , 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 v4 01/11] dt-bindings: net: add STM32MP13 compatible in documentation for stm32 Message-ID: <20240606002126.GA3496044-robh@kernel.org> References: <20240604143502.154463-1-christophe.roullier@foss.st.com> <20240604143502.154463-2-christophe.roullier@foss.st.com> <067d41e5-89cf-45eb-8cfa-b6c3cd434f76@linaro.org> <70b66190-2c55-4228-8c31-f58a05829d8b@foss.st.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240605_172132_292823_D4AD5069 X-CRM114-Status: GOOD ( 25.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 05, 2024 at 01:46:33PM +0200, Krzysztof Kozlowski wrote: > On 05/06/2024 11:55, Christophe ROULLIER wrote: > > = > > On 6/5/24 10:14, Krzysztof Kozlowski wrote: > >> On 04/06/2024 16:34, Christophe Roullier wrote: > >>> New STM32 SOC have 2 GMACs instances. > >>> GMAC IP version is SNPS 4.20. > >>> > >>> Signed-off-by: Christophe Roullier > >>> --- > >>> .../devicetree/bindings/net/stm32-dwmac.yaml | 41 +++++++++++++++-= --- > >>> 1 file changed, 34 insertions(+), 7 deletions(-) > >>> > >>> diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b= /Documentation/devicetree/bindings/net/stm32-dwmac.yaml > >>> index 7ccf75676b6d5..ecbed9a7aaf6d 100644 > >>> --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > >>> +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml > >>> @@ -22,18 +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,stm32mp1-dwmac > >>> + - st,stm32mp13-dwmac > >>> - const: snps,dwmac-4.20a > >>> - items: > >>> - enum: > >>> @@ -75,12 +74,15 @@ properties: > >>> st,syscon: > >>> $ref: /schemas/types.yaml#/definitions/phandle-array > >>> items: > >>> - - items: > >>> + - minItems: 2 > >>> + items: > >>> - description: phandle to the syscon node which encompase= s 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, and the offset of the control re= gister > >>> + encompases the glue register, the offset of the control regist= er and > >>> + the mask to set bitfield in control register > >>> = > >>> st,ext-phyclk: > >>> description: > >>> @@ -112,12 +114,37 @@ required: > >>> = > >>> unevaluatedProperties: false > >>> = > >>> +allOf: > >>> + - $ref: snps,dwmac.yaml# > >>> + - if: > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - st,stm32mp1-dwmac > >>> + - st,stm32-dwmac > >>> + then: > >>> + properties: > >>> + st,syscon: > >>> + items: > >>> + maxItems: 2 > >>> + > >>> + - if: > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - st,stm32mp13-dwmac > >>> + then: > >>> + properties: > >>> + st,syscon: > >>> + items: > >>> + minItems: 3 > >> I don't think this works. You now constrain the first dimension which > >> had only one item before. > >> > >> Make your example complete and test it. > >> > >> Best regards, > >> Krzysztof > > = > > Hi Krzysztof, > > = > > "Official" bindings for MP15: st,syscon =3D <&syscfg 0x4>; > > "Official" bindings for MP13: st,syscon =3D <&syscfg 0x4 0xff0000>; or = > > st,syscon =3D <&syscfg 0x4 0xff000000>; > > = > > If I execute make dt_binding_check = > > DT_SCHEMA_FILES=3DDocumentation/devicetree/bindings/net/stm32-dwmac.yam= l with: > > = > > =A0=A0 For MP15: st,syscon =3D <&syscfg>; = > > =3D>bindings/net/stm32-dwmac.example.dtb: ethernet@40027000: st,syscon:= 0: = > > [4294967295] is too short > > = > > =A0=A0 For MP15: st,syscon =3D <&syscfg 0x4 0xff0000>; = > > =3D>devicetree/bindings/net/stm32-dwmac.example.dtb: ethernet@40027000: = > > st,syscon:0: [4294967295, 4, 16711680] is too long > > = > > =A0=A0 For MP13: st,syscon =3D <&syscfg 0x4>; =3D> = > > devicetree/bindings/net/stm32-dwmac.example.dtb: ethernet@5800a000: = > > st,syscon:0: [4294967295, 4] is too short > > = > > =A0=A0 For MP13: st,syscon =3D <&syscfg 0x4 0xff0000 0xff>; =3D> = > > devicetree/bindings/net/stm32-dwmac.example.dtb: ethernet@5800a000: = > > st,syscon:0: [4294967295, 4, 16711680, 255] is too long > > = > > So it is seems good :-) > = > Code is still incorrect, although will work because of how schema parses > matrix. But even by looking it is not symmetrical between allOf:if:then > and properties:. Make it symmetric - apply the number of items on the > second dimension. It looks correct to me. But it could also be like this: st,syscon: items: - minItems: 3 Either way works. Is that what you are asking for? I'm just happy when = folks can write a working schema. Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel