Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Give BCM5700 Ax and Bx revs the BGE_QUIRK_LINK_S...



details:   https://anonhg.NetBSD.org/src/rev/672cf2724901
branches:  trunk
changeset: 534035:672cf2724901
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Jul 13 22:31:18 2002 +0000

description:
Give BCM5700 Ax and Bx revs the BGE_QUIRK_LINK_STATE_BROKEN quirk,
and test for that, rather than checking revision where the quirk is
handled.

diffstat:

 sys/dev/pci/if_bge.c    |  24 +++++++++++++-----------
 sys/dev/pci/if_bgereg.h |   8 +-------
 2 files changed, 14 insertions(+), 18 deletions(-)

diffs (103 lines):

diff -r 20edef97ccf4 -r 672cf2724901 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Sat Jul 13 22:21:20 2002 +0000
+++ b/sys/dev/pci/if_bge.c      Sat Jul 13 22:31:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.16 2002/07/13 22:21:20 thorpej Exp $      */
+/*     $NetBSD: if_bge.c,v 1.17 2002/07/13 22:31:18 thorpej Exp $      */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -119,8 +119,6 @@
 
 #include <uvm/uvm_extern.h>
 
-/* #define BGE_CHECKSUM */
-
 int bge_probe(struct device *, struct cfdata *, void *);
 void bge_attach(struct device *, struct device *, void *);
 void bge_release_resources(struct bge_softc *);
@@ -195,6 +193,9 @@
 #define DPRINTFN(n,x)
 #endif
 
+/* Various chip quirks. */
+#define        BGE_QUIRK_LINK_STATE_BROKEN     0x00000001
+
 struct cfattach bge_ca = {
        sizeof(struct bge_softc), bge_probe, bge_attach
 };
@@ -1501,7 +1502,7 @@
                CSR_WRITE_4(sc, BGE_MI_STS, BGE_MISTS_LINK);
        } else {
                BGE_SETBIT(sc, BGE_MI_MODE, BGE_MIMODE_AUTOPOLL|10<<16);
-               if (BGE_IS_5700_Ax_Bx(sc->bge_asicrev))
+               if (sc->bge_quirks & BGE_QUIRK_LINK_STATE_BROKEN)
                        CSR_WRITE_4(sc, BGE_MAC_EVT_ENB,
                            BGE_EVTENB_MI_INTERRUPT);
        }
@@ -1518,27 +1519,28 @@
        const char              *br_name;
 } bge_revisions[] = {
        { BGE_ASICREV_BCM5700_A0,
-         0,
+         BGE_QUIRK_LINK_STATE_BROKEN,
          "BCM5700 A0" },
 
        { BGE_ASICREV_BCM5700_A1,
-         0,
+         BGE_QUIRK_LINK_STATE_BROKEN,
          "BCM5700 A1" },
 
        { BGE_ASICREV_BCM5700_B0,
-         0,
+         BGE_QUIRK_LINK_STATE_BROKEN,
          "BCM5700 B0" },
 
        { BGE_ASICREV_BCM5700_B1,
-         0,
+         BGE_QUIRK_LINK_STATE_BROKEN,
          "BCM5700 B1" },
 
        { BGE_ASICREV_BCM5700_B2,
-         0,
+         BGE_QUIRK_LINK_STATE_BROKEN,
          "BCM5700 B2" },
 
+       /* This is treated like a BCM5700 Bx */
        { BGE_ASICREV_BCM5700_ALTIMA,
-         0,
+         BGE_QUIRK_LINK_STATE_BROKEN,
          "BCM5700 Altima" },
 
        { BGE_ASICREV_BCM5700_C0,
@@ -2289,7 +2291,7 @@
         * the interrupt handler.
         */
 
-       if (BGE_IS_5700_Ax_Bx(sc->bge_asicrev)) {
+       if (sc->bge_quirks & BGE_QUIRK_LINK_STATE_BROKEN) {
                u_int32_t               status;
 
                status = CSR_READ_4(sc, BGE_MAC_STS);
diff -r 20edef97ccf4 -r 672cf2724901 sys/dev/pci/if_bgereg.h
--- a/sys/dev/pci/if_bgereg.h   Sat Jul 13 22:21:20 2002 +0000
+++ b/sys/dev/pci/if_bgereg.h   Sat Jul 13 22:31:18 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bgereg.h,v 1.3 2002/07/13 22:21:20 thorpej Exp $    */
+/*     $NetBSD: if_bgereg.h,v 1.4 2002/07/13 22:31:18 thorpej Exp $    */
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -234,12 +234,6 @@
 #define BGE_ASICREV_BCM5703_A1         0x10010000
 #define BGE_ASICREV_BCM5703_A2         0x10020000
 
-/* shorthand one */
-#define BGE_ASICREV_BCM5700_MASK       0x71000000
-#define BGE_IS_5700_Ax_Bx(rev) \
-       (((rev) & BGE_ASICREV_BCM5700_MASK) == BGE_ASICREV_BCM5700_A0 || \
-        ((rev) & BGE_ASICREV_BCM5700_MASK) == BGE_ASICREV_BCM5700_B0)
-
 /* PCI DMA Read/Write Control register */
 #define BGE_PCIDMARWCTL_MINDMA         0x000000FF
 #define BGE_PCIDMARWCTL_RDADRR_BNDRY   0x00000700



Home | Main Index | Thread Index | Old Index