Source-Changes-HG archive

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

[src/netbsd-8]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/8f2f4e4a103a
branches:  netbsd-8
changeset: 434708:8f2f4e4a103a
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 06 10:59:04 2018 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #604):
        sys/dev/pci/if_wm.c: revision 1.565-1.566

- Fix a bug that wm_pll_workaround_i210() is not called on some cases.
   As I wrote in if_wm.c rev 1.329's commit message, There are three cases:
     a) Chip is I211
     b) Chip is I210 and it uses INVM (not FLASH)
     c) Chip is I210 (it uses FLASH) and NVM image version < 3.25
   Before this commit, the workaround function was not called on a) and b).

- Rename function.

Do wm_reset_mdicnfg_82580() on 82580 only.

diffstat:

 sys/dev/pci/if_wm.c |  32 +++++++++++++++++++++-----------
 1 files changed, 21 insertions(+), 11 deletions(-)

diffs (89 lines):

diff -r 0f2149a208c8 -r 8f2f4e4a103a sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Tue Mar 06 10:17:11 2018 +0000
+++ b/sys/dev/pci/if_wm.c       Tue Mar 06 10:59:04 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.508.4.15 2018/02/26 00:25:16 snj Exp $     */
+/*     $NetBSD: if_wm.c,v 1.508.4.16 2018/03/06 10:59:04 martin 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.508.4.15 2018/02/26 00:25:16 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.508.4.16 2018/03/06 10:59:04 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -885,7 +885,7 @@
 static int     wm_nvm_read_invm(struct wm_softc *, int, int, uint16_t *);
 /* Lock, detecting NVM type, validate checksum and read */
 static int     wm_nvm_is_onboard_eeprom(struct wm_softc *);
-static int     wm_nvm_get_flash_presence_i210(struct wm_softc *);
+static int     wm_nvm_flash_presence_i210(struct wm_softc *);
 static int     wm_nvm_validate_checksum(struct wm_softc *);
 static void    wm_nvm_version_invm(struct wm_softc *);
 static void    wm_nvm_version(struct wm_softc *);
@@ -2256,7 +2256,7 @@
        case WM_T_I211:
                /* Allow a single clear of the SW semaphore on I210 and newer*/
                sc->sc_flags |= WM_F_WA_I210_CLSEM;
-               if (wm_nvm_get_flash_presence_i210(sc)) {
+               if (wm_nvm_flash_presence_i210(sc)) {
                        sc->nvm.read = wm_nvm_read_eerd;
                        /* Don't use WM_F_LOCK_EECD because we use EERD */
                        sc->sc_flags |= WM_F_EEPROM_FLASH_HW;
@@ -2353,12 +2353,20 @@
        /* Reset the chip to a known state. */
        wm_reset(sc);
 
-       /* Check for I21[01] PLL workaround */
-       if (sc->sc_type == WM_T_I210)
+       /*
+        * Check for I21[01] PLL workaround.
+        *
+        * Three cases:
+        * a) Chip is I211.
+        * b) Chip is I210 and it uses INVM (not FLASH).
+        * c) Chip is I210 (and it uses FLASH) and the NVM image version < 3.25
+        */
+       if (sc->sc_type == WM_T_I211)
                sc->sc_flags |= WM_F_PLL_WA_I210;
-       if ((sc->sc_type == WM_T_I210) && wm_nvm_get_flash_presence_i210(sc)) {
-               /* NVM image release 3.25 has a workaround */
-               if ((sc->sc_nvm_ver_major < 3)
+       if (sc->sc_type == WM_T_I210) {
+               if (!wm_nvm_flash_presence_i210(sc))
+                       sc->sc_flags |= WM_F_PLL_WA_I210;
+               else if ((sc->sc_nvm_ver_major < 3)
                    || ((sc->sc_nvm_ver_major == 3)
                        && (sc->sc_nvm_ver_minor < 25))) {
                        aprint_verbose_dev(sc->sc_dev,
@@ -12485,7 +12493,7 @@
 }
 
 static int
-wm_nvm_get_flash_presence_i210(struct wm_softc *sc)
+wm_nvm_flash_presence_i210(struct wm_softc *sc)
 {
        uint32_t eec;
 
@@ -12649,7 +12657,7 @@
                have_uid = false;
                goto printver;
        case WM_T_I210:
-               if (!wm_nvm_get_flash_presence_i210(sc)) {
+               if (!wm_nvm_flash_presence_i210(sc)) {
                        wm_nvm_version_invm(sc);
                        have_uid = false;
                        goto printver;
@@ -14301,6 +14309,8 @@
        uint16_t nvmword;
        int rv;
 
+       if (sc->sc_type != WM_T_82580)
+               return;
        if ((sc->sc_flags & WM_F_SGMII) == 0)
                return;
 



Home | Main Index | Thread Index | Old Index