diff options
| author | Marius Strobl <marius@FreeBSD.org> | 2011-08-23 14:32:53 +0000 |
|---|---|---|
| committer | Marius Strobl <marius@FreeBSD.org> | 2011-08-23 14:32:53 +0000 |
| commit | 2f99a928214f5fcbc147671ee284f5eca0a500cb (patch) | |
| tree | 3fe00d2c1198646808687d96c44728e98a821451 /sys/dev | |
| parent | 872f14d083034d1579712aefbfbd0080a9bdbb35 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/mii/brgphy.c | 18 | ||||
| -rw-r--r-- | sys/dev/mii/mii_physubr.c | 4 |
2 files changed, 17 insertions, 5 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index c2c4642f4fd7..837aaa298537 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -913,10 +913,22 @@ brgphy_reset(struct mii_softc *sc) struct bge_softc *bge_sc = NULL; struct bce_softc *bce_sc = NULL; struct ifnet *ifp; - int val; + int i, val; + + /* + * Perform a reset. Note that at least some Broadcom PHYs default to + * being powered down as well as isolated after a reset but don't work + * if one or both of these bits are cleared. However, they just work + * fine if both bits remain set, so we don't use mii_phy_reset() here. + */ + PHY_WRITE(sc, BRGPHY_MII_BMCR, BRGPHY_BMCR_RESET); - /* Perform a standard PHY reset. */ - mii_phy_reset(sc); + /* Wait 100ms for it to complete. */ + for (i = 0; i < 100; i++) { + if ((PHY_READ(sc, BRGPHY_MII_BMCR) & BRGPHY_BMCR_RESET) == 0) + break; + DELAY(1000); + } /* Handle any PHY specific procedures following the reset. */ switch (bsc->mii_oui) { diff --git a/sys/dev/mii/mii_physubr.c b/sys/dev/mii/mii_physubr.c index 8a80e4b3c00e..a86ddbb9a8b5 100644 --- a/sys/dev/mii/mii_physubr.c +++ b/sys/dev/mii/mii_physubr.c @@ -276,8 +276,8 @@ mii_phy_reset(struct mii_softc *sc) DELAY(1000); } - /* NB: a PHY may default to isolation. */ - reg &= ~BMCR_ISO; + /* NB: a PHY may default to being powered down and/or isolated. */ + reg &= ~(BMCR_PDOWN | BMCR_ISO); if ((sc->mii_flags & MIIF_NOISOLATE) == 0 && ((ife == NULL && sc->mii_inst != 0) || (ife != NULL && IFM_INST(ife->ifm_media) != sc->mii_inst))) |
