diff options
author | Stefan Roese <sr@denx.de> | 2014-01-29 05:32:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-01-30 19:25:48 -0500 |
commit | f8d56d8f892be43a2404356073e16401eb5a42e6 (patch) | |
tree | e7b8f7217e8d5c7ecdfdf1cdc795f01fb1d6fdf2 | |
parent | 53d8ab29f8f6d67e37857b68189b38fa3d87dd8e (diff) |
net: eth: cpsw: Correctly attach to GPIO bitbang MDIO driver
When the GPIO bitbang MDIO driver is used instead of the Davinci MDIO driver
we need to configure the phy_id string differently. Otherwise this string
looks like this "gpio.6" instead of "gpio-0" and the PHY is not found when
phy_connect() is called.
Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Lukas Stockmann <lukas.stockmann@siemens.com>
Cc: Mugunthan V N <mugunthanvnm@ti.com>
Acked-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/ti/cpsw.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index bde63e3af96f..1d860ce914ed 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -1878,8 +1878,18 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1878 | mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); | 1878 | mdio_node = of_find_node_by_phandle(be32_to_cpup(parp)); |
1879 | phyid = be32_to_cpup(parp+1); | 1879 | phyid = be32_to_cpup(parp+1); |
1880 | mdio = of_find_device_by_node(mdio_node); | 1880 | mdio = of_find_device_by_node(mdio_node); |
1881 | snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), | 1881 | |
1882 | PHY_ID_FMT, mdio->name, phyid); | 1882 | if (strncmp(mdio->name, "gpio", 4) == 0) { |
1883 | /* GPIO bitbang MDIO driver attached */ | ||
1884 | struct mii_bus *bus = dev_get_drvdata(&mdio->dev); | ||
1885 | |||
1886 | snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), | ||
1887 | PHY_ID_FMT, bus->id, phyid); | ||
1888 | } else { | ||
1889 | /* davinci MDIO driver attached */ | ||
1890 | snprintf(slave_data->phy_id, sizeof(slave_data->phy_id), | ||
1891 | PHY_ID_FMT, mdio->name, phyid); | ||
1892 | } | ||
1883 | 1893 | ||
1884 | mac_addr = of_get_mac_address(slave_node); | 1894 | mac_addr = of_get_mac_address(slave_node); |
1885 | if (mac_addr) | 1895 | if (mac_addr) |