aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r--drivers/net/e100.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index f428c5f72f18..7462fdfd7f92 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1438,19 +1438,31 @@ static int e100_phy_init(struct nic *nic)
1438 } else 1438 } else
1439 DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id); 1439 DPRINTK(HW, DEBUG, "phy_addr = %d\n", nic->mii.phy_id);
1440 1440
1441 /* Isolate all the PHY ids */
1442 for (addr = 0; addr < 32; addr++)
1443 mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
1444 /* Select the discovered PHY */
1445 bmcr &= ~BMCR_ISOLATE;
1446 mdio_write(netdev, nic->mii.phy_id, MII_BMCR, bmcr);
1447
1448 /* Get phy ID */ 1441 /* Get phy ID */
1449 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1); 1442 id_lo = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID1);
1450 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2); 1443 id_hi = mdio_read(netdev, nic->mii.phy_id, MII_PHYSID2);
1451 nic->phy = (u32)id_hi << 16 | (u32)id_lo; 1444 nic->phy = (u32)id_hi << 16 | (u32)id_lo;
1452 DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy); 1445 DPRINTK(HW, DEBUG, "phy ID = 0x%08X\n", nic->phy);
1453 1446
1447 /* Select the phy and isolate the rest */
1448 for (addr = 0; addr < 32; addr++) {
1449 if (addr != nic->mii.phy_id) {
1450 mdio_write(netdev, addr, MII_BMCR, BMCR_ISOLATE);
1451 } else if (nic->phy != phy_82552_v) {
1452 bmcr = mdio_read(netdev, addr, MII_BMCR);
1453 mdio_write(netdev, addr, MII_BMCR,
1454 bmcr & ~BMCR_ISOLATE);
1455 }
1456 }
1457 /*
1458 * Workaround for 82552:
1459 * Clear the ISOLATE bit on selected phy_id last (mirrored on all
1460 * other phy_id's) using bmcr value from addr discovery loop above.
1461 */
1462 if (nic->phy == phy_82552_v)
1463 mdio_write(netdev, nic->mii.phy_id, MII_BMCR,
1464 bmcr & ~BMCR_ISOLATE);
1465
1454 /* Handle National tx phys */ 1466 /* Handle National tx phys */
1455#define NCS_PHY_MODEL_MASK 0xFFF0FFFF 1467#define NCS_PHY_MODEL_MASK 0xFFF0FFFF
1456 if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) { 1468 if ((nic->phy & NCS_PHY_MODEL_MASK) == phy_nsc_tx) {