diff options
author | Eric Miao <eric.miao@linaro.org> | 2012-01-17 21:11:54 +0800 |
---|---|---|
committer | Eric Miao <eric.miao@linaro.org> | 2012-01-17 21:11:54 +0800 |
commit | c493c61a212aa7599d619ae9d19b9f6af73ff663 (patch) | |
tree | 6739705276cde364703736ac78f21c0c6af679f2 /drivers/net/fec_mxc.c | |
parent | 5878df1b7162cea6b65436b5dedb5f37fc1cc8f3 (diff) | |
parent | dda3e196c5317dfeddd4cc089512c2327b05ff23 (diff) |
Merge branch 'dirkbehme/master_imx6' into lt-imx6lt-imx6
* dirkbehme/master_imx6: (22 commits)
imximage: Sort bootops alphabetically
imximage: Add support for i.MX6
imximage: Add MX53 to the documentation
common/image.c: align usage of fdt_high with initrd_high
mx6q: Add fdt_high and initrd_high variables
mx6x_pins: fix uart txd definitions
mx6qsabrelite: setup uart1 pinmux
mx6qsabrelite: add SPI NOR support
mx6q: add ECSPI pad settings
add imx_ecspi driver
fec_mxc: move autonegoatiate restart after mii_postcall
fsl_esdhc: fix PIO mode transfers
mx6qsabrelite: enet: force master, maximize tx clock delay
mx6qsabrelite: add CONFIG_PHY_MICREL_KSZ9021
miiphyutil: add Micrel KSZ9021 support to miiphy_speed
fec_mxc: increase autonegotiation timeout
fec_mxc: add 1000 Mbps selection
mx6qsabrelite: use IMX_GPIO_NR macro
i.mx6:imx6q: allign MAC address with burned-in ordering
i.mx6q: mx6qarm2: Enable the usboh3 clock
...
Diffstat (limited to 'drivers/net/fec_mxc.c')
-rw-r--r-- | drivers/net/fec_mxc.c | 24 |
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 |