Module Name: src
Committed By: msaitoh
Date: Fri May 6 10:56:04 UTC 2016
Modified Files:
src/sys/dev/pci: if_wm.c
Log Message:
- Modify wm_smbustopci() to reduce the diff against Linux and FreeBSD.
- wm_gate_hw_phy_config_ich8lan() is for younger than PCH2.
- Add debug code.
To generate a diff of this commit:
cvs rdiff -u -r1.393 -r1.394 src/sys/dev/pci/if_wm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/if_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.393 src/sys/dev/pci/if_wm.c:1.394
--- src/sys/dev/pci/if_wm.c:1.393 Fri May 6 08:57:43 2016
+++ src/sys/dev/pci/if_wm.c Fri May 6 10:56:04 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: if_wm.c,v 1.393 2016/05/06 08:57:43 msaitoh Exp $ */
+/* $NetBSD: if_wm.c,v 1.394 2016/05/06 10:56: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.393 2016/05/06 08:57:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.394 2016/05/06 10:56:04 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_net_mpsafe.h"
@@ -3835,7 +3835,8 @@ wm_reset(struct wm_softc *sc)
reg |= CTRL_PHY_RESET;
phy_reset = 1;
- }
+ } else
+ printf("XXX reset is blocked!!!\n");
wm_get_swfwhw_semaphore(sc);
CSR_WRITE(sc, WMREG_CTRL, reg);
/* Don't insert a completion barrier when reset */
@@ -11416,6 +11417,9 @@ wm_gate_hw_phy_config_ich8lan(struct wm_
{
uint32_t reg;
+ if (sc->sc_type < WM_T_PCH2)
+ return;
+
reg = CSR_READ(sc, WMREG_EXTCNFCTR);
if (gate)
@@ -11429,11 +11433,26 @@ wm_gate_hw_phy_config_ich8lan(struct wm_
static void
wm_smbustopci(struct wm_softc *sc)
{
- uint32_t fwsm;
+ uint32_t fwsm, reg;
+
+ /* Gate automatic PHY configuration by hardware on non-managed 82579 */
+ wm_gate_hw_phy_config_ich8lan(sc, true);
+
+ /* Acquire semaphore */
+ wm_get_swfwhw_semaphore(sc);
fwsm = CSR_READ(sc, WMREG_FWSM);
if (((fwsm & FWSM_FW_VALID) == 0)
&& ((wm_phy_resetisblocked(sc) == false))) {
+ if (sc->sc_type >= WM_T_PCH_LPT) {
+ reg = CSR_READ(sc, WMREG_CTRL_EXT);
+ reg |= CTRL_EXT_FORCE_SMBUS;
+ CSR_WRITE(sc, WMREG_CTRL_EXT, reg);
+ CSR_WRITE_FLUSH(sc);
+ delay(50*1000);
+ }
+
+ /* Toggle LANPHYPC */
sc->sc_ctrl |= CTRL_LANPHYPC_OVERRIDE;
sc->sc_ctrl &= ~CTRL_LANPHYPC_VALUE;
CSR_WRITE(sc, WMREG_CTRL, sc->sc_ctrl);
@@ -11444,13 +11463,21 @@ wm_smbustopci(struct wm_softc *sc)
CSR_WRITE_FLUSH(sc);
delay(50*1000);
- /*
- * Gate automatic PHY configuration by hardware on non-managed
- * 82579
- */
- if (sc->sc_type == WM_T_PCH2)
- wm_gate_hw_phy_config_ich8lan(sc, 1);
+ if (sc->sc_type >= WM_T_PCH_LPT) {
+ reg = CSR_READ(sc, WMREG_CTRL_EXT);
+ reg &= ~CTRL_EXT_FORCE_SMBUS;
+ CSR_WRITE(sc, WMREG_CTRL_EXT, reg);
+ }
}
+
+ /* Release semaphore */
+ wm_put_swfwhw_semaphore(sc);
+
+ /*
+ * Ungate automatic PHY configuration by hardware on non-managed 82579
+ */
+ if ((sc->sc_type == WM_T_PCH2) && ((fwsm & FWSM_FW_VALID) == 0))
+ wm_gate_hw_phy_config_ich8lan(sc, false);
}
static void