Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - Print yet another hardware config word in SRAM...



details:   https://anonhg.NetBSD.org/src/rev/48e7b08f2d96
branches:  trunk
changeset: 330018:48e7b08f2d96
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jun 17 17:37:08 2014 +0000

description:
- Print yet another hardware config word in SRAM(BGE_SRAM_DATA_CFG_5) for
  BCM5717 and newer devices.
- Fix a trivial bug in #ifdef NOTYET.

diffstat:

 sys/dev/pci/if_bge.c    |  17 ++++++++++-------
 sys/dev/pci/if_bgereg.h |   3 ++-
 2 files changed, 12 insertions(+), 8 deletions(-)

diffs (81 lines):

diff -r 2e250a864950 -r 48e7b08f2d96 sys/dev/pci/if_bge.c
--- a/sys/dev/pci/if_bge.c      Tue Jun 17 17:30:48 2014 +0000
+++ b/sys/dev/pci/if_bge.c      Tue Jun 17 17:37:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bge.c,v 1.266 2014/03/29 19:28:24 christos Exp $    */
+/*     $NetBSD: if_bge.c,v 1.267 2014/06/17 17:37:08 msaitoh Exp $     */
 
 /*
  * Copyright (c) 2001 Wind River Systems
@@ -79,7 +79,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.266 2014/03/29 19:28:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_bge.c,v 1.267 2014/06/17 17:37:08 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3293,7 +3293,7 @@
        pci_chipset_tag_t       pc;
        pci_intr_handle_t       ih;
        const char              *intrstr = NULL;
-       uint32_t                hwcfg, hwcfg2, hwcfg3, hwcfg4;
+       uint32_t                hwcfg, hwcfg2, hwcfg3, hwcfg4, hwcfg5;
        uint32_t                command;
        struct ifnet            *ifp;
        uint32_t                misccfg, mimode;
@@ -3667,7 +3667,7 @@
         * memory, or fall back to the config word in the EEPROM.
         * Note: on some BCM5700 cards, this value appears to be unset.
         */
-       hwcfg = hwcfg2 = hwcfg3 = hwcfg4 = 0;
+       hwcfg = hwcfg2 = hwcfg3 = hwcfg4 = hwcfg5 = 0;
        if (bge_readmem_ind(sc, BGE_SRAM_DATA_SIG) ==
            BGE_SRAM_DATA_SIG_MAGIC) {
                uint32_t tmp;
@@ -3681,13 +3681,16 @@
                        hwcfg3 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_3);
                if (BGE_ASICREV(sc->bge_chipid == BGE_ASICREV_BCM5785))
                        hwcfg4 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_4);
+               if (BGE_IS_5717_PLUS(sc))
+                       hwcfg4 = bge_readmem_ind(sc, BGE_SRAM_DATA_CFG_5);
        } else if (!(sc->bge_flags & BGEF_NO_EEPROM)) {
                bge_read_eeprom(sc, (void *)&hwcfg,
                    BGE_EE_HWCFG_OFFSET, sizeof(hwcfg));
                hwcfg = be32toh(hwcfg);
        }
-       aprint_normal_dev(sc->bge_dev, "HW config %08x, %08x, %08x, %08x\n",
-           hwcfg, hwcfg2, hwcfg3, hwcfg4);
+       aprint_normal_dev(sc->bge_dev,
+           "HW config %08x, %08x, %08x, %08x %08x\n",
+           hwcfg, hwcfg2, hwcfg3, hwcfg4, hwcfg5);
 
        bge_sig_legacy(sc, BGE_RESET_START);
        bge_sig_post_reset(sc, BGE_RESET_START);
@@ -5040,7 +5043,7 @@
                         * XXX jonathan%NetBSD.org@localhost: untested.
                         * how to force  this branch to be taken?
                         */
-                       BGE_EVCNT_INCR(&sc->sc_ev_txtsopain);
+                       BGE_EVCNT_INCR(sc->bge_ev_txtsopain);
 
                        m_copydata(m0, offset, sizeof(ip), &ip);
                        m_copydata(m0, hlen, sizeof(th), &th);
diff -r 2e250a864950 -r 48e7b08f2d96 sys/dev/pci/if_bgereg.h
--- a/sys/dev/pci/if_bgereg.h   Tue Jun 17 17:30:48 2014 +0000
+++ b/sys/dev/pci/if_bgereg.h   Tue Jun 17 17:37:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_bgereg.h,v 1.87 2014/05/27 16:17:55 msaitoh Exp $   */
+/*     $NetBSD: if_bgereg.h,v 1.88 2014/06/17 17:37:08 msaitoh Exp $   */
 /*
  * Copyright (c) 2001 Wind River Systems
  * Copyright (c) 1997, 1998, 1999, 2001
@@ -85,6 +85,7 @@
 #define        BGE_SRAM_DATA_CFG_2             0x00000D38
 #define        BGE_SRAM_DATA_CFG_3             0x00000D3C
 #define        BGE_SRAM_DATA_CFG_4             0x00000D60
+#define        BGE_SRAM_DATA_CFG_5             0x00000E0C
 #define BGE_SOFTWARE_GENCOMM_END       0x00000FFF
 #define BGE_UNMAPPED                   0x00001000
 #define BGE_UNMAPPED_END               0x00001FFF



Home | Main Index | Thread Index | Old Index