bnx: Enable 500Khz MII management interface frequency
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 18 Aug 2012 02:29:18 +0000 (10:29 +0800)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Sat, 18 Aug 2012 02:29:18 +0000 (10:29 +0800)
This stablizes MII read/write, thus avoid MII probing failure

Reported-by: jaydg on #dragonflybsd
Tested-by: jaydg on #dragonflybsd
sys/dev/netif/bnx/if_bnx.c

index d0ac885..a6fa0cc 100644 (file)
@@ -2440,6 +2440,10 @@ bnx_reset(struct bnx_softc *sc)
                CSR_WRITE_4(sc, BGE_SERDES_CFG, serdescfg);
        }
 
                CSR_WRITE_4(sc, BGE_SERDES_CFG, serdescfg);
        }
 
+       CSR_WRITE_4(sc, BGE_MI_MODE,
+           sc->bnx_mi_mode & ~BGE_MIMODE_AUTOPOLL);
+       DELAY(80);
+
        /* XXX: Broadcom Linux driver. */
        if (!BNX_IS_57765_PLUS(sc)) {
                uint32_t v;
        /* XXX: Broadcom Linux driver. */
        if (!BNX_IS_57765_PLUS(sc)) {
                uint32_t v;