summaryrefslogtreecommitdiffstats
path: root/sys/dev/bge
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2010-10-04 18:09:01 +0000
committeryongari <yongari@FreeBSD.org>2010-10-04 18:09:01 +0000
commitd013da415dd2b7a8073b2660fb947ff690541886 (patch)
tree53f5c29903cb644c7fafe594ae02c197f6c5c1c3 /sys/dev/bge
parent9a3b80a8209eb12aff318ac4acbc3281a4eb91c2 (diff)
downloadFreeBSD-src-d013da415dd2b7a8073b2660fb947ff690541886.zip
FreeBSD-src-d013da415dd2b7a8073b2660fb947ff690541886.tar.gz
Enable fix for read DMA FIFO overruns on controllers that have this
fix. Note, we still need workaround for controllers that lacks this fix and it needs more work in RX BD updating. Submitted by: davidch
Diffstat (limited to 'sys/dev/bge')
-rw-r--r--sys/dev/bge/if_bge.c13
-rw-r--r--sys/dev/bge/if_bgereg.h4
2 files changed, 17 insertions, 0 deletions
diff --git a/sys/dev/bge/if_bge.c b/sys/dev/bge/if_bge.c
index 720846f..317bcd2 100644
--- a/sys/dev/bge/if_bge.c
+++ b/sys/dev/bge/if_bge.c
@@ -1858,6 +1858,19 @@ bge_blockinit(struct bge_softc *sc)
sc->bge_asicrev == BGE_ASICREV_BCM57780)
val |= BGE_RDMAMODE_TSO6_ENABLE;
}
+ if (sc->bge_asicrev == BGE_ASICREV_BCM5761 ||
+ sc->bge_asicrev == BGE_ASICREV_BCM5784 ||
+ sc->bge_asicrev == BGE_ASICREV_BCM5785 ||
+ sc->bge_asicrev == BGE_ASICREV_BCM57780) {
+ /*
+ * Enable fix for read DMA FIFO overruns.
+ * The fix is to limit the number of RX BDs
+ * the hardware would fetch at a fime.
+ */
+ CSR_WRITE_4(sc, BGE_RDMA_RSRVCTRL,
+ CSR_READ_4(sc, BGE_RDMA_RSRVCTRL) |
+ BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX);
+ }
CSR_WRITE_4(sc, BGE_RDMA_MODE, val);
DELAY(40);
diff --git a/sys/dev/bge/if_bgereg.h b/sys/dev/bge/if_bgereg.h
index 1f16e69..87abca8 100644
--- a/sys/dev/bge/if_bgereg.h
+++ b/sys/dev/bge/if_bgereg.h
@@ -1431,6 +1431,7 @@
*/
#define BGE_RDMA_MODE 0x4800
#define BGE_RDMA_STATUS 0x4804
+#define BGE_RDMA_RSRVCTRL 0x4900
/* Read DMA mode register */
#define BGE_RDMAMODE_RESET 0x00000001
@@ -1462,6 +1463,9 @@
#define BGE_RDMASTAT_PCI_FIFOOREAD_ATTN 0x00000100
#define BGE_RDMASTAT_LOCWRITE_TOOBIG 0x00000200
+/* Read DMA Reserved Control register */
+#define BGE_RDMA_RSRVCTRL_FIFO_OFLW_FIX 0x00000004
+
/*
* Write DMA control registers
*/
OpenPOWER on IntegriCloud