summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2010-06-28 16:04:10 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2010-06-28 16:04:10 +0000
commit6033817102b60473b773a8dc9afe12a4ae822cc7 (patch)
treed8648645eacc3b5becf5a1adb1d3843d1a956a5a /sys
parent44429ee138e76a459833356f0c72ac8f42b61edf (diff)
Add initial support for RTL8168E, brokenness reported by Joe Gidi.
With help from Brad, ok jsg@, closes system/6402
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/re.c11
-rw-r--r--sys/dev/ic/rtl81x9reg.h37
2 files changed, 30 insertions, 18 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index 11f9635109f..1f4fcb88c0e 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.119 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: re.c,v 1.120 2010/06/28 16:04:09 sthen Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -233,6 +233,7 @@ static const struct re_revision {
{ RL_HWREV_8168CP, "RTL8168CP/8111CP" },
{ RL_HWREV_8168D, "RTL8168D/8111D" },
{ RL_HWREV_8168DP, "RTL8168DP/8111DP" },
+ { RL_HWREV_8168E, "RTL8168E/8111E" },
{ RL_HWREV_8169, "RTL8169" },
{ RL_HWREV_8169_8110SB, "RTL8169/8110SB" },
{ RL_HWREV_8169_8110SBL, "RTL8169SBL" },
@@ -856,6 +857,12 @@ re_attach(struct rl_softc *sc, const char *intrstr)
*/
sc->rl_flags |= RL_FLAG_NOJUMBO;
break;
+ case RL_HWREV_8168E:
+ sc->rl_flags |= RL_FLAG_INVMAR | RL_FLAG_PHYWAKE |
+ RL_FLAG_PHYWAKE_PM | RL_FLAG_PAR | RL_FLAG_DESCV2 |
+ RL_FLAG_MACSTAT | FL_FLAG_HWIM | RL_FLAG_CMDSTOP |
+ RL_FLAG_AUTOPAD | RL_FLAG_NOJUMBO;
+ break;
case RL_HWREV_8169_8110SB:
case RL_HWREV_8169_8110SBL:
case RL_HWREV_8169_8110SCd:
@@ -1113,6 +1120,8 @@ re_attach(struct rl_softc *sc, const char *intrstr)
timeout_set(&sc->timer_handle, re_tick, sc);
/* Take PHY out of power down mode. */
+ if (sc->rl_flags & RL_FLAG_PHYWAKE_PM)
+ CSR_WRITE_1(sc, RL_PMCH, CSR_READ_1(sc, RL_PMCH) | 0x80);
if (sc->rl_flags & RL_FLAG_PHYWAKE) {
re_gmii_writereg((struct device *)sc, 1, 0x1f, 0);
re_gmii_writereg((struct device *)sc, 1, 0x0e, 0);
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index f30d3d7a148..a7af0ddb09a 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtl81x9reg.h,v 1.67 2009/08/10 20:29:54 deraadt Exp $ */
+/* $OpenBSD: rtl81x9reg.h,v 1.68 2010/06/28 16:04:09 sthen Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -138,6 +138,7 @@
#define RL_GMEDIASTAT 0x006C /* 8 bits */
#define RL_MACDBG 0x006D /* 8 bits */
#define RL_GPIO 0x006E /* 8 bits */
+#define RL_PMCH 0x006F /* 8 bits */
#define RL_LDPS 0x0082 /* Link Down Power Saving */
#define RL_MAXRXPKTLEN 0x00DA /* 16 bits, chip multiplies by 8 */
#define RL_IM 0x00E2
@@ -168,6 +169,7 @@
#define RL_HWREV_8103E 0x24C00000
#define RL_HWREV_8168D 0x28000000
#define RL_HWREV_8168DP 0x28800000
+#define RL_HWREV_8168E 0x2C000000
#define RL_HWREV_8168_SPIN1 0x30000000
#define RL_HWREV_8100E_SPIN1 0x30800000
#define RL_HWREV_8101E 0x34000000
@@ -821,22 +823,23 @@ struct rl_softc {
int rl_txstart;
u_int32_t rl_flags;
-#define RL_FLAG_MSI 0x0001
-#define RL_FLAG_PCI64 0x0002
-#define RL_FLAG_PCIE 0x0004
-#define RL_FLAG_INVMAR 0x0008
-#define RL_FLAG_PHYWAKE 0x0010
-#define RL_FLAG_NOJUMBO 0x0020
-#define RL_FLAG_PAR 0x0040
-#define RL_FLAG_DESCV2 0x0080
-#define RL_FLAG_MACSTAT 0x0100
-#define RL_FLAG_HWIM 0x0200
-#define RL_FLAG_TIMERINTR 0x0400
-#define RL_FLAG_MACLDPS 0x0800
-#define RL_FLAG_CMDSTOP 0x1000
-#define RL_FLAG_MACSLEEP 0x2000
-#define RL_FLAG_AUTOPAD 0x4000
-#define RL_FLAG_LINK 0x8000
+#define RL_FLAG_MSI 0x00000001
+#define RL_FLAG_PCI64 0x00000002
+#define RL_FLAG_PCIE 0x00000004
+#define RL_FLAG_INVMAR 0x00000008
+#define RL_FLAG_PHYWAKE 0x00000010
+#define RL_FLAG_NOJUMBO 0x00000020
+#define RL_FLAG_PAR 0x00000040
+#define RL_FLAG_DESCV2 0x00000080
+#define RL_FLAG_MACSTAT 0x00000100
+#define RL_FLAG_HWIM 0x00000200
+#define RL_FLAG_TIMERINTR 0x00000400
+#define RL_FLAG_MACLDPS 0x00000800
+#define RL_FLAG_CMDSTOP 0x00001000
+#define RL_FLAG_MACSLEEP 0x00002000
+#define RL_FLAG_AUTOPAD 0x00004000
+#define RL_FLAG_LINK 0x00008000
+#define RL_FLAG_PHYWAKE_PM 0x00010000
u_int16_t rl_intrs;
u_int16_t rl_tx_ack;