[net-next RFC PATCH v2 1/3] dt-bindings: net: dsa: Add Airoha AN8855 Gigabit Switch documentation
Andrew Lunn
andrew at lunn.ch
Wed Oct 23 10:39:01 PDT 2024
> Well the first case that comes to mind is multiple switch and conflict.
> I have no idea if there are hw strap to configure this so I assume if a
> SoC have 2 switch (maybe of the same type), this permits to configure
> them (with reset pin and deasserting them once the base address is
> correctly configured)
Is this switch internal on an internal MDIO bus, or external?
Most PHYs and switches i've seen have strapping pins to set the base
address. It would be unusual if there was not strapping.
For the Marvell switches, the strapping moves all the MDIO
registers. This is why we have a reg at the top level in mv88e6xxx:
ethernet-switch at 0 {
compatible = "marvell,mv88e6085";
reg = <0>;
There is one family which use the values of 0 or 16, and each switch
uses 16 addresses. So you can put two on the bus.
> > > + mdio:
> > > + $ref: /schemas/net/mdio.yaml#
> > > + unevaluatedProperties: false
> > > + description:
> > > + Define the relative address of the internal PHY for each port.
> > > +
> > > + Each reg for the PHY is relative to the switch base PHY address.
> >
> > Which is not the usual meaning of reg.
> >
> > > + mdio {
> > > + #address-cells = <1>;
> > > + #size-cells = <0>;
> > > +
> > > + internal_phy0: phy at 0 {
> > > + reg = <0>;
> >
> > So given that airoha,base_smi_address defaults to 1, this is actually
> > address 1 on the MDIO bus?
> >
>
> Yes correct. One problem I had was that moving this outside the swich
> cause panic as it does conflict with the switch PHY address...
I would make these addresses absolute, not relative. The example above
from the marvell switch, the device using addresses 16-31 has its PHYs
within that range, and we uses the absolute reg values.
Andrew
More information about the Linux-mediatek
mailing list