summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2011-02-15 19:49:48 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2011-02-15 19:49:48 +0000
commit5aed391d332653d29a2fa64f5d60e06fc3a454b3 (patch)
treed55785269bb0c1228cbe1933d1095783c3a6738a /sys/dev
parent29d37a61b98670babd54e5f12f3772bfbdf6e678 (diff)
Add workaround for BCM5906 A0/1/2 controller silicon bug. When
auto-negotiation results in half-duplex operation, excess collision on the ethernet link may cause internal chip delays that may result in subsequent valid frames being dropped due to insufficient receive buffer resources. The workaround is to choose de-pipeline method as a flow control decision for SDI. De-pipeline method allows only 1 data in TxMbuf at a time such that a request to RDMA from SDI is made only when TxMbuf is empty. From FreeBSD; ok miod@; ok kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_bge.c10
-rw-r--r--sys/dev/pci/if_bgereg.h4
2 files changed, 12 insertions, 2 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index e1c09ca451d..a980ef91f27 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.303 2010/09/20 07:40:38 deraadt Exp $ */
+/* $OpenBSD: if_bge.c,v 1.304 2011/02/15 19:49:47 robert Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -1464,6 +1464,14 @@ bge_blockinit(struct bge_softc *sc)
BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE);
}
+ /* Choose de-pipeline mode for BCM5906 A0, A1 and A2. */
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906) {
+ if (sc->bge_chipid == BGE_CHIPID_BCM5906_A0 ||
+ sc->bge_chipid == BGE_CHIPID_BCM5906_A1 ||
+ sc->bge_chipid == BGE_CHIPID_BCM5906_A2)
+ CSR_WRITE_4(sc, BGE_ISO_PKT_TX,
+ (CSR_READ_4(sc, BGE_ISO_PKT_TX) & ~3) | 2);
+ }
/*
* Set the BD ring replenish thresholds. The recommended
* values are 1/8th the number of descriptors allocated to
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index 95df99be86c..e5146f89915 100644
--- a/sys/dev/pci/if_bgereg.h
+++ b/sys/dev/pci/if_bgereg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bgereg.h,v 1.103 2010/09/20 07:40:38 deraadt Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.104 2011/02/15 19:49:47 robert Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -301,6 +301,7 @@
#define BGE_CHIPID_BCM5787_A0 0xb000
#define BGE_CHIPID_BCM5787_A1 0xb001
#define BGE_CHIPID_BCM5787_A2 0xb002
+#define BGE_CHIPID_BCM5906_A0 0xc000
#define BGE_CHIPID_BCM5906_A1 0xc001
#define BGE_CHIPID_BCM5906_A2 0xc002
#define BGE_CHIPID_BCM57780_A0 0x57780000
@@ -941,6 +942,7 @@
#define BGE_SDI_STATS_CTL 0x0C08
#define BGE_SDI_STATS_ENABLE_MASK 0x0C0C
#define BGE_SDI_STATS_INCREMENT_MASK 0x0C10
+#define BGE_ISO_PKT_TX 0x0C20
#define BGE_LOCSTATS_COS0 0x0C80
#define BGE_LOCSTATS_COS1 0x0C84
#define BGE_LOCSTATS_COS2 0x0C88