Skip to contentSkip to conversation

dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports

PATCH In review Rasmus Villemoes 3 participants 7 messages Mar 24, 2025

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports

As part of a larger series [1] to support an mdio-managed version of the mscc,vsc7514, I found that the current binding does not allow for a 'phys' property for the port nodes.

The driver not only supports this, but requires that information to work correctly. For reference, see the patch series [2], in particular commits [3] and [4].

As I'll have to rework and resend [1], but if possible, I'd like to include these two with acks/reviews when resending. An example showing this phys property used will be included in that larger series.

[1] https://lore.kernel.org/lkml/[email protected]/
[2] "ocelot-external-ports", merged as d4671cb96fa31..26271394cf2e9
[3] dfca93ed51a7c ("net: mscc: ocelot: expose serdes configuration function")
[4] 4c05e5ceecbbc ("net: dsa: ocelot: add support for external phys")

Rasmus Villemoes (2):
Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch
references"
dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for
switch ports

 .../bindings/net/mscc,vsc7514-switch.yaml     | 22 +++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/2 Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references"

The commit log for commit 7c93392d754e ("dt-bindings: net:
mscc,vsc7514-switch: Simplify DSA and switch references") says

The mscc,vsc7514-switch schema doesn't add any custom port properties

In preparation for adding such a custom port property, revert that commit.

---
 .../bindings/net/mscc,vsc7514-switch.yaml          | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +12 -2
index 86a9c3fc76c89..07de52a3a2951 100644
@@ -24,7 +24,7 @@ allOf:
         compatible:
           const: mscc,vsc7514-switch
     then:
-      $ref: ethernet-switch.yaml#/$defs/ethernet-ports
+      $ref: ethernet-switch.yaml#
       required:
         - interrupts
         - interrupt-names
@@ -33,18 +33,28 @@ allOf:
           minItems: 21
         reg-names:
           minItems: 21
+        ethernet-ports:
+          patternProperties:
+            "^port@[0-9a-f]+$":
+              $ref: ethernet-switch-port.yaml#
+              unevaluatedProperties: false
 
   - if:
       properties:
         compatible:
           const: mscc,vsc7512-switch
     then:
-      $ref: /schemas/net/dsa/dsa.yaml#/$defs/ethernet-ports
+      $ref: /schemas/net/dsa/dsa.yaml#
       properties:
         reg:
           maxItems: 20
         reg-names:
           maxItems: 20
+        ethernet-ports:
+          patternProperties:
+            "^port@[0-9a-f]+$":
+              $ref: /schemas/net/dsa/dsa-port.yaml#
+              unevaluatedProperties: false
 
 properties:
   compatible:
Signature · 1 line
2.49.0
maintainer
#2 lore raw

Re: [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references"

Quoted 8 lines · Rasmus Villemoes

The commit log for commit 7c93392d754e ("dt-bindings: net:
mscc,vsc7514-switch: Simplify DSA and switch references") says

The mscc,vsc7514-switch schema doesn't add any custom port properties

In preparation for adding such a custom port property, revert that commit.

This leaves the schema in wrong state until the next patch and doesn't really stand on its own. So I would combine the 2 patches.

Quoted 52 lines
---
 .../bindings/net/mscc,vsc7514-switch.yaml          | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +12 -2
index 86a9c3fc76c89..07de52a3a2951 100644
@@ -24,7 +24,7 @@ allOf:
         compatible:
           const: mscc,vsc7514-switch
     then:
-      $ref: ethernet-switch.yaml#/$defs/ethernet-ports
+      $ref: ethernet-switch.yaml#
       required:
         - interrupts
         - interrupt-names
@@ -33,18 +33,28 @@ allOf:
           minItems: 21
         reg-names:
           minItems: 21
+        ethernet-ports:
+          patternProperties:
+            "^port@[0-9a-f]+$":
+              $ref: ethernet-switch-port.yaml#
+              unevaluatedProperties: false
 
   - if:
       properties:
         compatible:
           const: mscc,vsc7512-switch
     then:
-      $ref: /schemas/net/dsa/dsa.yaml#/$defs/ethernet-ports
+      $ref: /schemas/net/dsa/dsa.yaml#
       properties:
         reg:
           maxItems: 20
         reg-names:
           maxItems: 20
+        ethernet-ports:
+          patternProperties:
+            "^port@[0-9a-f]+$":
+              $ref: /schemas/net/dsa/dsa-port.yaml#
+              unevaluatedProperties: false
 
 properties:
   compatible:
Signature · 1 line
2.49.0
#3 lore raw

PATCH 2/2 dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports

In reply to Rasmus Villemoes

Ports that use SGMII / QSGMII to interface to external phys (or as fixed-link to a cpu mac) need to configure the internal SerDes interface appropriately. Allow an optional 'phys' property to describe those relationships.

---
 .../devicetree/bindings/net/mscc,vsc7514-switch.yaml      | 8 ++++++++
 1 file changed, 8 insertions(+)
Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +8 -0
index 07de52a3a2951..ea741be8edd74 100644
@@ -37,6 +37,10 @@ allOf:
           patternProperties:
             "^port@[0-9a-f]+$":
               $ref: ethernet-switch-port.yaml#
+	      phys:
+	        maxitems: 1
+		description:
+		  Reference to SerDes lane.
               unevaluatedProperties: false
 
   - if:
@@ -54,6 +58,10 @@ allOf:
           patternProperties:
             "^port@[0-9a-f]+$":
               $ref: /schemas/net/dsa/dsa-port.yaml#
+	      phys:
+	        maxitems: 1
+		description:
+		  Reference to SerDes lane.
               unevaluatedProperties: false
 
 properties:
Signature · 1 line
2.49.0
#4 lore raw
Quoted 7 lines · Rasmus Villemoes

Ports that use SGMII / QSGMII to interface to external phys (or as fixed-link to a cpu mac) need to configure the internal SerDes interface appropriately. Allow an optional 'phys' property to describe those relationships.

---

Oops... I had thought 'phys' and 'phy-names' would be part of Documentation/devicetree/bindings/net/ethernet-controller.yaml...

By the way, should you also accept 'phy-names' in the binding?

maintainer
#5 lore raw
Quoted 6 lines · Vladimir Oltean
Quoted 5 lines · Rasmus Villemoes

Ports that use SGMII / QSGMII to interface to external phys (or as fixed-link to a cpu mac) need to configure the internal SerDes interface appropriately. Allow an optional 'phys' property to describe those relationships.

Quoted 7 lines
Quoted 2 lines

---

Oops... I had thought 'phys' and 'phy-names' would be part of Documentation/devicetree/bindings/net/ethernet-controller.yaml...

By the way, should you also accept 'phy-names' in the binding?

No. There's only 1 phy, so not needed.

#6 lore raw
In reply to Rasmus Villemoes
Quoted 10 lines · Rasmus Villemoes

Ports that use SGMII / QSGMII to interface to external phys (or as fixed-link to a cpu mac) need to configure the internal SerDes interface appropriately. Allow an optional 'phys' property to describe those relationships.

---
 .../devicetree/bindings/net/mscc,vsc7514-switch.yaml      | 8 ++++++++
 1 file changed, 8 insertions(+)

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:
./Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml:40:1: [error] syntax error: found character '\t' that cannot start any token (syntax)

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml: ignoring, error parsing file ./Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml:40:1: found a tab character that violates indentation /builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/mfd/mscc,ocelot.yaml:
while scanning a plain scalar
in "<unicode string>", line 39, column 21
found a tab character that violates indentation
in "<unicode string>", line 40, column 1
make[2]: *** Deleting file 'Documentation/devicetree/bindings/net/mscc,vsc7514-switch.example.dts' Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml:40:1: found a tab character that violates indentation make[2]: *** [Documentation/devicetree/bindings/Makefile:26: Documentation/devicetree/bindings/net/mscc,vsc7514-switch.example.dts] Error 1 make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/builds/robherring/dt-review-ci/linux/Makefile:1522: dt_binding_check] Error 2
make: *** [Makefile:248: __sub-make] Error 2

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/[email protected]

The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema.