Re: [PATCH net-next v2 2/4] dt-bindings: net: dsa: Add SoC-e SWIP switch
From: Vasilij Strassheim
Date: Tue Sep 08 2026 - 14:20:13 EST
On Mon, 2026-09-07 at 21:04 +0200, Andrew Lunn wrote:
> > + patternProperties:
> > + '^mdio@[0-9a-f]+$':
> > + $ref: /schemas/net/mdio.yaml#
> > + unevaluatedProperties: false
> > +
> > + properties:
> > + reg:
> > + maximum: 30
> > + description:
> > + MDIO controller output index, which must be lower than the
> > + number of implemented switch ports.
>
> Is there a relationship between an MDIO bus and a port?
Yes, there is a one-to-one relationship for this IP. The MDIO bus
selector corresponds to the switch port index.
>
> I'm just wondering if the MDIO bus should be a property of the
> port. There are switch which have an MDIO bus per port.
>
I see this model in the new NETC switch binding. I will move the
optional mdio node below the corresponding ethernet-port@N and derive
the selector from the port's reg.
> > +patternProperties:
> > + '^(ethernet-)?ports$':
> > + patternProperties:
> > + '^(ethernet-)?port@[0-9a-f]+$':
> > + $ref: dsa-port.yaml#
> > + unevaluatedProperties: false
> > +
> > + properties:
> > + reg:
> > + maximum: 30
> > + description:
> > + Switch port index. Supported switch configurations have
> > + up to 31 ports, numbered from 0 through 30.
>
> 30 seems odd. Is 31 something special?
>
The hardware stores the port count directly in a 5-bit field, so 31 is
the maximum representable count. Therefore, valid zero-based port
indices range from 0 to 30. The switch documentation is unclear about
the encoding, but I tested a three-port configuration and the field
contained 3.
> > +examples:
> > + - |
> > + ethernet-switch@80020000 {
> > + compatible = "soce,swip-00-04-0c-10";
> > + reg = <0x80020000 0x10000>;
> > +
> > + ports {
> > + #address-cells = <1>;
> > + #size-cells = <0>;
> > +
> > + port@0 {
> > + reg = <0>;
> > + label = "lan0";
>
> label is another thing in DSA which is today not best practice. I
> would drop this.
I have no problem removing the label from example. I'll have to
adjust it anyway for the new MDIO bus and port relationship.
>
> Andrew
Thanks,
Vasilij