diff options
author | yongari <yongari@FreeBSD.org> | 2012-12-20 04:47:31 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2012-12-20 04:47:31 +0000 |
commit | 0bf55e8b804d2a44fb71e418bdfad66764896b9b (patch) | |
tree | 528769fef9499e6fbb5b1559851042cdf656f488 | |
parent | 809ad0530abff8c23dac251ca710694ec7106fdc (diff) | |
download | FreeBSD-src-0bf55e8b804d2a44fb71e418bdfad66764896b9b.zip FreeBSD-src-0bf55e8b804d2a44fb71e418bdfad66764896b9b.tar.gz |
For fiber PHYs, BRGPHY_MII_1000CTL register is not defined at all
so do not touch it.
-rw-r--r-- | sys/dev/mii/brgphy.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c index 3dd20ff..f89dbe8 100644 --- a/sys/dev/mii/brgphy.c +++ b/sys/dev/mii/brgphy.c @@ -608,6 +608,11 @@ brgphy_mii_phy_auto(struct mii_softc *sc, int media) (sc->mii_flags & MIIF_FORCEPAUSE) != 0) anar |= BRGPHY_ANAR_PC | BRGPHY_ANAR_ASP; PHY_WRITE(sc, BRGPHY_MII_ANAR, anar); + ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD; + if (sc->mii_mpd_model == MII_MODEL_BROADCOM_BCM5701) + ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC; + PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr); + PHY_READ(sc, BRGPHY_MII_1000CTL); } else { anar = BRGPHY_SERDES_ANAR_FDX | BRGPHY_SERDES_ANAR_HDX; if ((media & IFM_FLOW) != 0 || @@ -616,12 +621,6 @@ brgphy_mii_phy_auto(struct mii_softc *sc, int media) PHY_WRITE(sc, BRGPHY_SERDES_ANAR, anar); } - ktcr = BRGPHY_1000CTL_AFD | BRGPHY_1000CTL_AHD; - if (sc->mii_mpd_model == MII_MODEL_BROADCOM_BCM5701) - ktcr |= BRGPHY_1000CTL_MSE | BRGPHY_1000CTL_MSC; - PHY_WRITE(sc, BRGPHY_MII_1000CTL, ktcr); - ktcr = PHY_READ(sc, BRGPHY_MII_1000CTL); - PHY_WRITE(sc, BRGPHY_MII_BMCR, BRGPHY_BMCR_AUTOEN | BRGPHY_BMCR_STARTNEG); PHY_WRITE(sc, BRGPHY_MII_IMR, 0xFF00); |