dt-bindings: net: Add missing properties used in examples
Subsystems (6)
Rob Herring
maintainerPATCH 1/1 dt-bindings: net: Add missing properties used in examples
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.
--- .../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(-)
Documentation/devicetree/bindings/net/actions,owl-emac.yaml +3 -0
@@ -51,6 +51,9 @@ properties: description: Phandle to the device containing custom config. + mdio: + type: object + required: - compatible - reg
Documentation/devicetree/bindings/net/intel,dwmac-plat.yaml +1 -1
@@ -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";
Documentation/devicetree/bindings/net/qca,ar71xx.yaml +4 -1
@@ -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 = <ðcfg>; phy-mode = "mii"; phy-handle = <&phy_port4>; };
Documentation/devicetree/bindings/net/stm32-dwmac.yaml +6 -0
@@ -44,6 +44,12 @@ properties: - st,stm32-dwmac - const: snps,dwmac-3.50a + reg: true + + reg-names: + items: + - const: stmmaceth + clocks: minItems: 3 items:
Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml +7 -0
@@ -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
Documentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml +4 -1
@@ -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";
Signature · 1 line
2.32.0
Quoted 44 lines · Rob Herring
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" <[email protected]>Cc Jakub Kicinski <[email protected]>Cc "Andreas Färber" <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Nobuhiro Iwamatsu <[email protected]>Cc Cristian Ciocaltea <[email protected]>Cc "G. Jaya Kumaran" <[email protected]>Cc Oleksij Rempel <[email protected]>Cc Christophe Roullier <[email protected]>Cc Grygorii Strashko <[email protected]>Signed-off-by Rob Herring <[email protected]>--- .../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(-)Documentation/devicetree/bindings/net/actions,owl-emac.yaml +0
-0
Documentation/devicetree/bindings/net/actions,owl-emac.yaml properties: · line 55
Quoted 5 lines
Documentation/devicetree/bindings/net/actions,owl-emac.yaml +2
-0@@ -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
Quoted 101 lines
Documentation/devicetree/bindings/net/actions,owl-emac.yaml +1
-0+ required: - compatible - regDocumentation/devicetree/bindings/net/intel,dwmac-plat.yaml +1
-1@@ -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";Documentation/devicetree/bindings/net/qca,ar71xx.yaml +4
-1@@ -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 = <ðcfg>; phy-mode = "mii"; phy-handle = <&phy_port4>; };Documentation/devicetree/bindings/net/stm32-dwmac.yaml +6
-0@@ -44,6 +44,12 @@ properties: - st,stm32-dwmac - const: snps,dwmac-3.50a + reg: true + + reg-names: + items: + - const: stmmaceth + clocks: minItems: 3 items:Documentation/devicetree/bindings/net/ti,davinci-mdio.yaml +7
-0@@ -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: trueDocumentation/devicetree/bindings/net/toshiba,visconti-dwmac.yaml +4
-1@@ -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";Signature · 1 line
2.32.0
Rob Herring
maintainerQuoted 55 lines · Thierry Reding
Quoted 44 lines · Rob Herring
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" <[email protected]>Cc Jakub Kicinski <[email protected]>Cc "Andreas Färber" <[email protected]>Cc Manivannan Sadhasivam <[email protected]>Cc Maxime Coquelin <[email protected]>Cc Alexandre Torgue <[email protected]>Cc Nobuhiro Iwamatsu <[email protected]>Cc Cristian Ciocaltea <[email protected]>Cc "G. Jaya Kumaran" <[email protected]>Cc Oleksij Rempel <[email protected]>Cc Christophe Roullier <[email protected]>Cc Grygorii Strashko <[email protected]>Signed-off-by Rob Herring <[email protected]>--- .../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(-)Documentation/devicetree/bindings/net/actions,owl-emac.yaml +0
-0Documentation/devicetree/bindings/net/actions,owl-emac.yaml properties: · line 55
Quoted 5 lines
Documentation/devicetree/bindings/net/actions,owl-emac.yaml +2
-0@@ -51,6 +51,9 @@ properties: description: Phandle to the device containing custom config. + mdio: + type: objectIn one of the conversions I've been working on, I've used this construct for the mdio node:
Quoted 6 lines
mdio:
$ref:mdio.yamlIn 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.
Quoted 4 lines
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