[PATCH 5/5] net: fec_imx: configure FEC for 10Mbit when necessary

Wolfram Sang w.sang at pengutronix.de
Tue Jan 24 08:53:51 EST 2012


Signed-off-by: Wolfram Sang <w.sang at pengutronix.de>
---
 drivers/net/fec_imx.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 45af78f..653b488 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -373,6 +373,17 @@ static int fec_open(struct eth_device *edev)
 		ret = miidev_wait_aneg(&fec->miidev);
 		if (ret)
 			return ret;
+
+		ret = miidev_get_status(&fec->miidev);
+		if (ret < 0)
+			return ret;
+
+		if (ret & MIIDEV_STATUS_IS_10MBIT) {
+			u32 rcntl = readl(fec->regs + FEC_R_CNTRL);
+			rcntl |= FEC_R_CNTRL_RMII_10T;
+			writel(rcntl, fec->regs + FEC_R_CNTRL);
+		}
+
 		miidev_print_status(&fec->miidev);
 	}
 
-- 
1.7.8.3




More information about the barebox mailing list