diff options
author | Li Yang <leoli@freescale.com> | 2007-02-08 04:34:42 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-02-08 20:13:15 -0500 |
commit | a1862a53df1a57387aeee059276ba4233e12b4db (patch) | |
tree | b751b3feb96afb03af6dffdda2fa96b435c6ff40 /drivers | |
parent | 0ee8d33c64df9a719fd61ba693203e3b33b9e10a (diff) |
ucc_geth: Remove obsolete workaround of link speed change
The workaround used a long delay of 4s which caused problem
when two link-changes happens at the same time.
Signed-off-by: Li Yang <leoli@freescale.com>
Signed-off-by: Wu Xiaochuan <xiao-chuan.wu@freescale.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ucc_geth.c | 71 | ||||
-rw-r--r-- | drivers/net/ucc_geth_phy.c | 2 |
2 files changed, 7 insertions, 66 deletions
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index abb8611c5a91..db0370affb6b 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c | |||
@@ -1709,75 +1709,13 @@ static void adjust_link(struct net_device *dev) | |||
1709 | if (mii_info->speed != ugeth->oldspeed) { | 1709 | if (mii_info->speed != ugeth->oldspeed) { |
1710 | switch (mii_info->speed) { | 1710 | switch (mii_info->speed) { |
1711 | case 1000: | 1711 | case 1000: |
1712 | #ifdef CONFIG_PPC_MPC836x | 1712 | ugeth->ug_info->enet_interface = ENET_1000_RGMII; |
1713 | /* FIXME: This code is for 100Mbs BUG fixing, | ||
1714 | remove this when it is fixed!!! */ | ||
1715 | if (ugeth->ug_info->enet_interface == | ||
1716 | ENET_1000_GMII) | ||
1717 | /* Run the commands which initialize the PHY */ | ||
1718 | { | ||
1719 | tempval = | ||
1720 | (u32) mii_info->mdio_read(ugeth-> | ||
1721 | dev, mii_info->mii_id, 0x1b); | ||
1722 | tempval |= 0x000f; | ||
1723 | mii_info->mdio_write(ugeth->dev, | ||
1724 | mii_info->mii_id, 0x1b, | ||
1725 | (u16) tempval); | ||
1726 | tempval = | ||
1727 | (u32) mii_info->mdio_read(ugeth-> | ||
1728 | dev, mii_info->mii_id, | ||
1729 | MII_BMCR); | ||
1730 | mii_info->mdio_write(ugeth->dev, | ||
1731 | mii_info->mii_id, MII_BMCR, | ||
1732 | (u16) (tempval | BMCR_RESET)); | ||
1733 | } else if (ugeth->ug_info->enet_interface == | ||
1734 | ENET_1000_RGMII) | ||
1735 | /* Run the commands which initialize the PHY */ | ||
1736 | { | ||
1737 | tempval = | ||
1738 | (u32) mii_info->mdio_read(ugeth-> | ||
1739 | dev, mii_info->mii_id, 0x1b); | ||
1740 | tempval = (tempval & ~0x000f) | 0x000b; | ||
1741 | mii_info->mdio_write(ugeth->dev, | ||
1742 | mii_info->mii_id, 0x1b, | ||
1743 | (u16) tempval); | ||
1744 | tempval = | ||
1745 | (u32) mii_info->mdio_read(ugeth-> | ||
1746 | dev, mii_info->mii_id, | ||
1747 | MII_BMCR); | ||
1748 | mii_info->mdio_write(ugeth->dev, | ||
1749 | mii_info->mii_id, MII_BMCR, | ||
1750 | (u16) (tempval | BMCR_RESET)); | ||
1751 | } | ||
1752 | msleep(4000); | ||
1753 | #endif /* CONFIG_MPC8360 */ | ||
1754 | adjust_enet_interface(ugeth); | ||
1755 | break; | 1713 | break; |
1756 | case 100: | 1714 | case 100: |
1757 | case 10: | ||
1758 | #ifdef CONFIG_PPC_MPC836x | ||
1759 | /* FIXME: This code is for 100Mbs BUG fixing, | ||
1760 | remove this lines when it will be fixed!!! */ | ||
1761 | ugeth->ug_info->enet_interface = ENET_100_RGMII; | 1715 | ugeth->ug_info->enet_interface = ENET_100_RGMII; |
1762 | tempval = | 1716 | break; |
1763 | (u32) mii_info->mdio_read(ugeth->dev, | 1717 | case 10: |
1764 | mii_info->mii_id, | 1718 | ugeth->ug_info->enet_interface = ENET_10_RGMII; |
1765 | 0x1b); | ||
1766 | tempval = (tempval & ~0x000f) | 0x000b; | ||
1767 | mii_info->mdio_write(ugeth->dev, | ||
1768 | mii_info->mii_id, 0x1b, | ||
1769 | (u16) tempval); | ||
1770 | tempval = | ||
1771 | (u32) mii_info->mdio_read(ugeth->dev, | ||
1772 | mii_info->mii_id, | ||
1773 | MII_BMCR); | ||
1774 | mii_info->mdio_write(ugeth->dev, | ||
1775 | mii_info->mii_id, MII_BMCR, | ||
1776 | (u16) (tempval | | ||
1777 | BMCR_RESET)); | ||
1778 | msleep(4000); | ||
1779 | #endif /* CONFIG_MPC8360 */ | ||
1780 | adjust_enet_interface(ugeth); | ||
1781 | break; | 1719 | break; |
1782 | default: | 1720 | default: |
1783 | ugeth_warn | 1721 | ugeth_warn |
@@ -1785,6 +1723,7 @@ remove this lines when it will be fixed!!! */ | |||
1785 | dev->name, mii_info->speed); | 1723 | dev->name, mii_info->speed); |
1786 | break; | 1724 | break; |
1787 | } | 1725 | } |
1726 | adjust_enet_interface(ugeth); | ||
1788 | 1727 | ||
1789 | ugeth_info("%s: Speed %dBT", dev->name, | 1728 | ugeth_info("%s: Speed %dBT", dev->name, |
1790 | mii_info->speed); | 1729 | mii_info->speed); |
diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c index 3c86592ce03c..6fda6d88be49 100644 --- a/drivers/net/ucc_geth_phy.c +++ b/drivers/net/ucc_geth_phy.c | |||
@@ -376,6 +376,8 @@ static int marvell_init(struct ugeth_mii_info *mii_info) | |||
376 | ugphy_vdbg("%s: IN", __FUNCTION__); | 376 | ugphy_vdbg("%s: IN", __FUNCTION__); |
377 | 377 | ||
378 | ucc_geth_phy_write(mii_info, 0x14, 0x0cd2); | 378 | ucc_geth_phy_write(mii_info, 0x14, 0x0cd2); |
379 | ucc_geth_phy_write(mii_info, 0x1b, | ||
380 | (ucc_geth_phy_read(mii_info, 0x1b) & ~0x000f) | 0x000b); | ||
379 | ucc_geth_phy_write(mii_info, MII_BMCR, | 381 | ucc_geth_phy_write(mii_info, MII_BMCR, |
380 | ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); | 382 | ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); |
381 | msleep(4000); | 383 | msleep(4000); |