summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2009-06-02 02:16:42 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2009-06-02 02:16:42 +0000
commitaa185fd2a779e36d23889886ef6ce60f34b7fe15 (patch)
treee0602513121f7202c5384cdc72a199e6b2de06a4 /sys/dev/pci
parenta3bc1880c539ae09113d409adbc12c71afaae647 (diff)
"Add a macro to define the newer generation of bge(4) chipsets. Simplifies
things a bit a and helps with adding support for more newer chipsets with the same common features. From the Linux tg3 driver." From Brad; binaries are not identical; the if statement is changed slightly, but no functional change. Looks fine to naddy@.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_bge.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 6e5a1ac9dcf..fe0538d2832 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.264 2009/05/24 14:11:35 naddy Exp $ */
+/* $OpenBSD: if_bge.c,v 1.265 2009/06/02 02:16:41 sthen Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -324,6 +324,15 @@ const struct pci_matchid bge_devices[] = {
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906 || \
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
+/* Intentionally exlcude BGE_ASICREV_BCM5906 */
+#define BGE_IS_5755_PLUS(sc) \
+ (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5761 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
+
#define BGE_IS_5714_FAMILY(sc) \
(BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5714_A0 || \
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5780 || \
@@ -1663,12 +1672,7 @@ bge_blockinit(struct bge_softc *sc)
val = BGE_WDMAMODE_ENABLE|BGE_WDMAMODE_ALL_ATTNS;
/* Enable host coalescing bug fix. */
- if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5761 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
+ if (BGE_IS_5755_PLUS(sc))
val |= (1 << 29);
/* Turn on write DMA state machine */
@@ -2260,12 +2264,7 @@ bge_reset(struct bge_softc *sc)
/* Disable fastboot on controllers that support it. */
if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5761 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5784 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5785 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 ||
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM57780)
+ BGE_IS_5755_PLUS(sc))
CSR_WRITE_4(sc, BGE_FASTBOOT_PC, 0);
reset = BGE_MISCCFG_RESET_CORE_CLOCKS|(65<<1);