summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/freescale/xgmac_mdio.c
diff options
context:
space:
mode:
authorShengzhou Liu <Shengzhou.Liu@freescale.com>2015-03-23 10:22:13 (GMT)
committerHonghua Yin <Hong-Hua.Yin@freescale.com>2015-03-27 08:39:35 (GMT)
commit554f5e2a32cd5b13627d1da10b11b242de046a70 (patch)
treea15b292c5eaea0d7064fa6799f14d7eef310434b /drivers/net/ethernet/freescale/xgmac_mdio.c
parentfc3261c1e7c734758113ef9fe7bf5a5ab7f569df (diff)
downloadlinux-fsl-qoriq-554f5e2a32cd5b13627d1da10b11b242de046a70.tar.xz
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 <Shengzhou.Liu@freescale.com> Change-Id: Ib85b1858d1cca310992b892dd1c86a129c36e7d2 Reviewed-on: http://git.am.freescale.net:8181/33272 Tested-by: Honghua Yin <Hong-Hua.Yin@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/xgmac_mdio.c')
-rw-r--r--drivers/net/ethernet/freescale/xgmac_mdio.c9
1 files changed, 9 insertions, 0 deletions
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 <linux/mdio.h>
#include <linux/of_platform.h>
#include <linux/of_mdio.h>
+#ifdef CONFIG_FMAN_V3L
+#include <asm/mpc85xx.h>
+#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(&regs->mdio_ctl, mdio_ctl | MDIO_CTL_READ);