[PATCH 10/10] net: fec_imx: Add devicetree support for mdio bus

Sascha Hauer s.hauer at pengutronix.de
Wed May 21 05:19:00 PDT 2014


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 at pengutronix.de>
---
 drivers/net/fec_imx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 72e689d..cc2a331 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
-- 
2.0.0.rc0




More information about the barebox mailing list