GRETH: cleaned up parts of PHY init code

This commit is contained in:
Daniel Hellstrom
2013-03-14 10:20:15 +01:00
parent 107c5aea26
commit 37ac3b86ea

View File

@@ -471,23 +471,18 @@ auto_neg_done:
} }
/* Force to 10 mbit half duplex if the 10/100 MAC is used with a 1000 PHY */ /* Force to 10 mbit half duplex if the 10/100 MAC is used with a 1000 PHY */
if (((sc->gb) && !(sc->gbit_mac)) || !((phyctrl >> 12) & 1)) {
write_mii(sc, phyaddr, 0, sc->sp << 13);
/* check if marvell 88EE1111 PHY. Needs special reset handling */ /* check if marvell 88EE1111 PHY. Needs special reset handling */
if ((phystatus & 1) && (sc->phydev.vendor == 0x005043) && (sc->phydev.device == 0x0C)) { if ((phystatus & 1) && (sc->phydev.vendor == 0x005043) &&
if (((sc->gb) && !(sc->gbit_mac)) || !((phyctrl >> 12) & 1)) { (sc->phydev.device == 0x0C))
write_mii(sc, phyaddr, 0, sc->sp << 13);
write_mii(sc, phyaddr, 0, 0x8000); write_mii(sc, phyaddr, 0, 0x8000);
sc->gb = 0; sc->gb = 0;
sc->sp = 0; sc->sp = 0;
sc->fd = 0; sc->fd = 0;
} }
} else {
if (((sc->gb) && !(sc->gbit_mac)) || !((phyctrl >> 12) & 1)) {
write_mii(sc, phyaddr, 0, sc->sp << 13);
sc->gb = 0;
sc->sp = 0;
sc->fd = 0;
}
}
while ((read_mii(sc, phyaddr, 0)) & 0x8000) {} while ((read_mii(sc, phyaddr, 0)) & 0x8000) {}
regs->ctrl = GRETH_CTRL_RST; /* Reset ON */ regs->ctrl = GRETH_CTRL_RST; /* Reset ON */