> While Andrew's suggestion to use of_mdiobus_register() even for the
> built-in DSA created slave_mii_bus makes sense, I would rather recommend
> you instantiate your own bus (ala mv88e6xxx), such that your DT will
> likely look like:

Hi Florian

I could still look like this, if the built in slave_mii_bus looked for
the mdio node.

Something like:

diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
index 44e3fb7dec8c..6b64c09413bf 100644
--- a/net/dsa/dsa2.c
+++ b/net/dsa/dsa2.c
@@ -312,6 +312,7 @@ static void dsa_port_teardown(struct dsa_port *dp)
 
 static int dsa_switch_setup(struct dsa_switch *ds)
 {
+       struct device_node *node;
        int err;
 
        /* Initialize ds->phys_mii_mask before registering the slave MDIO bus
@@ -347,7 +348,11 @@ static int dsa_switch_setup(struct dsa_switch *ds)
 
                dsa_slave_mii_bus_init(ds);
 
-               err = mdiobus_register(ds->slave_mii_bus);
+               if (ds->dev->of_node &&
+                   node = of_get_child_by_name(pdev->dev.of_node, "mdio"))
+                       err = of_mdiobus_register(ds->slave_mii_bus, node);
+               else
+                       err = mdiobus_register(ds->slave_mii_bus);
                if (err < 0)
                        return err;
        }

        Andrew

Reply via email to