diff options
author | Imre Kaloz <kaloz@openwrt.org> | 2008-12-08 14:46:04 +0000 |
---|---|---|
committer | Imre Kaloz <kaloz@openwrt.org> | 2008-12-08 14:46:04 +0000 |
commit | c3a7bdddbd966a7326d511e0cddb57d944724ebe (patch) | |
tree | 74bccf0500b7b756ae9f36135d18639a1d825266 /target/linux/ixp4xx/patches-2.6.28/203-npe_driver_phy_reset_autoneg.patch | |
parent | dbb6568731907034243ca5bdc3edf1d88c57a95d (diff) | |
download | upstream-c3a7bdddbd966a7326d511e0cddb57d944724ebe.tar.gz upstream-c3a7bdddbd966a7326d511e0cddb57d944724ebe.tar.bz2 upstream-c3a7bdddbd966a7326d511e0cddb57d944724ebe.zip |
preliminary ixp4xx 2.6.28 support
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13548 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ixp4xx/patches-2.6.28/203-npe_driver_phy_reset_autoneg.patch')
-rw-r--r-- | target/linux/ixp4xx/patches-2.6.28/203-npe_driver_phy_reset_autoneg.patch | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/target/linux/ixp4xx/patches-2.6.28/203-npe_driver_phy_reset_autoneg.patch b/target/linux/ixp4xx/patches-2.6.28/203-npe_driver_phy_reset_autoneg.patch new file mode 100644 index 0000000000..b6519f0343 --- /dev/null +++ b/target/linux/ixp4xx/patches-2.6.28/203-npe_driver_phy_reset_autoneg.patch @@ -0,0 +1,42 @@ +--- a/drivers/net/arm/ixp4xx_eth.c ++++ b/drivers/net/arm/ixp4xx_eth.c +@@ -322,8 +322,12 @@ static void phy_reset(struct net_device + struct port *port = netdev_priv(dev); + int phy_id = port->mii[idx].phy_id; + int cycles = 0; ++ u16 bmcr; + +- mdio_write(dev, phy_id, MII_BMCR, port->mii_bmcr[idx] | BMCR_RESET); ++ /* reset the PHY */ ++ bmcr = mdio_read(dev, phy_id, MII_BMCR); ++ bmcr |= BMCR_ANENABLE; ++ mdio_write(dev, phy_id, MII_BMCR, bmcr | BMCR_RESET); + + while (cycles < MAX_MII_RESET_RETRIES) { + if (!(mdio_read(dev, phy_id, MII_BMCR) & BMCR_RESET)) { +@@ -331,13 +335,23 @@ static void phy_reset(struct net_device + printk(KERN_DEBUG "%s: phy_reset() took %i cycles\n", + dev->name, cycles); + #endif +- return; ++ break; + } + udelay(1); + cycles++; + } + +- printk(KERN_ERR "%s: MII reset failed on PHY%2d\n", dev->name, phy_id); ++ if (cycles == MAX_MII_RESET_RETRIES) { ++ printk(KERN_ERR "%s: MII reset failed on PHY%2d\n", dev->name, ++ phy_id); ++ return; ++ } ++ ++ /* restart auto negotiation */ ++ bmcr = mdio_read(dev, phy_id, MII_BMCR); ++ bmcr |= (BMCR_ANENABLE | BMCR_ANRESTART); ++ mdio_write(dev, phy_id, MII_BMCR, bmcr); ++ + } + + static void eth_set_duplex(struct port *port, int full_duplex) |