Tue Jun 11 14:39:35 2013 UTC ()
 Disable LPLU when the device is WM_T_PCH_LPT series (I21[78]).
This change fixes a bug that wm interface don't negotiate to 1000BaseT.


(msaitoh)
diff -r1.254 -r1.255 src/sys/dev/pci/if_wm.c

cvs diff -r1.254 -r1.255 src/sys/dev/pci/if_wm.c (expand / switch to unified diff)

--- src/sys/dev/pci/if_wm.c 2013/06/11 10:07:09 1.254
+++ src/sys/dev/pci/if_wm.c 2013/06/11 14:39:35 1.255
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: if_wm.c,v 1.254 2013/06/11 10:07:09 msaitoh Exp $ */ 1/* $NetBSD: if_wm.c,v 1.255 2013/06/11 14:39:35 msaitoh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc. 4 * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -66,27 +66,27 @@ @@ -66,27 +66,27 @@
66 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 66 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
67 POSSIBILITY OF SUCH DAMAGE. 67 POSSIBILITY OF SUCH DAMAGE.
68 68
69*******************************************************************************/ 69*******************************************************************************/
70/* 70/*
71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips. 71 * Device driver for the Intel i8254x family of Gigabit Ethernet chips.
72 * 72 *
73 * TODO (in order of importance): 73 * TODO (in order of importance):
74 * 74 *
75 * - Rework how parameters are loaded from the EEPROM. 75 * - Rework how parameters are loaded from the EEPROM.
76 */ 76 */
77 77
78#include <sys/cdefs.h> 78#include <sys/cdefs.h>
79__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.254 2013/06/11 10:07:09 msaitoh Exp $"); 79__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.255 2013/06/11 14:39:35 msaitoh Exp $");
80 80
81#include <sys/param.h> 81#include <sys/param.h>
82#include <sys/systm.h> 82#include <sys/systm.h>
83#include <sys/callout.h> 83#include <sys/callout.h>
84#include <sys/mbuf.h> 84#include <sys/mbuf.h>
85#include <sys/malloc.h> 85#include <sys/malloc.h>
86#include <sys/kernel.h> 86#include <sys/kernel.h>
87#include <sys/socket.h> 87#include <sys/socket.h>
88#include <sys/ioctl.h> 88#include <sys/ioctl.h>
89#include <sys/errno.h> 89#include <sys/errno.h>
90#include <sys/device.h> 90#include <sys/device.h>
91#include <sys/queue.h> 91#include <sys/queue.h>
92#include <sys/syslog.h> 92#include <sys/syslog.h>
@@ -6332,27 +6332,28 @@ wm_gmii_reset(struct wm_softc *sc) @@ -6332,27 +6332,28 @@ wm_gmii_reset(struct wm_softc *sc)
6332 /* 6332 /*
6333 * dummy read to clear the phy wakeup bit after lcd 6333 * dummy read to clear the phy wakeup bit after lcd
6334 * reset 6334 * reset
6335 */ 6335 */
6336 reg = wm_gmii_hv_readreg(sc->sc_dev, 1, BM_WUC); 6336 reg = wm_gmii_hv_readreg(sc->sc_dev, 1, BM_WUC);
6337 } 6337 }
6338 6338
6339 /* 6339 /*
6340 * XXX Configure the LCD with th extended configuration region 6340 * XXX Configure the LCD with th extended configuration region
6341 * in NVM 6341 * in NVM
6342 */ 6342 */
6343 6343
6344 /* Configure the LCD with the OEM bits in NVM */ 6344 /* Configure the LCD with the OEM bits in NVM */
6345 if ((sc->sc_type == WM_T_PCH) || (sc->sc_type == WM_T_PCH2)) { 6345 if ((sc->sc_type == WM_T_PCH) || (sc->sc_type == WM_T_PCH2)
 6346 || (sc->sc_type == WM_T_PCH_LPT)) {
6346 /* 6347 /*
6347 * Disable LPLU. 6348 * Disable LPLU.
6348 * XXX It seems that 82567 has LPLU, too. 6349 * XXX It seems that 82567 has LPLU, too.
6349 */ 6350 */
6350 reg = wm_gmii_hv_readreg(sc->sc_dev, 1, HV_OEM_BITS); 6351 reg = wm_gmii_hv_readreg(sc->sc_dev, 1, HV_OEM_BITS);
6351 reg &= ~(HV_OEM_BITS_A1KDIS| HV_OEM_BITS_LPLU); 6352 reg &= ~(HV_OEM_BITS_A1KDIS| HV_OEM_BITS_LPLU);
6352 reg |= HV_OEM_BITS_ANEGNOW; 6353 reg |= HV_OEM_BITS_ANEGNOW;
6353 wm_gmii_hv_writereg(sc->sc_dev, 1, HV_OEM_BITS, reg); 6354 wm_gmii_hv_writereg(sc->sc_dev, 1, HV_OEM_BITS, reg);
6354 } 6355 }
6355 break; 6356 break;
6356 default: 6357 default:
6357 panic("%s: unknown type\n", __func__); 6358 panic("%s: unknown type\n", __func__);
6358 break; 6359 break;