summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-10-13 22:29:48 +0000
committeryongari <yongari@FreeBSD.org>2010-10-13 22:29:48 +0000
commit893b9eec864d62c7eba5010f46d140cf9db483e3 (patch)
tree65b7aeeb49c560f18d75100ee3a3fc977c606a6e /sys/dev/bge
parent08b8d916b5887267ef963fd711f1e65b7d8378ac (diff)
downloadFreeBSD-src-893b9eec864d62c7eba5010f46d140cf9db483e3.zip
FreeBSD-src-893b9eec864d62c7eba5010f46d140cf9db483e3.tar.gz
Fix a regression introduced in r213710. r213710 removed the use of
auto polling such that it made all controllers obtain link status information from the state of the LNKRDY input signal. Broadcom recommends disabling auto polling such that driver should rely on PHY interrupts for link status change indications. Unfortunately it seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY related issues so Linux took other approach to workaround it. bge(4) didn't follow that and it used to enable auto polling to workaround it. Restore this old behavior for BCM5700 family controllers and BCM5705 to use auto polling. For BCM5700 and BCM5701, it seems it does not need to enable auto polling but I restored it for safety. Special thanks to marius who tried lots of patches with patience. Reported by: marius Tested by: marius
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index a5ff0fd..e6c0e0e 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -2012,6 +2012,10 @@ bge_blockinit(struct bge_softc *sc)
if (sc->bge_flags & BGE_FLAG_TBI) {
CSR_WRITE_4(sc, BGE_MI_STS, BGE_MISTS_LINK);
} else {
+ if (sc->bge_mi_mode & BGE_MIMODE_AUTOPOLL) {
+ CSR_WRITE_4(sc, BGE_MI_MODE, sc->bge_mi_mode);
+ DELAY(80);
+ }
if (sc->bge_asicrev == BGE_ASICREV_BCM5700 &&
sc->bge_chipid != BGE_CHIPID_BCM5700_B2)
CSR_WRITE_4(sc, BGE_MAC_EVT_ENB,
@@ -2677,6 +2681,9 @@ bge_attach(device_t dev)
sc->bge_mi_mode = BGE_MIMODE_500KHZ_CONST;
else
sc->bge_mi_mode = BGE_MIMODE_BASE;
+ /* Enable auto polling for BCM570[0-5]. */
+ if (BGE_IS_5700_FAMILY(sc) || sc->bge_asicrev == BGE_ASICREV_BCM5705)
+ sc->bge_mi_mode |= BGE_MIMODE_AUTOPOLL;
/*
* All controllers that are not 5755 or higher have 4GB
OpenPOWER on IntegriCloud