Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Add support to recognize the 8168E model of this ...
details: https://anonhg.NetBSD.org/src/rev/1ac3cb5f3d53
branches: trunk
changeset: 771478:1ac3cb5f3d53
user: garbled <garbled%NetBSD.org@localhost>
date: Tue Nov 22 18:42:56 2011 +0000
description:
Add support to recognize the 8168E model of this chip. Taken from FreeBSD
diffstat:
sys/dev/ic/rtl8169.c | 13 +++++++++++--
sys/dev/ic/rtl81x9reg.h | 4 +++-
sys/dev/ic/rtl81x9var.h | 3 ++-
3 files changed, 16 insertions(+), 4 deletions(-)
diffs (83 lines):
diff -r c163e2efd1b0 -r 1ac3cb5f3d53 sys/dev/ic/rtl8169.c
--- a/sys/dev/ic/rtl8169.c Tue Nov 22 18:25:48 2011 +0000
+++ b/sys/dev/ic/rtl8169.c Tue Nov 22 18:42:56 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl8169.c,v 1.133 2010/07/28 23:30:21 msaitoh Exp $ */
+/* $NetBSD: rtl8169.c,v 1.134 2011/11/22 18:42:56 garbled Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.133 2010/07/28 23:30:21 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.134 2011/11/22 18:42:56 garbled Exp $");
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
/*
@@ -601,6 +601,11 @@
*/
sc->sc_quirk |= RTKQ_NOJUMBO;
break;
+ case RTK_HWREV_8168E:
+ sc->sc_quirk |= RTKQ_DESCV2 | RTKQ_NOEECMD |
+ RTKQ_MACSTAT | RTKQ_CMDSTOP | RTKQ_PHYWAKE_PM |
+ RTKQ_NOJUMBO;
+ break;
case RTK_HWREV_8100E:
case RTK_HWREV_8100E_SPIN2:
case RTK_HWREV_8101E:
@@ -659,6 +664,10 @@
}
}
+ /* Take PHY out of power down mode. */
+ if ((sc->sc_quirk & RTKQ_PHYWAKE_PM) != 0)
+ CSR_WRITE_1(sc, RTK_PMCH, CSR_READ_1(sc, RTK_PMCH) | 0x80);
+
aprint_normal_dev(sc->sc_dev, "Ethernet address %s\n",
ether_sprintf(eaddr));
diff -r c163e2efd1b0 -r 1ac3cb5f3d53 sys/dev/ic/rtl81x9reg.h
--- a/sys/dev/ic/rtl81x9reg.h Tue Nov 22 18:25:48 2011 +0000
+++ b/sys/dev/ic/rtl81x9reg.h Tue Nov 22 18:42:56 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl81x9reg.h,v 1.41 2010/04/09 10:40:59 nonaka Exp $ */
+/* $NetBSD: rtl81x9reg.h,v 1.42 2011/11/22 18:42:57 garbled Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -130,6 +130,7 @@
#define RTK_CSIAR 0x0068
#define RTK_TBI_LPAR 0x006A
#define RTK_GMEDIASTAT 0x006C /* 8 bits */
+#define RTK_PMCH 0x006F /* 8 bits */
#define RTK_EPHYAR 0x0080
#define RTK_LDPS 0x0082 /* Link Down Power Saving */
#define RTK_DBG_REG 0x00D1
@@ -161,6 +162,7 @@
#define RTK_HWREV_8103E 0x24C00000
#define RTK_HWREV_8168D 0x28000000
#define RTK_HWREV_8168DP 0x28800000
+#define RTK_HWREV_8168E 0x2C000000
#define RTK_HWREV_8168_SPIN1 0x30000000
#define RTK_HWREV_8100E 0x30800000
#define RTK_HWREV_8101E 0x34000000
diff -r c163e2efd1b0 -r 1ac3cb5f3d53 sys/dev/ic/rtl81x9var.h
--- a/sys/dev/ic/rtl81x9var.h Tue Nov 22 18:25:48 2011 +0000
+++ b/sys/dev/ic/rtl81x9var.h Tue Nov 22 18:42:56 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl81x9var.h,v 1.51 2011/11/19 22:51:22 tls Exp $ */
+/* $NetBSD: rtl81x9var.h,v 1.52 2011/11/22 18:42:57 garbled Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -195,6 +195,7 @@
#define RTKQ_NOEECMD 0x00000080 /* unusable EEPROM command */
#define RTKQ_MACSTAT 0x00000100 /* set MACSTAT_DIS on init */
#define RTKQ_CMDSTOP 0x00000200 /* set STOPREQ on stop */
+#define RTKQ_PHYWAKE_PM 0x00000400 /* wake PHY from power down */
bus_dma_tag_t sc_dmat;
Home |
Main Index |
Thread Index |
Old Index