All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: net: Add missing properties used in examples
@ 2021-12-06 17:41 ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-12-06 17:41 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Andreas Färber,
	Manivannan Sadhasivam, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, Cristian Ciocaltea, G. Jaya Kumaran,
	Oleksij Rempel, Christophe Roullier, Grygorii Strashko
  Cc: devicetree, Thierry Reding, netdev, linux-arm-kernel,
	linux-actions, linux-stm32, linux-kernel

With 'unevaluatedProperties' support implemented, the following warnings
are generated in the net bindings:

Documentation/devicetree/bindings/net/actions,owl-emac.example.dt.yaml: ethernet@b0310000: Unevaluated properties are not allowed ('mdio' was unexpected)
Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected)
Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected)
Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@1a000000: Unevaluated properties are not allowed ('mdio' was unexpected)
Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected)
Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)

Add the missing properties/nodes as necessary.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Christophe Roullier <christophe.roullier@foss.st.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-actions@lists.infradead.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/net/actions,owl-emac.yaml          | 3 +++
 .../devicetree/bindings/net/intel,dwmac-plat.yaml          | 2 +-
 Documentation/devicetree/bindings/net/qca,ar71xx.yaml      | 5 ++++-
 Documentation/devicetree/bindings/net/stm32-dwmac.yaml     | 6 ++++++
 Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml | 7 +++++++
 .../devicetree/bindings/net/toshiba,visconti-dwmac.yaml    | 5 ++++-
 6 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
index 1626e0a821b0..e9c0d6360e74 100644
--- a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
+++ b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
@@ -51,6 +51,9 @@ properties:
     description:
       Phandle to the device containing custom config.
 
+  mdio:
+    type: object
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
index 08a3f1f6aea2..52a7fa4f49a4 100644
--- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
+++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
@@ -117,7 +117,7 @@ examples:
         snps,mtl-tx-config = <&mtl_tx_setup>;
         snps,tso;
 
-        mdio0 {
+        mdio {
             #address-cells = <1>;
             #size-cells = <0>;
             compatible = "snps,dwmac-mdio";
diff --git a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
index cf4d35edaa1b..f2bf1094d887 100644
--- a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
+++ b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
@@ -62,6 +62,10 @@ properties:
       - const: mac
       - const: mdio
 
+
+  mdio:
+    type: object
+
 required:
   - compatible
   - reg
@@ -85,7 +89,6 @@ examples:
         reset-names = "mac", "mdio";
         clocks = <&pll 1>, <&pll 2>;
         clock-names = "eth", "mdio";
-        qca,ethcfg = <&ethcfg>;
         phy-mode = "mii";
         phy-handle = <&phy_port4>;
     };
diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
index 577f4e284425..86632e9d987e 100644
--- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
@@ -44,6 +44,12 @@ properties:
               - st,stm32-dwmac
           - const: snps,dwmac-3.50a
 
+  reg: true
+
+  reg-names:
+    items:
+      - const: stmmaceth
+
   clocks:
     minItems: 3
     items:
diff --git a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
index 5728fe23f530..dbfca5ee9139 100644
--- a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
@@ -37,6 +37,13 @@ properties:
     maximum: 2500000
     description: MDIO Bus frequency
 
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: fck
+
   ti,hwmods:
     description: TI hwmod name
     deprecated: true
diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
index 59724d18e6f3..f5bec97460e4 100644
--- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
@@ -42,6 +42,9 @@ properties:
       - const: stmmaceth
       - const: phy_ref_clk
 
+  mdio:
+    type: object
+
 required:
   - compatible
   - reg
@@ -71,7 +74,7 @@ examples:
             phy-mode = "rgmii-id";
             phy-handle = <&phy0>;
 
-            mdio0 {
+            mdio {
                 #address-cells = <0x1>;
                 #size-cells = <0x0>;
                 compatible = "snps,dwmac-mdio";
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] dt-bindings: net: Add missing properties used in examples
@ 2021-12-06 17:41 ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-12-06 17:41 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Andreas Färber,
	Manivannan Sadhasivam, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, Cristian Ciocaltea, G. Jaya Kumaran,
	Oleksij Rempel, Christophe Roullier, Grygorii Strashko
  Cc: devicetree, Thierry Reding, netdev, linux-arm-kernel,
	linux-actions, linux-stm32, linux-kernel

With 'unevaluatedProperties' support implemented, the following warnings
are generated in the net bindings:

Documentation/devicetree/bindings/net/actions,owl-emac.example.dt.yaml: ethernet@b0310000: Unevaluated properties are not allowed ('mdio' was unexpected)
Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected)
Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected)
Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@1a000000: Unevaluated properties are not allowed ('mdio' was unexpected)
Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected)
Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)

Add the missing properties/nodes as necessary.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: "Andreas Färber" <afaerber@suse.de>
Cc: Manivannan Sadhasivam <mani@kernel.org>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: Christophe Roullier <christophe.roullier@foss.st.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: netdev@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-actions@lists.infradead.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Signed-off-by: Rob Herring <robh@kernel.org>
---
 .../devicetree/bindings/net/actions,owl-emac.yaml          | 3 +++
 .../devicetree/bindings/net/intel,dwmac-plat.yaml          | 2 +-
 Documentation/devicetree/bindings/net/qca,ar71xx.yaml      | 5 ++++-
 Documentation/devicetree/bindings/net/stm32-dwmac.yaml     | 6 ++++++
 Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml | 7 +++++++
 .../devicetree/bindings/net/toshiba,visconti-dwmac.yaml    | 5 ++++-
 6 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
index 1626e0a821b0..e9c0d6360e74 100644
--- a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
+++ b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
@@ -51,6 +51,9 @@ properties:
     description:
       Phandle to the device containing custom config.
 
+  mdio:
+    type: object
+
 required:
   - compatible
   - reg
diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
index 08a3f1f6aea2..52a7fa4f49a4 100644
--- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
+++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
@@ -117,7 +117,7 @@ examples:
         snps,mtl-tx-config = <&mtl_tx_setup>;
         snps,tso;
 
-        mdio0 {
+        mdio {
             #address-cells = <1>;
             #size-cells = <0>;
             compatible = "snps,dwmac-mdio";
diff --git a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
index cf4d35edaa1b..f2bf1094d887 100644
--- a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
+++ b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
@@ -62,6 +62,10 @@ properties:
       - const: mac
       - const: mdio
 
+
+  mdio:
+    type: object
+
 required:
   - compatible
   - reg
@@ -85,7 +89,6 @@ examples:
         reset-names = "mac", "mdio";
         clocks = <&pll 1>, <&pll 2>;
         clock-names = "eth", "mdio";
-        qca,ethcfg = <&ethcfg>;
         phy-mode = "mii";
         phy-handle = <&phy_port4>;
     };
diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
index 577f4e284425..86632e9d987e 100644
--- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
@@ -44,6 +44,12 @@ properties:
               - st,stm32-dwmac
           - const: snps,dwmac-3.50a
 
+  reg: true
+
+  reg-names:
+    items:
+      - const: stmmaceth
+
   clocks:
     minItems: 3
     items:
diff --git a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
index 5728fe23f530..dbfca5ee9139 100644
--- a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
+++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
@@ -37,6 +37,13 @@ properties:
     maximum: 2500000
     description: MDIO Bus frequency
 
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    items:
+      - const: fck
+
   ti,hwmods:
     description: TI hwmod name
     deprecated: true
diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
index 59724d18e6f3..f5bec97460e4 100644
--- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
@@ -42,6 +42,9 @@ properties:
       - const: stmmaceth
       - const: phy_ref_clk
 
+  mdio:
+    type: object
+
 required:
   - compatible
   - reg
@@ -71,7 +74,7 @@ examples:
             phy-mode = "rgmii-id";
             phy-handle = <&phy0>;
 
-            mdio0 {
+            mdio {
                 #address-cells = <0x1>;
                 #size-cells = <0x0>;
                 compatible = "snps,dwmac-mdio";
-- 
2.32.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: net: Add missing properties used in examples
  2021-12-06 17:41 ` Rob Herring
@ 2021-12-07  8:33   ` Thierry Reding
  -1 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2021-12-07  8:33 UTC (permalink / raw)
  To: Rob Herring
  Cc: David S. Miller, Jakub Kicinski, Andreas Färber,
	Manivannan Sadhasivam, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, Cristian Ciocaltea, G. Jaya Kumaran,
	Oleksij Rempel, Christophe Roullier, Grygorii Strashko,
	devicetree, netdev, linux-arm-kernel, linux-actions, linux-stm32,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 7141 bytes --]

On Mon, Dec 06, 2021 at 11:41:52AM -0600, Rob Herring wrote:
> With 'unevaluatedProperties' support implemented, the following warnings
> are generated in the net bindings:
> 
> Documentation/devicetree/bindings/net/actions,owl-emac.example.dt.yaml: ethernet@b0310000: Unevaluated properties are not allowed ('mdio' was unexpected)
> Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected)
> Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected)
> Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@1a000000: Unevaluated properties are not allowed ('mdio' was unexpected)
> Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected)
> Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> 
> Add the missing properties/nodes as necessary.
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: "Andreas Färber" <afaerber@suse.de>
> Cc: Manivannan Sadhasivam <mani@kernel.org>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
> Cc: Oleksij Rempel <o.rempel@pengutronix.de>
> Cc: Christophe Roullier <christophe.roullier@foss.st.com>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-actions@lists.infradead.org
> Cc: linux-stm32@st-md-mailman.stormreply.com
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../devicetree/bindings/net/actions,owl-emac.yaml          | 3 +++
>  .../devicetree/bindings/net/intel,dwmac-plat.yaml          | 2 +-
>  Documentation/devicetree/bindings/net/qca,ar71xx.yaml      | 5 ++++-
>  Documentation/devicetree/bindings/net/stm32-dwmac.yaml     | 6 ++++++
>  Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml | 7 +++++++
>  .../devicetree/bindings/net/toshiba,visconti-dwmac.yaml    | 5 ++++-
>  6 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> index 1626e0a821b0..e9c0d6360e74 100644
> --- a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> @@ -51,6 +51,9 @@ properties:
>      description:
>        Phandle to the device containing custom config.
>  
> +  mdio:
> +    type: object

In one of the conversions I've been working on, I've used this construct
for the mdio node:

	mdio:
	  $ref: mdio.yaml

In the cases here this may not be necessary because we could also match
on the compatible string, but for the example that I've been working on
there is no compatible string for the MDIO bus, so that's not an option.

On the other hand, it looks like the snps,dwmac-mdio that the examples
here use don't end up including mdio.yaml, so no validation (or rather
only very limited validation) will be performed on their properties and
children.

Thierry

> +
>  required:
>    - compatible
>    - reg
> diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> index 08a3f1f6aea2..52a7fa4f49a4 100644
> --- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> +++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> @@ -117,7 +117,7 @@ examples:
>          snps,mtl-tx-config = <&mtl_tx_setup>;
>          snps,tso;
>  
> -        mdio0 {
> +        mdio {
>              #address-cells = <1>;
>              #size-cells = <0>;
>              compatible = "snps,dwmac-mdio";
> diff --git a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
> index cf4d35edaa1b..f2bf1094d887 100644
> --- a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
> +++ b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
> @@ -62,6 +62,10 @@ properties:
>        - const: mac
>        - const: mdio
>  
> +
> +  mdio:
> +    type: object
> +
>  required:
>    - compatible
>    - reg
> @@ -85,7 +89,6 @@ examples:
>          reset-names = "mac", "mdio";
>          clocks = <&pll 1>, <&pll 2>;
>          clock-names = "eth", "mdio";
> -        qca,ethcfg = <&ethcfg>;
>          phy-mode = "mii";
>          phy-handle = <&phy_port4>;
>      };
> diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> index 577f4e284425..86632e9d987e 100644
> --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> @@ -44,6 +44,12 @@ properties:
>                - st,stm32-dwmac
>            - const: snps,dwmac-3.50a
>  
> +  reg: true
> +
> +  reg-names:
> +    items:
> +      - const: stmmaceth
> +
>    clocks:
>      minItems: 3
>      items:
> diff --git a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> index 5728fe23f530..dbfca5ee9139 100644
> --- a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> @@ -37,6 +37,13 @@ properties:
>      maximum: 2500000
>      description: MDIO Bus frequency
>  
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    items:
> +      - const: fck
> +
>    ti,hwmods:
>      description: TI hwmod name
>      deprecated: true
> diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> index 59724d18e6f3..f5bec97460e4 100644
> --- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> @@ -42,6 +42,9 @@ properties:
>        - const: stmmaceth
>        - const: phy_ref_clk
>  
> +  mdio:
> +    type: object
> +
>  required:
>    - compatible
>    - reg
> @@ -71,7 +74,7 @@ examples:
>              phy-mode = "rgmii-id";
>              phy-handle = <&phy0>;
>  
> -            mdio0 {
> +            mdio {
>                  #address-cells = <0x1>;
>                  #size-cells = <0x0>;
>                  compatible = "snps,dwmac-mdio";
> -- 
> 2.32.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: net: Add missing properties used in examples
@ 2021-12-07  8:33   ` Thierry Reding
  0 siblings, 0 replies; 6+ messages in thread
From: Thierry Reding @ 2021-12-07  8:33 UTC (permalink / raw)
  To: Rob Herring
  Cc: David S. Miller, Jakub Kicinski, Andreas Färber,
	Manivannan Sadhasivam, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, Cristian Ciocaltea, G. Jaya Kumaran,
	Oleksij Rempel, Christophe Roullier, Grygorii Strashko,
	devicetree, netdev, linux-arm-kernel, linux-actions, linux-stm32,
	linux-kernel


[-- Attachment #1.1: Type: text/plain, Size: 7141 bytes --]

On Mon, Dec 06, 2021 at 11:41:52AM -0600, Rob Herring wrote:
> With 'unevaluatedProperties' support implemented, the following warnings
> are generated in the net bindings:
> 
> Documentation/devicetree/bindings/net/actions,owl-emac.example.dt.yaml: ethernet@b0310000: Unevaluated properties are not allowed ('mdio' was unexpected)
> Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected)
> Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected)
> Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@1a000000: Unevaluated properties are not allowed ('mdio' was unexpected)
> Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected)
> Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> 
> Add the missing properties/nodes as necessary.
> 
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: Jakub Kicinski <kuba@kernel.org>
> Cc: "Andreas Färber" <afaerber@suse.de>
> Cc: Manivannan Sadhasivam <mani@kernel.org>
> Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
> Cc: Oleksij Rempel <o.rempel@pengutronix.de>
> Cc: Christophe Roullier <christophe.roullier@foss.st.com>
> Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> Cc: netdev@vger.kernel.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-actions@lists.infradead.org
> Cc: linux-stm32@st-md-mailman.stormreply.com
> Signed-off-by: Rob Herring <robh@kernel.org>
> ---
>  .../devicetree/bindings/net/actions,owl-emac.yaml          | 3 +++
>  .../devicetree/bindings/net/intel,dwmac-plat.yaml          | 2 +-
>  Documentation/devicetree/bindings/net/qca,ar71xx.yaml      | 5 ++++-
>  Documentation/devicetree/bindings/net/stm32-dwmac.yaml     | 6 ++++++
>  Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml | 7 +++++++
>  .../devicetree/bindings/net/toshiba,visconti-dwmac.yaml    | 5 ++++-
>  6 files changed, 25 insertions(+), 3 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> index 1626e0a821b0..e9c0d6360e74 100644
> --- a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> +++ b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> @@ -51,6 +51,9 @@ properties:
>      description:
>        Phandle to the device containing custom config.
>  
> +  mdio:
> +    type: object

In one of the conversions I've been working on, I've used this construct
for the mdio node:

	mdio:
	  $ref: mdio.yaml

In the cases here this may not be necessary because we could also match
on the compatible string, but for the example that I've been working on
there is no compatible string for the MDIO bus, so that's not an option.

On the other hand, it looks like the snps,dwmac-mdio that the examples
here use don't end up including mdio.yaml, so no validation (or rather
only very limited validation) will be performed on their properties and
children.

Thierry

> +
>  required:
>    - compatible
>    - reg
> diff --git a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> index 08a3f1f6aea2..52a7fa4f49a4 100644
> --- a/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> +++ b/Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml
> @@ -117,7 +117,7 @@ examples:
>          snps,mtl-tx-config = <&mtl_tx_setup>;
>          snps,tso;
>  
> -        mdio0 {
> +        mdio {
>              #address-cells = <1>;
>              #size-cells = <0>;
>              compatible = "snps,dwmac-mdio";
> diff --git a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
> index cf4d35edaa1b..f2bf1094d887 100644
> --- a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
> +++ b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml
> @@ -62,6 +62,10 @@ properties:
>        - const: mac
>        - const: mdio
>  
> +
> +  mdio:
> +    type: object
> +
>  required:
>    - compatible
>    - reg
> @@ -85,7 +89,6 @@ examples:
>          reset-names = "mac", "mdio";
>          clocks = <&pll 1>, <&pll 2>;
>          clock-names = "eth", "mdio";
> -        qca,ethcfg = <&ethcfg>;
>          phy-mode = "mii";
>          phy-handle = <&phy_port4>;
>      };
> diff --git a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> index 577f4e284425..86632e9d987e 100644
> --- a/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/stm32-dwmac.yaml
> @@ -44,6 +44,12 @@ properties:
>                - st,stm32-dwmac
>            - const: snps,dwmac-3.50a
>  
> +  reg: true
> +
> +  reg-names:
> +    items:
> +      - const: stmmaceth
> +
>    clocks:
>      minItems: 3
>      items:
> diff --git a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> index 5728fe23f530..dbfca5ee9139 100644
> --- a/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> +++ b/Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml
> @@ -37,6 +37,13 @@ properties:
>      maximum: 2500000
>      description: MDIO Bus frequency
>  
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    items:
> +      - const: fck
> +
>    ti,hwmods:
>      description: TI hwmod name
>      deprecated: true
> diff --git a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> index 59724d18e6f3..f5bec97460e4 100644
> --- a/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml
> @@ -42,6 +42,9 @@ properties:
>        - const: stmmaceth
>        - const: phy_ref_clk
>  
> +  mdio:
> +    type: object
> +
>  required:
>    - compatible
>    - reg
> @@ -71,7 +74,7 @@ examples:
>              phy-mode = "rgmii-id";
>              phy-handle = <&phy0>;
>  
> -            mdio0 {
> +            mdio {
>                  #address-cells = <0x1>;
>                  #size-cells = <0x0>;
>                  compatible = "snps,dwmac-mdio";
> -- 
> 2.32.0
> 

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: net: Add missing properties used in examples
  2021-12-07  8:33   ` Thierry Reding
@ 2021-12-07 16:29     ` Rob Herring
  -1 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-12-07 16:29 UTC (permalink / raw)
  To: Thierry Reding
  Cc: David S. Miller, Jakub Kicinski, Andreas Färber,
	Manivannan Sadhasivam, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, Cristian Ciocaltea, G. Jaya Kumaran,
	Oleksij Rempel, Christophe Roullier, Grygorii Strashko,
	devicetree, netdev, linux-arm-kernel, linux-actions, linux-stm32,
	linux-kernel

On Tue, Dec 7, 2021 at 2:33 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Mon, Dec 06, 2021 at 11:41:52AM -0600, Rob Herring wrote:
> > With 'unevaluatedProperties' support implemented, the following warnings
> > are generated in the net bindings:
> >
> > Documentation/devicetree/bindings/net/actions,owl-emac.example.dt.yaml: ethernet@b0310000: Unevaluated properties are not allowed ('mdio' was unexpected)
> > Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected)
> > Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected)
> > Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@1a000000: Unevaluated properties are not allowed ('mdio' was unexpected)
> > Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected)
> > Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> > Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> >
> > Add the missing properties/nodes as necessary.
> >
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Cc: "Andreas Färber" <afaerber@suse.de>
> > Cc: Manivannan Sadhasivam <mani@kernel.org>
> > Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> > Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> > Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> > Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> > Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
> > Cc: Oleksij Rempel <o.rempel@pengutronix.de>
> > Cc: Christophe Roullier <christophe.roullier@foss.st.com>
> > Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> > Cc: netdev@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-actions@lists.infradead.org
> > Cc: linux-stm32@st-md-mailman.stormreply.com
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  .../devicetree/bindings/net/actions,owl-emac.yaml          | 3 +++
> >  .../devicetree/bindings/net/intel,dwmac-plat.yaml          | 2 +-
> >  Documentation/devicetree/bindings/net/qca,ar71xx.yaml      | 5 ++++-
> >  Documentation/devicetree/bindings/net/stm32-dwmac.yaml     | 6 ++++++
> >  Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml | 7 +++++++
> >  .../devicetree/bindings/net/toshiba,visconti-dwmac.yaml    | 5 ++++-
> >  6 files changed, 25 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> > index 1626e0a821b0..e9c0d6360e74 100644
> > --- a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> > +++ b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> > @@ -51,6 +51,9 @@ properties:
> >      description:
> >        Phandle to the device containing custom config.
> >
> > +  mdio:
> > +    type: object
>
> In one of the conversions I've been working on, I've used this construct
> for the mdio node:
>
>         mdio:
>           $ref: mdio.yaml
>
> In the cases here this may not be necessary because we could also match
> on the compatible string, but for the example that I've been working on
> there is no compatible string for the MDIO bus, so that's not an option.

$nodename is also used to match if there's no compatible, so the above
is somewhat redundant (the schema will be applied twice). Matching on
the node name is useful where we don't have a specific schema in place
or if you want to validate DT files with just that schema, but that's
becoming less useful as we get schemas for everything.

Thinking about this some more, what we need for these is:

mdio:
  $ref: mdio.yaml
  unevaluatedProperties: false

Because mdio.yaml on its own is incomplete and allows for additional
properties. That ensures all the properties are documented and no
extra properties are present.

> On the other hand, it looks like the snps,dwmac-mdio that the examples
> here use don't end up including mdio.yaml, so no validation (or rather
> only very limited validation) will be performed on their properties and
> children.

There is more validation than you were thinking, but it also needs the
above added.

Rob

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dt-bindings: net: Add missing properties used in examples
@ 2021-12-07 16:29     ` Rob Herring
  0 siblings, 0 replies; 6+ messages in thread
From: Rob Herring @ 2021-12-07 16:29 UTC (permalink / raw)
  To: Thierry Reding
  Cc: David S. Miller, Jakub Kicinski, Andreas Färber,
	Manivannan Sadhasivam, Maxime Coquelin, Alexandre Torgue,
	Nobuhiro Iwamatsu, Cristian Ciocaltea, G. Jaya Kumaran,
	Oleksij Rempel, Christophe Roullier, Grygorii Strashko,
	devicetree, netdev, linux-arm-kernel, linux-actions, linux-stm32,
	linux-kernel

On Tue, Dec 7, 2021 at 2:33 AM Thierry Reding <thierry.reding@gmail.com> wrote:
>
> On Mon, Dec 06, 2021 at 11:41:52AM -0600, Rob Herring wrote:
> > With 'unevaluatedProperties' support implemented, the following warnings
> > are generated in the net bindings:
> >
> > Documentation/devicetree/bindings/net/actions,owl-emac.example.dt.yaml: ethernet@b0310000: Unevaluated properties are not allowed ('mdio' was unexpected)
> > Documentation/devicetree/bindings/net/intel,dwmac-plat.example.dt.yaml: ethernet@3a000000: Unevaluated properties are not allowed ('snps,pbl', 'mdio0' were unexpected)
> > Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@19000000: Unevaluated properties are not allowed ('qca,ethcfg' was unexpected)
> > Documentation/devicetree/bindings/net/qca,ar71xx.example.dt.yaml: ethernet@1a000000: Unevaluated properties are not allowed ('mdio' was unexpected)
> > Documentation/devicetree/bindings/net/stm32-dwmac.example.dt.yaml: ethernet@40028000: Unevaluated properties are not allowed ('reg-names', 'snps,pbl' were unexpected)
> > Documentation/devicetree/bindings/net/ti,cpsw-switch.example.dt.yaml: mdio@1000: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> > Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.example.dt.yaml: mdio@f00: Unevaluated properties are not allowed ('clocks', 'clock-names' were unexpected)
> >
> > Add the missing properties/nodes as necessary.
> >
> > Cc: "David S. Miller" <davem@davemloft.net>
> > Cc: Jakub Kicinski <kuba@kernel.org>
> > Cc: "Andreas Färber" <afaerber@suse.de>
> > Cc: Manivannan Sadhasivam <mani@kernel.org>
> > Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
> > Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
> > Cc: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> > Cc: Cristian Ciocaltea <cristian.ciocaltea@gmail.com>
> > Cc: "G. Jaya Kumaran" <vineetha.g.jaya.kumaran@intel.com>
> > Cc: Oleksij Rempel <o.rempel@pengutronix.de>
> > Cc: Christophe Roullier <christophe.roullier@foss.st.com>
> > Cc: Grygorii Strashko <grygorii.strashko@ti.com>
> > Cc: netdev@vger.kernel.org
> > Cc: linux-arm-kernel@lists.infradead.org
> > Cc: linux-actions@lists.infradead.org
> > Cc: linux-stm32@st-md-mailman.stormreply.com
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> >  .../devicetree/bindings/net/actions,owl-emac.yaml          | 3 +++
> >  .../devicetree/bindings/net/intel,dwmac-plat.yaml          | 2 +-
> >  Documentation/devicetree/bindings/net/qca,ar71xx.yaml      | 5 ++++-
> >  Documentation/devicetree/bindings/net/stm32-dwmac.yaml     | 6 ++++++
> >  Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml | 7 +++++++
> >  .../devicetree/bindings/net/toshiba,visconti-dwmac.yaml    | 5 ++++-
> >  6 files changed, 25 insertions(+), 3 deletions(-)
> >
> > diff --git a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> > index 1626e0a821b0..e9c0d6360e74 100644
> > --- a/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> > +++ b/Documentation/devicetree/bindings/net/actions,owl-emac.yaml
> > @@ -51,6 +51,9 @@ properties:
> >      description:
> >        Phandle to the device containing custom config.
> >
> > +  mdio:
> > +    type: object
>
> In one of the conversions I've been working on, I've used this construct
> for the mdio node:
>
>         mdio:
>           $ref: mdio.yaml
>
> In the cases here this may not be necessary because we could also match
> on the compatible string, but for the example that I've been working on
> there is no compatible string for the MDIO bus, so that's not an option.

$nodename is also used to match if there's no compatible, so the above
is somewhat redundant (the schema will be applied twice). Matching on
the node name is useful where we don't have a specific schema in place
or if you want to validate DT files with just that schema, but that's
becoming less useful as we get schemas for everything.

Thinking about this some more, what we need for these is:

mdio:
  $ref: mdio.yaml
  unevaluatedProperties: false

Because mdio.yaml on its own is incomplete and allows for additional
properties. That ensures all the properties are documented and no
extra properties are present.

> On the other hand, it looks like the snps,dwmac-mdio that the examples
> here use don't end up including mdio.yaml, so no validation (or rather
> only very limited validation) will be performed on their properties and
> children.

There is more validation than you were thinking, but it also needs the
above added.

Rob

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-12-07 16:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 17:41 [PATCH] dt-bindings: net: Add missing properties used in examples Rob Herring
2021-12-06 17:41 ` Rob Herring
2021-12-07  8:33 ` Thierry Reding
2021-12-07  8:33   ` Thierry Reding
2021-12-07 16:29   ` Rob Herring
2021-12-07 16:29     ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.