login
Header Space

 
 

Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Laurent Pinchart <laurentp@...>
Cc: Scott Wood <scottwood@...>, <linuxppc-dev@...>, <netdev@...>
Date: Tuesday, April 22, 2008 - 11:36 am

On Tue, Apr 22, 2008 at 05:21:49PM +0200, Laurent Pinchart wrote:

Hm... PHYs are having bus_id equal to MDIOBUS:PHYID, for example
e0024520:02, see fs_enet-main.c find_phy() and fs_init_phy():

        data = of_get_property(np, "phy-handle", &len);
        phynode = of_find_node_by_phandle(*data);
        mdionode = of_get_parent(phynode);
        ret = of_address_to_resource(mdionode, 0, &res);
        data = of_get_property(phynode, "reg", &len);
        snprintf(fpi->bus_id, 16, PHY_ID_FMT, res.start, *data);
...
	phydev = phy_connect(dev, fep->fpi->bus_id, &fs_adjust_link, 0,
		PHY_INTERFACE_MODE_MII);

So in the device tree you could do this:

mdio@<GPIO bank addr> {
	compatible = "linux,mdio-gpio";
	...
	phy123: ethernet-phy@2 {
		reg = <2>;
		device_type = "ethernet-phy";
	};
};

ethernet@... {
	...
	compatible = "fs_enet";
	...
	phy-handle = <&phy123>;
};

And fs_enet will match mdio-ofgpio driver.

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Laurent Pinchart, (Wed Apr 16, 10:40 am)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Anton Vorontsov, (Wed Apr 16, 12:05 pm)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Laurent Pinchart, (Wed Apr 16, 12:09 pm)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Laurent Pinchart, (Fri Apr 18, 7:34 am)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Laurent Pinchart, (Tue Apr 22, 4:55 am)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Laurent Pinchart, (Tue Apr 22, 11:21 am)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Laurent Pinchart, (Tue Apr 22, 11:55 am)
Re: [RFC fs_enet: Convert MII bitbang driver to use GPIO lib, Anton Vorontsov, (Tue Apr 22, 11:36 am)
speck-geostationary