Orion MDIO DT binding fixes
Subsystems (3)
cover Orion MDIO DT binding fixes
Hi all,
This patchset fixes two small bugs in orion-mdio
binding. I would be thankful for your review.
Best regards,
Michał Grzelak
Michał Grzelak (2):
dt-bindings: net: marvell,orion-mdio: Fix error
dt-bindings: net: marvell,orion-mdio: Fix examples
.../bindings/net/marvell,orion-mdio.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
Signature · 1 line
2.34.1
PATCH 1/2 dt-bindings: net: marvell,orion-mdio: Fix error
Fix 'unevaluated properties error' during 'make dtbs_check' appearing on arm device trees by defining generic 'ethernet-phy' subnode in marvell,orion-mdio.yaml.
schema")
--- Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml | 4 ++++ 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +4 -0
@@ -35,6 +35,10 @@ properties: minItems: 1 maxItems: 4 +patternProperties: + '^ethernet-phy': + type: object + required: - compatible - reg
Signature · 1 line
2.34.1
Re: [net PATCH 1/2] dt-bindings: net: marvell,orion-mdio: Fix error
Quoted 3 lines · Michał Grzelak
Fix 'unevaluated properties error' during 'make
dtbs_check' appearing on arm device trees by defining generic 'ethernet-phy' subnode in marvell,orion-mdio.yaml.
Instead of long test just paste a bit of warning message. Much easier to read.
Quoted 3 lines
Fixes 0781434af811f ("dt-bindings: net: orion-mdio: Convert to JSONschema")
Don't wrap tags.
Quoted 10 lines
Signed-off-by Michał Grzelak <[email protected]>--- Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml | 4 ++++ 1 file changed, 4 insertions(+)Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +0
-0
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml properties: · line 39
Quoted 5 lines
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +2
-0@@ -35,6 +35,10 @@ properties: minItems: 1 maxItems: 4 +patternProperties: + '^ethernet-phy':
ethernet-phy@ is already accepted via mdio, so this looks wrong. You need to rather fix the DTS.
Best regards,
Krzysztof
PATCH 2/2 dt-bindings: net: marvell,orion-mdio: Fix examples
In reply to Michał GrzelakAs stated in marvell-orion-mdio.txt deleted in 'commit 0781434af811f ("dt-bindings: net: orion-mdio: Convert to JSON schema")' if 'interrupts' property is present, width of 'reg' should be 0x84. Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and extend it by second example from marvell-orion-mdio.txt.
--- .../devicetree/bindings/net/marvell,orion-mdio.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +11 -1
@@ -47,9 +47,10 @@ unevaluatedProperties: false examples: - | + // MDIO binding with interrupt mdio@d0072004 { compatible = "marvell,orion-mdio"; - reg = <0xd0072004 0x4>; + reg = <0xd0072004 0x84>; #address-cells = <1>; #size-cells = <0>; interrupts = <30>;
@@ -62,3 +63,12 @@ examples: reg = <1>; }; }; + + - | + // MDIO binding without interrupt + mdio@d0072004 { + compatible = "marvell,orion-mdio"; + reg = <0xd0072004 0x4>; + #address-cells = <1>; + #size-cells = <0>; + };
Signature · 1 line
2.34.1
Re: [net PATCH 2/2] dt-bindings: net: marvell,orion-mdio: Fix examples
Quoted 2 lines · Michał Grzelak
As stated in marvell-orion-mdio.txt deleted in 'commit
0781434af811f("dt-bindings: net: orion-mdio: Convert to JSON schema")' if
Drop '' quotes.
BTW, read the original binding to find the answer for your first patch.
Quoted 3 lines
'interrupts' property is present, width of 'reg' should be
0x84. Otherwise, width of 'reg' should be0x4. Fix 'examples:' and extend it by second example from marvell-orion-mdio.txt.
The original binding did not say that, unless you mean giving different examples? Examples are not a binding.
Quoted 25 lines
Signed-off-by Michał Grzelak <[email protected]>--- .../devicetree/bindings/net/marvell,orion-mdio.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +2
-1@@ -47,9 +47,10 @@ unevaluatedProperties: false examples: - | + // MDIO binding with interrupt mdio@d0072004 { compatible = "marvell,orion-mdio"; - reg = <0xd0072004 0x4>; + reg = <0xd0072004 0x84>; #address-cells = <1>; #size-cells = <0>; interrupts = <30>;@@ -62,3 +63,12 @@ examples: reg = <1>; };
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml examples: · line 74
Quoted 10 lines
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +9
-0}; + + - | + // MDIO binding without interrupt + mdio@d0072004 { + compatible = "marvell,orion-mdio"; + reg = <0xd0072004 0x4>; + #address-cells = <1>; + #size-cells = <0>; + };
Why? The same compatible, the same nodes. No differences. Missing pieces is not a big difference justifying new example.
Best regards,
Krzysztof
PATCH v2 1/1 dt-bindings: net: marvell,orion-mdio: Fix examples
As stated in marvell-orion-mdio.txt deleted in commit 0781434af811f ("dt-bindings: net: orion-mdio: Convert to JSON schema") if 'interrupts' property is present, width of 'reg' should be 0x84. Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and add constraints checking whether 'interrupts' property is present and validate it against fixed values in reg.
---
Changelog:v1->v2:
- remove second example
- add 'if:' constraint to 'allOf:'
- move 'allOf:' before 'examples:'
.../bindings/net/marvell,orion-mdio.yaml | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +27 -4
@@ -16,9 +16,6 @@ description: | 8k has a second unit which provides an interface with the xMDIO bus. This driver handles these interfaces. -allOf: - - $ref: "mdio.yaml#" - properties: compatible: enum:
@@ -39,13 +36,39 @@ required: - compatible - reg +allOf: + + - $ref: "mdio.yaml#" + + - if: + required: + - interrupts + + then: + properties: + reg: + items: + - items: + - $ref: /schemas/types.yaml#/definitions/cell + - const: 0x84 + + else: + properties: + reg: + items: + - items: + - $ref: /schemas/types.yaml#/definitions/cell + - enum: + - 0x4 + - 0x10 + unevaluatedProperties: false examples: - | mdio@d0072004 { compatible = "marvell,orion-mdio"; - reg = <0xd0072004 0x4>; + reg = <0xd0072004 0x84>; #address-cells = <1>; #size-cells = <0>; interrupts = <30>;
Signature · 1 line
2.34.1
Re: [PATCH v2] dt-bindings: net: marvell,orion-mdio: Fix examples
Quoted 33 lines · Michał Grzelak
As stated in marvell-orion-mdio.txt deleted in commit
0781434af811f("dt-bindings: net: orion-mdio: Convert to JSON schema") if 'interrupts' property is present, width of 'reg' should be0x84. Otherwise, width of 'reg' should be0x4. Fix 'examples:' and add constraints checking whether 'interrupts' property is present and validate it against fixed values in reg.Signed-off-by Michał Grzelak <[email protected]>---
Changelog:v1->v2:
- remove second example
- add 'if:' constraint to 'allOf:'
- move 'allOf:' before 'examples:'.../bindings/net/marvell,orion-mdio.yaml | 31 ++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +0
-3@@ -16,9 +16,6 @@ description: | 8k has a second unit which provides an interface with the xMDIO bus. This driver handles these interfaces. -allOf: - - $ref: "mdio.yaml#" - properties: compatible: enum:
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml required: · line 40
Quoted 5 lines
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +2
-0@@ -39,13 +36,39 @@ required: - compatible - reg +allOf: +
Drop blank line.
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml required: · line 41
Quoted 1 line
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +1
-0+ - $ref: "mdio.yaml#"
Drop quotes while moving it.
Quoted 12 lines
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +12
-0+ + - if: + required: + - interrupts + + then: + properties: + reg: + items: + - items: + - $ref: /schemas/types.yaml#/definitions/cell + - const: 0x84
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml required: · line 63
Quoted 10 lines
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml +10
-0+ + else: + properties: + reg: + items: + - items: + - $ref: /schemas/types.yaml#/definitions/cell + - enum: + - 0x4 + - 0x10
Rest looks good.
Best regards,
Krzysztof