aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/fec_mxc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/fec_mxc.c')
-rw-r--r--drivers/net/fec_mxc.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 3affda8fa..24ef418a3 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -206,12 +206,12 @@ static int miiphy_restart_aneg(struct eth_device *dev)
miiphy_write(dev->name, fec->phy_id, MII_ADVERTISE,
LPA_100FULL | LPA_100HALF | LPA_10FULL |
LPA_10HALF | PHY_ANLPAR_PSB_802_3);
- miiphy_write(dev->name, fec->phy_id, MII_BMCR,
- BMCR_ANENABLE | BMCR_ANRESTART);
-
if (fec->mii_postcall)
ret = fec->mii_postcall(fec->phy_id);
+ miiphy_write(dev->name, fec->phy_id, MII_BMCR,
+ BMCR_ANENABLE | BMCR_ANRESTART);
+
return ret;
}
@@ -226,7 +226,7 @@ static int miiphy_wait_aneg(struct eth_device *dev)
*/
start = get_timer(0);
do {
- if (get_timer(start) > (CONFIG_SYS_HZ * 5)) {
+ if (get_timer(start) > (CONFIG_SYS_HZ * 10)) {
printf("%s: Autonegotiation timeout\n", dev->name);
return -1;
}
@@ -378,6 +378,7 @@ static int fec_set_hwaddr(struct eth_device *dev)
static int fec_open(struct eth_device *edev)
{
struct fec_priv *fec = (struct fec_priv *)edev->priv;
+ int speed;
debug("fec_open: fec_open(dev)\n");
/* full-duplex, heartbeat disabled */
@@ -427,8 +428,21 @@ static int fec_open(struct eth_device *edev)
#endif
miiphy_wait_aneg(edev);
- miiphy_speed(edev->name, fec->phy_id);
+ speed = miiphy_speed(edev->name, fec->phy_id);
miiphy_duplex(edev->name, fec->phy_id);
+#ifdef CONFIG_MX6Q
+ {
+ u32 ecr = readl(&fec->eth->ecntrl) & ~(0x1 << 5);
+ u32 rcr = (readl(&fec->eth->r_cntrl) & ~0x300) | 0x44;
+ if (speed == _1000BASET)
+ ecr |= (0x1 << 5);
+ else if (speed != _100BASET)
+ rcr |= (0x1 << 9);
+ writel(ecr, &fec->eth->ecntrl);
+ writel(rcr, &fec->eth->r_cntrl);
+ }
+#endif
+ printf("%s:Speed=%i\n", __func__, speed);
/*
* Enable SmartDMA receive task