netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports
@ 2025-03-24  8:55 Rasmus Villemoes
  2025-03-24  8:55 ` [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references" Rasmus Villemoes
  2025-03-24  8:55 ` [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
  0 siblings, 2 replies; 7+ messages in thread
From: Rasmus Villemoes @ 2025-03-24  8:55 UTC (permalink / raw)
  To: Colin Foster, Rob Herring
  Cc: devicetree, Felix Blix Everberg, netdev, Vladimir Oltean,
	Rasmus Villemoes

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/20250319123058.452202-1-ravi@prevas.dk/
[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(-)

-- 
2.49.0


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

* [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references"
  2025-03-24  8:55 [PATCH 0/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
@ 2025-03-24  8:55 ` Rasmus Villemoes
  2025-03-24 14:41   ` Rob Herring
  2025-03-24  8:55 ` [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
  1 sibling, 1 reply; 7+ messages in thread
From: Rasmus Villemoes @ 2025-03-24  8:55 UTC (permalink / raw)
  To: Colin Foster, Rob Herring
  Cc: devicetree, Felix Blix Everberg, netdev, Vladimir Oltean,
	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.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
---
 .../bindings/net/mscc,vsc7514-switch.yaml          | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
index 86a9c3fc76c89..07de52a3a2951 100644
--- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
+++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
@@ -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:
-- 
2.49.0


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

* [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports
  2025-03-24  8:55 [PATCH 0/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
  2025-03-24  8:55 ` [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references" Rasmus Villemoes
@ 2025-03-24  8:55 ` Rasmus Villemoes
  2025-03-24 10:00   ` Vladimir Oltean
  2025-03-24 14:21   ` Rob Herring (Arm)
  1 sibling, 2 replies; 7+ messages in thread
From: Rasmus Villemoes @ 2025-03-24  8:55 UTC (permalink / raw)
  To: Colin Foster, Rob Herring
  Cc: devicetree, Felix Blix Everberg, netdev, Vladimir Oltean,
	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.

Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
---
 .../devicetree/bindings/net/mscc,vsc7514-switch.yaml      | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
index 07de52a3a2951..ea741be8edd74 100644
--- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
+++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
@@ -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:
-- 
2.49.0


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

* Re: [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports
  2025-03-24  8:55 ` [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
@ 2025-03-24 10:00   ` Vladimir Oltean
  2025-03-24 14:39     ` Rob Herring
  2025-03-24 14:21   ` Rob Herring (Arm)
  1 sibling, 1 reply; 7+ messages in thread
From: Vladimir Oltean @ 2025-03-24 10:00 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: Colin Foster, Rob Herring, devicetree, Felix Blix Everberg,
	netdev

On Mon, Mar 24, 2025 at 09:55:06AM +0100, Rasmus Villemoes wrote:
> 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.
> 
> Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
> ---

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?

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

* Re: [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports
  2025-03-24  8:55 ` [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
  2025-03-24 10:00   ` Vladimir Oltean
@ 2025-03-24 14:21   ` Rob Herring (Arm)
  1 sibling, 0 replies; 7+ messages in thread
From: Rob Herring (Arm) @ 2025-03-24 14:21 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: Colin Foster, netdev, Vladimir Oltean, Felix Blix Everberg,
	devicetree


On Mon, 24 Mar 2025 09:55:06 +0100, Rasmus Villemoes wrote:
> 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.
> 
> Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
> ---
>  .../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/20250324085506.55916-3-ravi@prevas.dk

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.


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

* Re: [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports
  2025-03-24 10:00   ` Vladimir Oltean
@ 2025-03-24 14:39     ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2025-03-24 14:39 UTC (permalink / raw)
  To: Vladimir Oltean
  Cc: Rasmus Villemoes, Colin Foster, devicetree, Felix Blix Everberg,
	netdev

On Mon, Mar 24, 2025 at 12:00:55PM +0200, Vladimir Oltean wrote:
> On Mon, Mar 24, 2025 at 09:55:06AM +0100, Rasmus Villemoes wrote:
> > 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.
> > 
> > Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
> > ---
> 
> 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.

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

* Re: [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references"
  2025-03-24  8:55 ` [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references" Rasmus Villemoes
@ 2025-03-24 14:41   ` Rob Herring
  0 siblings, 0 replies; 7+ messages in thread
From: Rob Herring @ 2025-03-24 14:41 UTC (permalink / raw)
  To: Rasmus Villemoes
  Cc: Colin Foster, devicetree, Felix Blix Everberg, netdev,
	Vladimir Oltean

On Mon, Mar 24, 2025 at 09:55:05AM +0100, Rasmus Villemoes wrote:
> 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.

> 
> Signed-off-by: Rasmus Villemoes <ravi@prevas.dk>
> ---
>  .../bindings/net/mscc,vsc7514-switch.yaml          | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
> index 86a9c3fc76c89..07de52a3a2951 100644
> --- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
> +++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml
> @@ -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:
> -- 
> 2.49.0
> 

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

end of thread, other threads:[~2025-03-24 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-24  8:55 [PATCH 0/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
2025-03-24  8:55 ` [PATCH 1/2] Revert "dt-bindings: net: mscc,vsc7514-switch: Simplify DSA and switch references" Rasmus Villemoes
2025-03-24 14:41   ` Rob Herring
2025-03-24  8:55 ` [PATCH 2/2] dt-bindings: net: mscc,vsc7514-switch: allow specifying 'phys' for switch ports Rasmus Villemoes
2025-03-24 10:00   ` Vladimir Oltean
2025-03-24 14:39     ` Rob Herring
2025-03-24 14:21   ` Rob Herring (Arm)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).