Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 46927
b: refs/heads/master
c: a1862a5
h: refs/heads/master
i:
  46925: 9038254
  46923: c44b851
  46919: fd75b48
  46911: 668e557
v: v3
  • Loading branch information
Li Yang authored and Jeff Garzik committed Feb 9, 2007
1 parent d713835 commit 29f3f58
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 67 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ee8d33c64df9a719fd61ba693203e3b33b9e10a
refs/heads/master: a1862a53df1a57387aeee059276ba4233e12b4db
71 changes: 5 additions & 66 deletions trunk/drivers/net/ucc_geth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,82 +1709,21 @@ static void adjust_link(struct net_device *dev)
if (mii_info->speed != ugeth->oldspeed) {
switch (mii_info->speed) {
case 1000:
#ifdef CONFIG_PPC_MPC836x
/* FIXME: This code is for 100Mbs BUG fixing,
remove this when it is fixed!!! */
if (ugeth->ug_info->enet_interface ==
ENET_1000_GMII)
/* Run the commands which initialize the PHY */
{
tempval =
(u32) mii_info->mdio_read(ugeth->
dev, mii_info->mii_id, 0x1b);
tempval |= 0x000f;
mii_info->mdio_write(ugeth->dev,
mii_info->mii_id, 0x1b,
(u16) tempval);
tempval =
(u32) mii_info->mdio_read(ugeth->
dev, mii_info->mii_id,
MII_BMCR);
mii_info->mdio_write(ugeth->dev,
mii_info->mii_id, MII_BMCR,
(u16) (tempval | BMCR_RESET));
} else if (ugeth->ug_info->enet_interface ==
ENET_1000_RGMII)
/* Run the commands which initialize the PHY */
{
tempval =
(u32) mii_info->mdio_read(ugeth->
dev, mii_info->mii_id, 0x1b);
tempval = (tempval & ~0x000f) | 0x000b;
mii_info->mdio_write(ugeth->dev,
mii_info->mii_id, 0x1b,
(u16) tempval);
tempval =
(u32) mii_info->mdio_read(ugeth->
dev, mii_info->mii_id,
MII_BMCR);
mii_info->mdio_write(ugeth->dev,
mii_info->mii_id, MII_BMCR,
(u16) (tempval | BMCR_RESET));
}
msleep(4000);
#endif /* CONFIG_MPC8360 */
adjust_enet_interface(ugeth);
ugeth->ug_info->enet_interface = ENET_1000_RGMII;
break;
case 100:
case 10:
#ifdef CONFIG_PPC_MPC836x
/* FIXME: This code is for 100Mbs BUG fixing,
remove this lines when it will be fixed!!! */
ugeth->ug_info->enet_interface = ENET_100_RGMII;
tempval =
(u32) mii_info->mdio_read(ugeth->dev,
mii_info->mii_id,
0x1b);
tempval = (tempval & ~0x000f) | 0x000b;
mii_info->mdio_write(ugeth->dev,
mii_info->mii_id, 0x1b,
(u16) tempval);
tempval =
(u32) mii_info->mdio_read(ugeth->dev,
mii_info->mii_id,
MII_BMCR);
mii_info->mdio_write(ugeth->dev,
mii_info->mii_id, MII_BMCR,
(u16) (tempval |
BMCR_RESET));
msleep(4000);
#endif /* CONFIG_MPC8360 */
adjust_enet_interface(ugeth);
break;
case 10:
ugeth->ug_info->enet_interface = ENET_10_RGMII;
break;
default:
ugeth_warn
("%s: Ack! Speed (%d) is not 10/100/1000!",
dev->name, mii_info->speed);
break;
}
adjust_enet_interface(ugeth);

ugeth_info("%s: Speed %dBT", dev->name,
mii_info->speed);
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ucc_geth_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ static int marvell_init(struct ugeth_mii_info *mii_info)
ugphy_vdbg("%s: IN", __FUNCTION__);

ucc_geth_phy_write(mii_info, 0x14, 0x0cd2);
ucc_geth_phy_write(mii_info, 0x1b,
(ucc_geth_phy_read(mii_info, 0x1b) & ~0x000f) | 0x000b);
ucc_geth_phy_write(mii_info, MII_BMCR,
ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET);
msleep(4000);
Expand Down

0 comments on commit 29f3f58

Please sign in to comment.