Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - Add workaround for 82574 Errata 25 and 82583 ...



details:   https://anonhg.NetBSD.org/src/rev/c303a7586985
branches:  trunk
changeset: 340772:c303a7586985
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Sep 30 04:28:04 2015 +0000

description:
-  Add workaround for 82574 Errata 25 and 82583 Errata 12 "Dropped RX packets"
  and for 82573 (unknown). Set GCR_L1_ACT_WITHOUT_L0S_RX bit. The NVM Image
  version 2.1.4 and newer have this workaround.
- Print the NVM image version on 82583, too.

 Pointed out by joerg@.

diffstat:

 sys/dev/pci/if_wm.c    |  21 ++++++++++++++++++---
 sys/dev/pci/if_wmreg.h |   3 ++-
 2 files changed, 20 insertions(+), 4 deletions(-)

diffs (81 lines):

diff -r 6554ce13736a -r c303a7586985 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Wed Sep 30 02:45:33 2015 +0000
+++ b/sys/dev/pci/if_wm.c       Wed Sep 30 04:28:04 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.349 2015/09/28 07:02:57 knakahara Exp $    */
+/*     $NetBSD: if_wm.c,v 1.350 2015/09/30 04:28:04 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.349 2015/09/28 07:02:57 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.350 2015/09/30 04:28:04 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -334,6 +334,7 @@
 
        int sc_nvm_ver_major;
        int sc_nvm_ver_minor;
+       int sc_nvm_ver_build;
        int sc_nvm_addrbits;            /* NVM address bits */
        unsigned int sc_nvm_wordsize;   /* NVM word size */
        int sc_ich8_flash_base;
@@ -3580,6 +3581,17 @@
                        CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl);
 
                        /* PCIe Control Register */
+                       /*
+                        * 82573 Errata (unknown).
+                        *
+                        * 82574 Errata 25 and 82583 Errata 12
+                        * "Dropped Rx Packets":
+                        *   NVM Image Version 2.1.4 and newer has no this bug.
+                        */
+                       reg = CSR_READ(sc, WMREG_GCR);
+                       reg |= GCR_L1_ACT_WITHOUT_L0S_RX;
+                       CSR_WRITE(sc, WMREG_GCR, reg);
+
                        if ((sc->sc_type == WM_T_82574)
                            || (sc->sc_type == WM_T_82583)) {
                                /*
@@ -9822,6 +9834,7 @@
        case WM_T_82571:
        case WM_T_82572:
        case WM_T_82574:
+       case WM_T_82583:
                check_version = true;
                check_optionrom = true;
                have_build = true;
@@ -9867,8 +9880,10 @@
 printver:
                aprint_verbose(", version %d.%d", sc->sc_nvm_ver_major,
                    sc->sc_nvm_ver_minor);
-               if (have_build)
+               if (have_build) {
+                       sc->sc_nvm_ver_build = build;
                        aprint_verbose(".%d", build);
+               }
        }
        if (check_optionrom) {
                wm_nvm_read(sc, NVM_OFF_COMB_VER_PTR, 1, &off);
diff -r 6554ce13736a -r c303a7586985 sys/dev/pci/if_wmreg.h
--- a/sys/dev/pci/if_wmreg.h    Wed Sep 30 02:45:33 2015 +0000
+++ b/sys/dev/pci/if_wmreg.h    Wed Sep 30 04:28:04 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wmreg.h,v 1.79 2015/09/07 15:19:05 msaitoh Exp $    */
+/*     $NetBSD: if_wmreg.h,v 1.80 2015/09/30 04:28:04 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -918,6 +918,7 @@
 #define GCR_CMPL_TMOUT_10MS    0x00001000
 #define GCR_CMPL_TMOUT_RESEND  0x00010000
 #define GCR_CAP_VER2           0x00040000
+#define GCR_L1_ACT_WITHOUT_L0S_RX 0x08000000
 
 #define WMREG_FACTPS   0x5b30  /* Function Active and Power State to MNG */
 #define FACTPS_MNGCG           0x20000000



Home | Main Index | Thread Index | Old Index