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 symbolic names to the CFG bits in the EEP...



details:   https://anonhg.NetBSD.org/src/rev/55390a673266
branches:  trunk
changeset: 533448:55390a673266
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Jun 30 18:04:12 2002 +0000

description:
* Give symbolic names to the CFG bits in the EEPROM.
* Get CFG_M64ADDR, CFG_T64ADDR, and CFG_DATA64_EN from the EEPROM.
  Note, we still disable CFG_M64ADDR and CFG_T64ADDR later (XXX need
  PCI bus capability flags for these).
* Print a message if we're in a 64-bit slot and 64-bit data is
  disabled in the EEPROM.  Make sure CFG_DATA64_EN is disabled if
  we're not in a 64-bit slot.

diffstat:

 sys/dev/pci/if_sip.c    |  34 +++++++++++++++++++++++-----------
 sys/dev/pci/if_sipreg.h |  15 ++++++++++++++-
 2 files changed, 37 insertions(+), 12 deletions(-)

diffs (99 lines):

diff -r f35cc4ae1a2e -r 55390a673266 sys/dev/pci/if_sip.c
--- a/sys/dev/pci/if_sip.c      Sun Jun 30 14:17:44 2002 +0000
+++ b/sys/dev/pci/if_sip.c      Sun Jun 30 18:04:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sip.c,v 1.54 2002/06/01 23:50:59 lukem Exp $        */
+/*     $NetBSD: if_sip.c,v 1.55 2002/06/30 18:04:12 thorpej Exp $      */
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.54 2002/06/01 23:50:59 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_sip.c,v 1.55 2002/06/30 18:04:12 thorpej Exp $");
 
 #include "bpfilter.h"
 
@@ -787,15 +787,21 @@
         * friends -- it affects packet data, not descriptors.
         */
 #ifdef DP83820
+       /*
+        * XXX Need some PCI flags indicating support for
+        * XXX 64-bit addressing.
+        */
+       sc->sc_cfg &= ~(CFG_M64ADDR | CFG_T64ADDR);
+
        reg = bus_space_read_4(sc->sc_st, sc->sc_sh, SIP_CFG);
        if (reg & CFG_PCI64_DET) {
                printf("%s: 64-bit PCI slot detected\n", sc->sc_dev.dv_xname);
-               /*
-                * XXX Need some PCI flags indicating support for
-                * XXX 64-bit addressing (SAC or DAC) and 64-bit
-                * XXX data path.
-                */
-       }
+               if ((sc->sc_cfg & CFG_DATA64_EN) == 0)
+                       printf("%s: 64-bit data transfers disabled in EEPROM\n",
+                           sc->sc_dev.dv_xname);
+       } else
+               sc->sc_cfg &= ~CFG_DATA64_EN;
+
        if (sc->sc_cfg & (CFG_TBI_EN|CFG_EXT_125)) {
                const char *sep = "";
                printf("%s: using ", sc->sc_dev.dv_xname);
@@ -3058,9 +3064,15 @@
        sc->sc_gpior = eeprom_data[0x04];
 
        /* Get various CFG related bits. */
-       if ((eeprom_data[0x05] >> 0) & 1)
-               sc->sc_cfg |= CFG_EXT_125; 
-       if ((eeprom_data[0x05] >> 9) & 1)
+       if (eeprom_data[0x05] & DP83820_CONFIG2_CFG_EXT_125)
+               sc->sc_cfg |= CFG_EXT_125;
+       if (eeprom_data[0x05] & DP83820_CONFIG2_CFG_M64ADDR)
+               sc->sc_cfg |= CFG_M64ADDR;
+       if (eeprom_data[0x05] & DP83820_CONFIG2_CFG_DATA64_EN)
+               sc->sc_cfg |= CFG_DATA64_EN;
+       if (eeprom_data[0x05] & DP83820_CONFIG2_CFG_T64ADDR)
+               sc->sc_cfg |= CFG_T64ADDR;
+       if (eeprom_data[0x05] & DP83820_CONFIG2_CFG_TBI_EN)
                sc->sc_cfg |= CFG_TBI_EN;
 }
 #else /* ! DP83820 */
diff -r f35cc4ae1a2e -r 55390a673266 sys/dev/pci/if_sipreg.h
--- a/sys/dev/pci/if_sipreg.h   Sun Jun 30 14:17:44 2002 +0000
+++ b/sys/dev/pci/if_sipreg.h   Sun Jun 30 18:04:12 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_sipreg.h,v 1.10 2002/03/27 21:41:35 briggs Exp $    */
+/*     $NetBSD: if_sipreg.h,v 1.11 2002/06/30 18:04:12 thorpej Exp $   */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -745,6 +745,10 @@
 #define        SIP_DP83820_EEPROM_SUBSYSTEM_ID 0x00    /* PCI subsystem ID */
 #define        SIP_DP83820_EEPROM_SUBVENDOR_ID 0x02    /* PCI subvendor ID */
 #define        SIP_DP83820_EEPROM_CFGINT       0x04    /* PCI INT [31:16] */
+#define        SIP_DP83820_EEPROM_CONFIG0      0x06    /* configuration word 0 */
+#define        SIP_DP83820_EEPROM_CONFIG1      0x08    /* configuration word 1 */
+#define        SIP_DP83820_EEPROM_CONFIG2      0x0a    /* configuration word 2 */
+#define        SIP_DP83820_EEPROM_CONFIG3      0x0c    /* configuration word 3 */
 #define        SIP_DP83820_EEPROM_SOPAS0       0x0e    /* SecureOn [47:32] */
 #define        SIP_DP83820_EEPROM_SOPAS1       0x10    /* SecureOn [31:16] */
 #define        SIP_DP83820_EEPROM_SOPAS2       0x12    /* SecureOn [15:0] */
@@ -754,4 +758,13 @@
 #define        SIP_DP83820_EEPROM_CHECKSUM     0x1a    /* checksum */
 #define        SIP_DP83820_EEPROM_LENGTH       0x1c    /* length of EEPROM data */
 
+#define        DP83820_CONFIG2_CFG_EXT_125     (1U << 0)
+#define        DP83820_CONFIG2_CFG_M64ADDR     (1U << 1)
+#define        DP83820_CONFIG2_CFG_DATA64_EN   (1U << 2)
+#define        DP83820_CONFIG2_CFG_T64ADDR     (1U << 3)
+#define        DP83820_CONFIG2_CFG_MWI_DIS     (1U << 4)
+#define        DP83820_CONFIG2_CFG_MRM_DIS     (1U << 5)
+#define        DP83820_CONFIG2_CFG_MODE_1000   (1U << 7)
+#define        DP83820_CONFIG2_CFG_TBI_EN      (1U << 9)
+
 #endif /* _DEV_PCI_IF_SIPREG_H_ */



Home | Main Index | Thread Index | Old Index