From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Petazzoni Subject: Re: Fixed PHY Device Tree usage? Date: Fri, 12 Jul 2013 15:04:49 +0200 Message-ID: <20130712150449.4077feb4@skate> References: <20130709183312.6c4d052d@skate> <1733937.SiPWt3mDlH@lenovo> <20130710182216.0dcfaaaf@skate> <20130710183951.09a0bcea@skate> <20130712135612.0f230c1d@skate> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: netdev-owner@vger.kernel.org To: Florian Fainelli Cc: netdev , Sebastian Hesselbarth , Gregory =?UTF-8?B?Q2zDqW1lbnQ=?= , Ezequiel Garcia , Lior Amsalem , "devicetree-discuss@lists.ozlabs.org" , "grant.likely" , afleming@freescale.com List-Id: devicetree@vger.kernel.org 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