summaryrefslogtreecommitdiffstats
path: root/drivers/net/fec_imx.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-05-21 11:58:50 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-05-23 15:40:51 +0200
commit0955253ce1de3fd34c711cc351b96975c2fdc673 (patch)
treeb1cc80dc6677864d412145ce8da68645473f0de4 /drivers/net/fec_imx.c
parent1607f679dab49bf5434f0e758247feaca92a50d5 (diff)
downloadbarebox-0955253ce1de3fd34c711cc351b96975c2fdc673.tar.gz
barebox-0955253ce1de3fd34c711cc351b96975c2fdc673.tar.xz
net: fec_imx: Add devicetree support for mdio bus
The fec has a mdio bus. This adds support for a subnode in which the phys on this bus can be specified. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/net/fec_imx.c')
-rw-r--r--drivers/net/fec_imx.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 72e689dcb5..cc2a33174d 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -621,6 +621,7 @@ static int fec_alloc_receive_packets(struct fec_priv *fec, int count, int size)
#ifdef CONFIG_OFDEVICE
static int fec_probe_dt(struct device_d *dev, struct fec_priv *fec)
{
+ struct device_node *mdiobus;
int ret;
ret = of_get_phy_mode(dev->device_node);
@@ -629,6 +630,10 @@ static int fec_probe_dt(struct device_d *dev, struct fec_priv *fec)
else
fec->interface = ret;
+ mdiobus = of_get_child_by_name(dev->device_node, "mdio");
+ if (mdiobus)
+ fec->miibus.dev.device_node = mdiobus;
+
return 0;
}
#else