summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorMarkus Brunner <systemprogrammierung.brunner@gmail.com>2015-11-03 22:09:51 +0100
committerDavid S. Miller <davem@davemloft.net>2015-11-04 20:57:26 -0500
commit1f71e8c96fc654724723ce987e0a8b2aeb81746d (patch)
tree02381a60da2965c404356268cab7c59d338eb2d9 /drivers/net/ethernet
parentd9c7dbc11a140851deca7ca080c6fa2661676992 (diff)
downloadlinux-1f71e8c96fc654724723ce987e0a8b2aeb81746d.tar.bz2
drivers: net: cpsw: Add support for fixed-link PHY
Add support for a fixed-link devicetree sub-node in case the the cpsw MAC is directly connected to a non-mdio PHY/device. Signed-off-by: Markus Brunner <systemprogrammierung.brunner@gmail.com> Acked-by: Mugunthan V N <mugunthanvnm@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/ti/cpsw.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 040fbc1e5508..48b92c9de12a 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -2037,6 +2037,19 @@ static int cpsw_probe_dt(struct cpsw_priv *priv,
continue;
priv->phy_node = of_parse_phandle(slave_node, "phy-handle", 0);
+ if (of_phy_is_fixed_link(slave_node)) {
+ struct phy_device *pd;
+
+ ret = of_phy_register_fixed_link(slave_node);
+ if (ret)
+ return ret;
+ pd = of_phy_find_device(slave_node);
+ if (!pd)
+ return -ENODEV;
+ snprintf(slave_data->phy_id, sizeof(slave_data->phy_id),
+ PHY_ID_FMT, pd->bus->id, pd->phy_id);
+ goto no_phy_slave;
+ }
parp = of_get_property(slave_node, "phy_id", &lenp);
if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) {
dev_err(&pdev->dev, "Missing slave[%d] phy_id property\n", i);