summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2008-07-02 08:10:18 +0000
committeryongari <yongari@FreeBSD.org>2008-07-02 08:10:18 +0000
commit2af52bdb8e74ce2b6e8b81230d001b2cdcbe2e10 (patch)
tree1537c14be5a97ee699d8ca41bf4a51274e064280
parent991fbab98ac949a42b3e619f86aafdd769587621 (diff)
downloadFreeBSD-src-2af52bdb8e74ce2b6e8b81230d001b2cdcbe2e10.zip
FreeBSD-src-2af52bdb8e74ce2b6e8b81230d001b2cdcbe2e10.tar.gz
Add RTL8211C(L) support.
Disable advanced link-down power saving in phy reset. Reported by: nork Tested by: nork
-rw-r--r--sys/dev/mii/rgephy.c14
-rw-r--r--sys/dev/mii/rgephyreg.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index bff5f81..221c504 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -34,7 +34,7 @@
__FBSDID("$FreeBSD$");
/*
- * Driver for the RealTek 8169S/8110S/8211B internal 10/100/1000 PHY.
+ * Driver for the RealTek 8169S/8110S/8211B/8211C internal 10/100/1000 PHY.
*/
#include <sys/param.h>
@@ -531,6 +531,18 @@ rgephy_load_dspcode(struct mii_softc *sc)
static void
rgephy_reset(struct mii_softc *sc)
{
+ struct rgephy_softc *rsc;
+ uint16_t ssr;
+
+ rsc = (struct rgephy_softc *)sc;
+ if (rsc->mii_revision == 3) {
+ /* RTL8211C(L) */
+ ssr = PHY_READ(sc, RGEPHY_MII_SSR);
+ if ((ssr & RGEPHY_SSR_ALDPS) != 0) {
+ ssr &= ~RGEPHY_SSR_ALDPS;
+ PHY_WRITE(sc, RGEPHY_MII_SSR, ssr);
+ }
+ }
mii_phy_reset(sc);
DELAY(1000);
diff --git a/sys/dev/mii/rgephyreg.h b/sys/dev/mii/rgephyreg.h
index fd0d32c..6899d8c 100644
--- a/sys/dev/mii/rgephyreg.h
+++ b/sys/dev/mii/rgephyreg.h
@@ -137,7 +137,7 @@
#define RGEPHY_EXTSTS_T_FD_CAP 0x2000 /* 1000base-T FD capable */
#define RGEPHY_EXTSTS_T_HD_CAP 0x1000 /* 1000base-T HD capable */
-/* RTL8211B(L) */
+/* RTL8211B(L)/RTL8211C(L) */
#define RGEPHY_MII_SSR 0x11 /* PHY Specific status register */
#define RGEPHY_SSR_S1000 0x8000 /* 1000Mbps */
#define RGEPHY_SSR_S100 0x4000 /* 100Mbps */
@@ -148,6 +148,7 @@
#define RGEPHY_SSR_SPD_DPLX_RESOLVED 0x0800 /* speed/duplex resolved */
#define RGEPHY_SSR_LINK 0x0400 /* link up */
#define RGEPHY_SSR_MDI_XOVER 0x0040 /* MDI crossover */
+#define RGEPHY_SSR_ALDPS 0x0008 /* RTL8211C(L) only */
#define RGEPHY_SSR_JABBER 0x0001 /* Jabber */
#endif /* _DEV_RGEPHY_MIIREG_H_ */
OpenPOWER on IntegriCloud