summaryrefslogtreecommitdiff
path: root/drivers/net/mxc_fec.c
diff options
context:
space:
mode:
authorFugang Duan <B38611@freescale.com>2012-03-10 15:59:42 +0800
committerLily Zhang <r58066@freescale.com>2012-03-13 14:55:12 +0800
commitd3ea4d7258316ca68ff104087a5f1987b4829339 (patch)
treee357cc3d8f4aef6db55b9e97f20cb6a5cf53d467 /drivers/net/mxc_fec.c
parente3303f5b59df570c1f76b043d85e42be3dc7a63f (diff)
downloadu-boot-imx-d3ea4d7258316ca68ff104087a5f1987b4829339.zip
u-boot-imx-d3ea4d7258316ca68ff104087a5f1987b4829339.tar.gz
u-boot-imx-d3ea4d7258316ca68ff104087a5f1987b4829339.tar.bz2
ENGR00176347-9 fec : increase wait time for phy link
- remove the excrescent code in enet_board_init function. - KSZ9021 phy auto-negotiation in mx6solo sabreauto RevA is used to establish link with the remote hub or switch. In general, the negotiation time is about 3-5 senconds But connecting to Gbps hub, the time is range from 8s to 15s. So, changing the MAX link waiting time to 20s. According to repetitious tests, solo ARD ethernet is ok in 100Mbps environment. It is not stable in 1000Mbps mode. Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'drivers/net/mxc_fec.c')
-rw-r--r--drivers/net/mxc_fec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/net/mxc_fec.c b/drivers/net/mxc_fec.c
index 345e476..636b606 100644
--- a/drivers/net/mxc_fec.c
+++ b/drivers/net/mxc_fec.c
@@ -350,7 +350,7 @@ static void setFecDuplexSpeed(volatile fec_t *fecp, unsigned char addr,
}
/*wait the cable link*/
- for (cnt = 0; cnt < 100; cnt++) {
+ for (cnt = 0; cnt < 200; cnt++) {
val = 0;
ret = __fec_mii_read(fecp, addr, PHY_BMSR, &val);
if (val & PHY_BMSR_LS)
@@ -366,7 +366,7 @@ static void setFecDuplexSpeed(volatile fec_t *fecp, unsigned char addr,
printf("FEC: Link is Up %x\n", val);
} else {
printf("FEC: Link is down %x\n", val);
- }
+ }
/* for AR8031 PHY */
#if defined(CONFIG_MX6Q_ARM2) || defined(CONFIG_MX6Q_SABRESD)
ret = __fec_mii_read(fecp, addr, PHY_MIPSCR, &val);
@@ -840,6 +840,7 @@ static void fec_mii_phy_init(struct eth_device *dev)
mx6_rgmii_rework(dev->name, info->phy_addr);
#endif
mxc_fec_phy_powerup(dev->name, info->phy_addr);
+#endif
}
@@ -852,6 +853,8 @@ int fec_init(struct eth_device *dev, bd_t *bd)
fec_mii_phy_init(dev);
+#if defined(CONFIG_CMD_MII) || defined(CONFIG_MII) || \
+ defined(CONFIG_DISCOVER_PHY)
#ifdef CONFIG_DISCOVER_PHY
if (info->phy_addr < 0 || info->phy_addr > 0x1F)
info->phy_addr = mxc_fec_mii_discover_phy(dev);
@@ -861,8 +864,8 @@ int fec_init(struct eth_device *dev, bd_t *bd)
#ifndef CONFIG_DISCOVER_PHY
setFecDuplexSpeed(fecp, (uchar)info->phy_addr,
(FECDUPLEX << 16) | FECSPEED);
-#endif /* ifndef CONFIG_SYS_DISCOVER_PHY */
-#endif /* CONFIG_CMD_MII || CONFIG_MII */
+#endif /* ifndef CONFIG_SYS_DISCOVER_PHY */
+#endif /* CONFIG_CMD_MII || CONFIG_MII */
/* We use strictly polling mode only */
fecp->eimr = 0;