Re: [PATCH 2/4] dt-bindings: net: dsa: document internal MDIO bus

Vladimir Oltean
2023-09-05T11:11:33Z

On Mon, Sep 04, 2023 at 11:42:19PM -0300, Luiz Angelo Daros de Luca wrote:
> > > [1] ...this. The SMI-controlled and MDIO-controlled Realtek switches are
> > > otherwise the same, right? So why would they have different dt-bindings?
> >
> > Honestly, I'm wondering the answer to this as well. For some reason, when
> > probing the SMI controlled Realtek switches, instead of just letting
> > dsa_switch_setup() populate ds->slave_mii_bus, on realtek_smi_setup_mdio()
> > on realtek-smi.c:
> >
> > - priv->slave_mii_bus is allocated.
> > - mdio_np = of_get_compatible_child(priv->dev->of_node, "realtek,smi-mdio");
> > - priv->slave_mii_bus->dev.of_node = mdio_np;
> > - ds->slave_mii_bus = priv->slave_mii_bus;
>
> I might be able to help here. The Realtek SMI version created a custom
> slave_mii driver because it was the only way to associate it with an
> MDIO DT node. And that DT node was required to specify the interrupts
> for each phy0.
> It would work without that mdio node, letting DSA setup handle the
> slave bus, but it would rely only on polling for port status.

It is possible to set up PHY IRQs even if the MDIO bus is not OF-based.
I think that mv88e6xxx_g2_irq_mdio_setup() does that (sets bus->irq[]).