[PATCH 1/2] net: fec_imx: mask mii register reads correctly

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


mii registers are 16bit wide, so mask out the higher bits.
The higher bits confuse mii-tool.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 drivers/net/fec_imx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 72e689d..714f8f2 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -89,7 +89,7 @@ static int fec_miibus_read(struct mii_bus *bus, int phyAddr, int regAddr)
 	/*
 	 * it's now safe to read the PHY's register
 	 */
-	return readl(fec->regs + FEC_MII_DATA);
+	return readl(fec->regs + FEC_MII_DATA) & 0xffff;
 }
 
 static int fec_miibus_write(struct mii_bus *bus, int phyAddr,
-- 
2.0.0.rc0




More information about the barebox mailing list