diff options
author | yongari <yongari@FreeBSD.org> | 2007-10-29 05:50:22 +0000 |
---|---|---|
committer | yongari <yongari@FreeBSD.org> | 2007-10-29 05:50:22 +0000 |
commit | f66e89284c9cf9d29d9bde2a8e94226dfe43b166 (patch) | |
tree | 87209b446c854749b5aca5a1a592d6a118204b60 /sys | |
parent | 1770a41b68e63c731e31c1363f5a760fd569e55d (diff) | |
download | FreeBSD-src-f66e89284c9cf9d29d9bde2a8e94226dfe43b166.zip FreeBSD-src-f66e89284c9cf9d29d9bde2a8e94226dfe43b166.tar.gz |
Add 88E1116/88E1116R PHY support code that takes the PHY out of
power-down mode.
PR: kern/114086
MFC after: 3 days
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mii/e1000phy.c | 10 | ||||
-rw-r--r-- | sys/dev/mii/e1000phyreg.h | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/sys/dev/mii/e1000phy.c b/sys/dev/mii/e1000phy.c index 88c3b74..91da628 100644 --- a/sys/dev/mii/e1000phy.c +++ b/sys/dev/mii/e1000phy.c @@ -235,6 +235,8 @@ e1000phy_reset(struct mii_softc *sc) /* Disable energy detect mode. */ reg &= ~E1000_SCR_EN_DETECT_MASK; reg |= E1000_SCR_AUTO_X_MODE; + if (esc->mii_model == MII_MODEL_MARVELL_E1116) + reg &= ~E1000_SCR_POWER_DOWN; break; case MII_MODEL_MARVELL_E3082: reg |= (E1000_SCR_AUTO_X_MODE >> 1); @@ -248,6 +250,14 @@ e1000phy_reset(struct mii_softc *sc) /* Auto correction for reversed cable polarity. */ reg &= ~E1000_SCR_POLARITY_REVERSAL; PHY_WRITE(sc, E1000_SCR, reg); + + if (esc->mii_model == MII_MODEL_MARVELL_E1116) { + PHY_WRITE(sc, E1000_EADR, 2); + reg = PHY_READ(sc, E1000_SCR); + reg |= E1000_SCR_RGMII_POWER_UP; + PHY_WRITE(sc, E1000_SCR, reg); + PHY_WRITE(sc, E1000_EADR, 0); + } } switch (MII_MODEL(esc->mii_model)) { diff --git a/sys/dev/mii/e1000phyreg.h b/sys/dev/mii/e1000phyreg.h index 96d7687..6f30f5c 100644 --- a/sys/dev/mii/e1000phyreg.h +++ b/sys/dev/mii/e1000phyreg.h @@ -244,6 +244,11 @@ #define E1000_SCR_MODE_COPPER 0x0280 #define E1000_SCR_MODE_1000BX 0x0380 +/* 88E1116 page 0 */ +#define E1000_SCR_POWER_DOWN 0x0004 +/* 88E1116 page 2 */ +#define E1000_SCR_RGMII_POWER_UP 0x0008 + #define E1000_SSR 0x11 /* special status register */ #define E1000_SSR_JABBER 0x0001 #define E1000_SSR_REV_POLARITY 0x0002 |