From 554f5e2a32cd5b13627d1da10b11b242de046a70 Mon Sep 17 00:00:00 2001 From: Shengzhou Liu Date: Mon, 23 Mar 2015 18:22:13 +0800 Subject: fsl/mdio: fixup xgmac_mdio_read for rtl8211f on t1023rdb Read RTL8211F PHY registers(e.g. PHY_ID, MII_STAT1000) will fail with xgmac_mdio_read on T1023RDB. so add the MDIO timing delay in xgmac_mdio_read to make it work stably with RTL8211F on T1023RDB. Signed-off-by: Shengzhou Liu Change-Id: Ib85b1858d1cca310992b892dd1c86a129c36e7d2 Reviewed-on: http://git.am.freescale.net:8181/33272 Tested-by: Honghua Yin Reviewed-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c index 2263477..dca1325 100644 --- a/drivers/net/ethernet/freescale/xgmac_mdio.c +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c @@ -19,6 +19,9 @@ #include #include #include +#ifdef CONFIG_FMAN_V3L +#include +#endif /* Number of microseconds to wait for a register to respond */ #define TIMEOUT 1000 @@ -180,6 +183,12 @@ static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) return ret; } +#ifdef CONFIG_FMAN_V3L + /* Fixup for RTL8211F MDIO timing delay on T1023RDB */ + if (SVR_SOC_VER(mfspr(SPRN_SVR)) == SVR_T1023) + udelay(50); +#endif + /* Initiate the read */ out_be32(®s->mdio_ctl, mdio_ctl | MDIO_CTL_READ); -- cgit v0.10.2