Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci No functional change.



details:   https://anonhg.NetBSD.org/src/rev/1025ba157644
branches:  trunk
changeset: 784896:1025ba157644
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Feb 13 16:58:04 2013 +0000

description:
No functional change.
 - Fix comment.
 - Use macro.

diffstat:

 sys/dev/pci/if_wm.c    |  21 +++++++++++----------
 sys/dev/pci/if_wmreg.h |   5 ++++-
 2 files changed, 15 insertions(+), 11 deletions(-)

diffs (92 lines):

diff -r 2a898bc1f3bf -r 1025ba157644 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Feb 13 15:22:09 2013 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Feb 13 16:58:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.244 2013/02/13 12:28:23 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.245 2013/02/13 16:58:04 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.244 2013/02/13 12:28:23 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.245 2013/02/13 16:58:04 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -6306,7 +6306,7 @@
                break;
        case PCI_PRODUCT_INTEL_PCH2_LV_LM:
        case PCI_PRODUCT_INTEL_PCH2_LV_V:
-               /* 82578 */
+               /* 82579 */
                sc->sc_phytype = WMPHY_82579;
                mii->mii_readreg = wm_gmii_hv_readreg;
                mii->mii_writereg = wm_gmii_hv_writereg;
@@ -6771,7 +6771,7 @@
 
        if (reg > BME1000_MAX_MULTI_PAGE_REG) {
                if (phy == 1)
-                       wm_gmii_i82544_writereg(self, phy, 0x1f,
+                       wm_gmii_i82544_writereg(self, phy, MII_IGPHY_PAGE_SELECT,
                            reg);
                else
                        wm_gmii_i82544_writereg(self, phy,
@@ -6806,7 +6806,7 @@
 
        if (reg > BME1000_MAX_MULTI_PAGE_REG) {
                if (phy == 1)
-                       wm_gmii_i82544_writereg(self, phy, 0x1f,
+                       wm_gmii_i82544_writereg(self, phy, MII_IGPHY_PAGE_SELECT,
                            reg);
                else
                        wm_gmii_i82544_writereg(self, phy,
@@ -7385,14 +7385,15 @@
                /* Value of bit 22 corresponds to the flash bank we're on. */
                *bank = (CSR_READ(sc, WMREG_EECD) & EECD_SEC1VAL) ? 1 : 0;
        } else {
-               uint8_t bank_high_byte;
-               wm_read_ich8_byte(sc, act_offset, &bank_high_byte);
-               if ((bank_high_byte & 0xc0) == 0x80)
+               uint8_t sig_byte;
+               wm_read_ich8_byte(sc, act_offset, &sig_byte);
+               if ((sig_byte & ICH_NVM_VALID_SIG_MASK) == ICH_NVM_SIG_VALUE)
                        *bank = 0;
                else {
                        wm_read_ich8_byte(sc, act_offset + bank1_offset,
-                           &bank_high_byte);
-                       if ((bank_high_byte & 0xc0) == 0x80)
+                           &sig_byte);
+                       if ((sig_byte & ICH_NVM_VALID_SIG_MASK)
+                           == ICH_NVM_SIG_VALUE)
                                *bank = 1;
                        else {
                                aprint_error_dev(sc->sc_dev,
diff -r 2a898bc1f3bf -r 1025ba157644 sys/dev/pci/if_wmreg.h
--- a/sys/dev/pci/if_wmreg.h    Wed Feb 13 15:22:09 2013 +0000
+++ b/sys/dev/pci/if_wmreg.h    Wed Feb 13 16:58:04 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wmreg.h,v 1.49 2013/02/07 15:38:42 msaitoh Exp $    */
+/*     $NetBSD: if_wmreg.h,v 1.50 2013/02/13 16:58:04 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -255,6 +255,7 @@
 #define        EECD_EE_TYPE    (1U << 13)      /* EEPROM type
                                           (0 = Microwire, 1 = SPI) */
 #define EECD_SEC1VAL   (1U << 22)      /* Sector One Valid */
+#define EECD_SEC1VAL_VALMASK (EECD_EE_AUTORD | EECD_EE_PRES) /* Valid Mask */
 
 #define        UWIRE_OPC_ERASE 0x04            /* MicroWire "erase" opcode */
 #define        UWIRE_OPC_WRITE 0x05            /* MicroWire "write" opcode */
@@ -963,6 +964,8 @@
 
 #define ICH_NVM_SIG_WORD       0x13
 #define ICH_NVM_SIG_MASK       0xc000
+#define ICH_NVM_VALID_SIG_MASK 0xc0
+#define ICH_NVM_SIG_VALUE      0x80
 
 /* for PCI express Capability registers */
 #define        WM_PCI_PCIE_DCSR2_16MS  0x00000005



Home | Main Index | Thread Index | Old Index