aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@st.com>2012-04-04 00:33:19 -0400
committerDavid S. Miller <davem@davemloft.net>2012-04-04 18:39:23 -0400
commitf142af2e2064546ac470e8690acbd189b3584e67 (patch)
tree775c36dd86492fdc69f5b6f72bf56ef0d226df65 /drivers/net
parent9450f7506d28276c603275f84e54fc8779fb516c (diff)
stmmac: Allow stmmac to work with other PHY buses(v3).
As stmmac mdio bus name prefix is hardcoded in the driver, this allows only phys on stmmac mdio buses to connect, however stmmac should allow phys on other mdio buses too. This patch adds new variable phy_bus_name to plat_stmmacenet_data struct to let the BSP decide which phy bus to be used by stmmac driver. A typical use-case is to have generic MDIO buses like mdio-gpio on top of stmmac. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e85ffbd5483..860519c4d9a 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -307,7 +307,13 @@ static int stmmac_init_phy(struct net_device *dev)
307 priv->speed = 0; 307 priv->speed = 0;
308 priv->oldduplex = -1; 308 priv->oldduplex = -1;
309 309
310 snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x", priv->plat->bus_id); 310 if (priv->plat->phy_bus_name)
311 snprintf(bus_id, MII_BUS_ID_SIZE, "%s-%x",
312 priv->plat->phy_bus_name, priv->plat->bus_id);
313 else
314 snprintf(bus_id, MII_BUS_ID_SIZE, "stmmac-%x",
315 priv->plat->bus_id);
316
311 snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id, 317 snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, bus_id,
312 priv->plat->phy_addr); 318 priv->plat->phy_addr);
313 pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id); 319 pr_debug("stmmac_init_phy: trying to attach to %s\n", phy_id);