Subject: Re: Fixed PHY Device Tree usage?

From: Thomas Petazzoni <[email-masked]>
Date: Fri, 12 Jul 2013 15:04:49 +0200

Dear Florian Fainelli,

On Fri, 12 Jul 2013 13:05:59 +0100, Florian Fainelli wrote:

> I am talking about scanning the MDIO bus DT nodes, not the entire DT.
> That job is already done by of_mdiobus_probe() to register PHY
> devices, so having a central point where the knowledge of how to treat
> PHY deivces could be here I guess.

So, I guess your idea is to call of_mdiobus_register() from
drivers/net/phy/fixed.c:fixed_mdio_bus_init(). But then, what DT node
will you be passing to of_mdiobus_register() ? As a reminder, this
function takes as a second argument the DT node that contains the
various PHYs as sub-nodes.

In all the other PHY drivers, the MDIO bus node as a compatible string,
so the usual platform_driver/platform_device mechanism kicks in, and
calls the ->probe() function, passing the DT node of the MDIO bus,
which is then used by the PHY driver ->probe() function as the second
argument of of_mdiobus_register().

But the fixed.c PHY driver is not a platform_driver, and in our
discussion, we mentioned that it wouldn't make sense to have a
compatible string for the fixed MDIO bus DT node.

So I'm still unsure *which* DT node you'll pass as the second argument
of of_mdiobus_register() :-)

> Well either we go with some specific compatible property like
> "ethernet-phy-fixed" for instance, or we simply add a boolean property
> to the node, so a fixed PHY would either look like this:
> 
> phy {
>          compatible = "linux,ethernet-phy-fixed";
>          speed = <1000>;
>          duplex = <1>;
>          pause;
>          asym-pause;
> };
> 
> or respectively, something like this:
> 
> phy {
>          fixed;
>          speed = <1000>;
>          duplex = <1>;
>          pause;
>          asym-pause;
> };

Yeah, that's fine, I have no problem with the internal properties of
the PHY nodes themselves. My question is really the one described above.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com