summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-07-17 19:59:45 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-07-17 19:59:45 +0000
commit2698a6b3388cff6403d8bb8c040b715c1177e56c (patch)
treeecd5a7a31e996bf15bdccf3b7d7a2898558c9350
parent72dcf5efa8eb80efd3d40bd0ed6d6012550df6c1 (diff)
Add a flag and allow the driver to identify the BCM5788 chipsets. They're
slightly different from the other chipsets using the BCM5705 ASIC. ok jsg@
-rw-r--r--sys/dev/pci/if_bge.c7
-rw-r--r--sys/dev/pci/if_bgereg.h7
2 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index cb093f3301e..e03ff01db23 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.237 2008/07/16 03:56:25 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.238 2008/07/17 19:59:44 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -1897,6 +1897,11 @@ bge_attach(struct device *parent, struct device *self, void *aux)
misccfg = CSR_READ_4(sc, BGE_MISC_CFG);
misccfg &= BGE_MISCCFG_BOARD_ID_MASK;
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 &&
+ (misccfg == BGE_MISCCFG_BOARD_ID_5788 ||
+ misccfg == BGE_MISCCFG_BOARD_ID_5788M))
+ sc->bge_flags |= BGE_IS_5788;
+
if ((BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5703 &&
(misccfg == 0x4000 || misccfg == 0x8000)) ||
(BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5705 &&
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index c482e2481b7..8f2571d8929 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.84 2008/07/16 03:56:25 brad Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.85 2008/07/17 19:59:44 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -1802,8 +1802,10 @@
/* Misc. config register */
#define BGE_MISCCFG_RESET_CORE_CLOCKS 0x00000001
#define BGE_MISCCFG_TIMER_PRESCALER 0x000000FE
-#define BGE_MISCCFG_KEEP_GPHY_POWER 0x04000000
+#define BGE_MISCCFG_BOARD_ID_5788 0x00010000
+#define BGE_MISCCFG_BOARD_ID_5788M 0x00018000
#define BGE_MISCCFG_BOARD_ID_MASK 0x0001e000
+#define BGE_MISCCFG_KEEP_GPHY_POWER 0x04000000
#define BGE_32BITTIME_66MHZ (0x41 << 1)
@@ -2440,6 +2442,7 @@ struct bge_softc {
#define BGE_PHY_BER_BUG 0x00020000
#define BGE_PHY_ADJUST_TRIM 0x00040000
#define BGE_NO_ETH_WIRE_SPEED 0x00080000
+#define BGE_IS_5788 0x00100000
bus_dma_tag_t bge_dmatag;
u_int32_t bge_chipid;