summaryrefslogtreecommitdiffstats
path: root/sys/dev/mii
diff options
context:
space:
mode:
authoryongari <yongari@FreeBSD.org>2013-10-29 05:14:38 +0000
committeryongari <yongari@FreeBSD.org>2013-10-29 05:14:38 +0000
commita105a877e26e9bc8c98705ece0548821864e72e3 (patch)
tree46cd4302691184bd7337a39b4ca1b744f25ba1bf /sys/dev/mii
parenta17f5000ca5235d24f8c7a6ae4e8566b8c0d7148 (diff)
downloadFreeBSD-src-a105a877e26e9bc8c98705ece0548821864e72e3.zip
FreeBSD-src-a105a877e26e9bc8c98705ece0548821864e72e3.tar.gz
Add support for new Gigabit PHY of RealTek.
I don't have a copy of data sheet so I'm not sure exact PHY model name. Vendor's web page indicates RTL8251 is latest PHY so I used the name. This PHY is used with RTL8168G, RTL8168GU and RTL8411B.
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/miidevs1
-rw-r--r--sys/dev/mii/rgephy.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/mii/miidevs b/sys/dev/mii/miidevs
index d2931f3..60a883a 100644
--- a/sys/dev/mii/miidevs
+++ b/sys/dev/mii/miidevs
@@ -304,6 +304,7 @@ model yyREALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface
model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
model REALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch
model REALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface
+model REALTEK RTL8251 0x0000 RTL8251 1000BASE-T media interface
model REALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
/* Seeq Seeq PHYs */
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index 6a34303..fbeeb51 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -91,6 +91,7 @@ static void rgephy_load_dspcode(struct mii_softc *);
static const struct mii_phydesc rgephys[] = {
MII_PHY_DESC(REALTEK, RTL8169S),
+ MII_PHY_DESC(REALTEK, RTL8251),
MII_PHY_END
};
@@ -395,7 +396,8 @@ rgephy_loop(struct mii_softc *sc)
{
int i;
- if (sc->mii_mpd_rev < 2) {
+ if (sc->mii_mpd_model != MII_MODEL_REALTEK_RTL8251 &&
+ sc->mii_mpd_rev < 2) {
PHY_WRITE(sc, RGEPHY_MII_BMCR, RGEPHY_BMCR_PDOWN);
DELAY(1000);
}
@@ -428,7 +430,8 @@ rgephy_load_dspcode(struct mii_softc *sc)
{
int val;
- if (sc->mii_mpd_rev >= 2)
+ if (sc->mii_mpd_model == MII_MODEL_REALTEK_RTL8251 ||
+ sc->mii_mpd_rev >= 2)
return;
PHY_WRITE(sc, 31, 0x0001);
OpenPOWER on IntegriCloud