Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci - Call wm_set_pcie_completion_timeout() on I350, ...



details:   https://anonhg.NetBSD.org/src/rev/5c84fa0f10f4
branches:  trunk
changeset: 797719:5c84fa0f10f4
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Jul 25 18:28:03 2014 +0000

description:
- Call wm_set_pcie_completion_timeout() on I350, I354, I210 and I211, too.
  Same as FreeBSD and OpenBSD.
- Drop PHPM_GO_LINK_D bit in WMREG_PHPM on some chips. From FreeBSD.

diffstat:

 sys/dev/pci/if_wm.c    |  18 +++++++++++++++---
 sys/dev/pci/if_wmreg.h |   5 ++++-
 2 files changed, 19 insertions(+), 4 deletions(-)

diffs (72 lines):

diff -r 5771279cd738 -r 5c84fa0f10f4 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Fri Jul 25 17:54:50 2014 +0000
+++ b/sys/dev/pci/if_wm.c       Fri Jul 25 18:28:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.281 2014/07/23 10:48:16 msaitoh Exp $      */
+/*     $NetBSD: if_wm.c,v 1.282 2014/07/25 18:28:03 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.281 2014/07/23 10:48:16 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.282 2014/07/25 18:28:03 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3188,7 +3188,9 @@
 
        /* Set the completion timeout for interface */
        if ((sc->sc_type == WM_T_82575) || (sc->sc_type == WM_T_82576)
-           || (sc->sc_type == WM_T_I350) || (sc->sc_type == WM_T_I354))
+           || (sc->sc_type == WM_T_82580) || (sc->sc_type == WM_T_82580ER)
+           || (sc->sc_type == WM_T_I350) || (sc->sc_type == WM_T_I354)
+           || (sc->sc_type == WM_T_I210) || (sc->sc_type == WM_T_I211))
                wm_set_pcie_completion_timeout(sc);
 
        /* Clear interrupt */
@@ -6058,6 +6060,7 @@
 {
        struct ifnet *ifp = &sc->sc_ethercom.ec_if;
        struct mii_data *mii = &sc->sc_mii;
+       uint32_t reg;
 
        /* We have MII. */
        sc->sc_flags |= WM_F_HAS_MII;
@@ -6067,6 +6070,15 @@
        else
                sc->sc_tipg = TIPG_1000T_DFLT;
 
+       /* XXX Not for I354? FreeBSD's e1000_82575.c doesn't include it */
+       if ((sc->sc_type == WM_T_82580) || (sc->sc_type == WM_T_82580ER)
+           || (sc->sc_type == WM_T_I350) || (sc->sc_type == WM_T_I210)
+           || (sc->sc_type == WM_T_I211)) {
+               reg = CSR_READ(sc, WMREG_PHPM);
+               reg &= ~PHPM_GO_LINK_D;
+               CSR_WRITE(sc, WMREG_PHPM, reg);
+       }
+
        /*
         * Let the chip set speed/duplex on its own based on
         * signals from the PHY.
diff -r 5771279cd738 -r 5c84fa0f10f4 sys/dev/pci/if_wmreg.h
--- a/sys/dev/pci/if_wmreg.h    Fri Jul 25 17:54:50 2014 +0000
+++ b/sys/dev/pci/if_wmreg.h    Fri Jul 25 18:28:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wmreg.h,v 1.58 2014/07/25 01:05:00 msaitoh Exp $    */
+/*     $NetBSD: if_wmreg.h,v 1.59 2014/07/25 18:28:03 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -625,6 +625,9 @@
 #define        WM_ICH8_MC_TABSIZE 32
 #define        WM_VLAN_TABSIZE 128
 
+#define        WMREG_PHPM      0x0e14  /* PHY Power Management */
+#define        PHPM_GO_LINK_D          __BIT(5)        /* Go Link Disconnect */
+
 #define WMREG_EEER     0x0e30  /* Energy Efficiency Ethernet "EEE" */
 #define EEER_TX_LPI_EN         0x00010000 /* EEER Tx LPI Enable */
 #define EEER_RX_LPI_EN         0x00020000 /* EEER Rx LPI Enable */



Home | Main Index | Thread Index | Old Index