[PATCH 2/2] dt-bindings: net: dsa: mediatek,mt7530: document MDIO-bus

Andrew Lunn andrew at lunn.ch
Sun Apr 30 11:48:37 PDT 2023


> > Try setting ds->slave_mii_bus to the MDIO bus you register via
> > of_mdiobus_register().
> 
> That seems to be the case already, under mt7530_setup_mdio():
> 
> 	bus = devm_mdiobus_alloc(dev);
> 	if (!bus)
> 		return -ENOMEM;
> 
> 	ds->slave_mii_bus = bus;
> 
> The bus is registered with devm_of_mdiobus_register(), if that matters. (My
> current knowledge about OF or OF helpers for MDIO is next to nothing.)
> 
> The same behaviour is there.

Maybe take a look at what is going on in dsa_slave_phy_setup() and
dsa_slave_phy_connect().

The way i understand it, is it first looks in DT to see if there is a
phy-handle, and if there is, it uses it. If not, it assumes there is a
1:1 mapping between port number and PHY address, and looks to see if a
PHY has been found on ds->slave_mii_bus at that address, and uses it.

So i don't think you need to list the PHY, the fallback should be
used.

	Andrew



More information about the Linux-mediatek mailing list