summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2006-10-07 20:28:49 +0000
committerBrad Smith <brad@cvs.openbsd.org>2006-10-07 20:28:49 +0000
commit71ebff311fe2399eca1ff8771e7f70f5344bfae2 (patch)
treeeb78073b68e9dacd72a7bafbcd2279eb37c58578 /sys/dev
parent65e519f03d77db3e3a4de33d2fe2ebdeec786662 (diff)
add and set PHY workaround flags depending on the ASIC revision
or chip id.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/if_bge.c22
-rw-r--r--sys/dev/pci/if_bgereg.h6
2 files changed, 24 insertions, 4 deletions
diff --git a/sys/dev/pci/if_bge.c b/sys/dev/pci/if_bge.c
index 98da45ba00c..5c57eb935a7 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.184 2006/10/01 17:29:48 brad Exp $ */
+/* $OpenBSD: if_bge.c,v 1.185 2006/10/07 20:28:48 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -279,7 +279,8 @@ const struct pci_matchid bge_devices[] = {
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5714 || \
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752 || \
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787)
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906)
#define BGE_IS_575X_PLUS(sc) \
(BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5750 || \
@@ -288,7 +289,8 @@ const struct pci_matchid bge_devices[] = {
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5714 || \
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5752 || \
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 || \
- BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787)
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787 || \
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906)
#define BGE_IS_5714_FAMILY(sc) \
(BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5714_A0 || \
@@ -1803,6 +1805,20 @@ bge_attach(struct device *parent, struct device *self, void *aux)
BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5906)
sc->bge_flags |= BGE_10_100_ONLY;
+ if (BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5703_AX ||
+ BGE_CHIPREV(sc->bge_chipid) == BGE_CHIPREV_5704_AX)
+ sc->bge_flags |= BGE_PHY_ADC_BUG;
+ if (sc->bge_chipid == BGE_CHIPID_BCM5704_A0)
+ sc->bge_flags |= BGE_PHY_5704_A0_BUG;
+
+ if (BGE_IS_5705_OR_BEYOND(sc)) {
+ if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5755 ||
+ BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_BCM5787)
+ sc->bge_flags |= BGE_PHY_JITTER_BUG;
+ else if (BGE_ASICREV(sc->bge_chipid) != BGE_ASICREV_BCM5906)
+ sc->bge_flags |= BGE_PHY_BER_BUG;
+ }
+
/* Try to reset the chip. */
DPRINTFN(5, ("bge_reset\n"));
bge_reset(sc);
diff --git a/sys/dev/pci/if_bgereg.h b/sys/dev/pci/if_bgereg.h
index 8d2f3423932..e0ce274d5bf 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.62 2006/10/01 17:29:48 brad Exp $ */
+/* $OpenBSD: if_bgereg.h,v 1.63 2006/10/07 20:28:48 brad Exp $ */
/*
* Copyright (c) 2001 Wind River Systems
@@ -2362,6 +2362,10 @@ struct bge_softc {
#define BGE_NO_EEPROM 0x00000400
#define BGE_JUMBO_CAP 0x00000800
#define BGE_10_100_ONLY 0x00001000
+#define BGE_PHY_ADC_BUG 0x00002000
+#define BGE_PHY_5704_A0_BUG 0x00004000
+#define BGE_PHY_JITTER_BUG 0x00008000
+#define BGE_PHY_BER_BUG 0x00010000
bus_dma_tag_t bge_dmatag;
u_int32_t bge_chipid;