summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-04-20 01:37:36 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-04-20 01:37:36 +0000
commit6b14950b5e986719e0e2a2e5dbf52630d8d57623 (patch)
tree9c56bd67e829cd12960e03f2c5ca3412bfdefb30 /sys
parent3907efe166bb0680d214330544f0a8be0c698ee2 (diff)
rev 1.35 added special register settings for BCM5704 chipsets when
in TBI mode for fiber adapters which causes problems for some systems. Add code to detect when the special settings are necessary which helps with some blade systems. From FreeBSD ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_bge.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 8459839c612..3682b3be2e8 100644
--- a/sys/dev/pci/if_bge.c
+++ b/sys/dev/pci/if_bge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bge.c,v 1.225 2008/04/20 01:32:43 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.226 2008/04/20 01:37:35 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -3170,15 +3170,18 @@ bge_ifmedia_upd(struct ifnet *ifp)
*/
if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5704) {
u_int32_t sgdig;
- CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
- sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
- sgdig |= BGE_SGDIGCFG_AUTO|
- BGE_SGDIGCFG_PAUSE_CAP|
- BGE_SGDIGCFG_ASYM_PAUSE;
- CSR_WRITE_4(sc, BGE_SGDIG_CFG,
- sgdig|BGE_SGDIGCFG_SEND);
- DELAY(5);
- CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
+ sgdig = CSR_READ_4(sc, BGE_SGDIG_STS);
+ if (sgdig & BGE_SGDIGSTS_DONE) {
+ CSR_WRITE_4(sc, BGE_TX_TBI_AUTONEG, 0);
+ sgdig = CSR_READ_4(sc, BGE_SGDIG_CFG);
+ sgdig |= BGE_SGDIGCFG_AUTO |
+ BGE_SGDIGCFG_PAUSE_CAP |
+ BGE_SGDIGCFG_ASYM_PAUSE;
+ CSR_WRITE_4(sc, BGE_SGDIG_CFG,
+ sgdig | BGE_SGDIGCFG_SEND);
+ DELAY(5);
+ CSR_WRITE_4(sc, BGE_SGDIG_CFG, sgdig);
+ }
}
break;
case IFM_1000_SX: