Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Nov 2013 05:52:33 +0000 (UTC)
From:      Pyun YongHyeon <yongari@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r257612 - stable/10/sys/dev/mii
Message-ID:  <201311040552.rA45qX5s024401@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: yongari
Date: Mon Nov  4 05:52:33 2013
New Revision: 257612
URL: http://svnweb.freebsd.org/changeset/base/257612

Log:
  MFC r257304:
    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.
  Approved by:	re (delphij)

Modified:
  stable/10/sys/dev/mii/miidevs
  stable/10/sys/dev/mii/rgephy.c
Directory Properties:
  stable/10/sys/   (props changed)

Modified: stable/10/sys/dev/mii/miidevs
==============================================================================
--- stable/10/sys/dev/mii/miidevs	Mon Nov  4 05:49:56 2013	(r257611)
+++ stable/10/sys/dev/mii/miidevs	Mon Nov  4 05:52:33 2013	(r257612)
@@ -304,6 +304,7 @@ model yyREALTEK RTL8201L	0x0020 RTL8201L
 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 */

Modified: stable/10/sys/dev/mii/rgephy.c
==============================================================================
--- stable/10/sys/dev/mii/rgephy.c	Mon Nov  4 05:49:56 2013	(r257611)
+++ stable/10/sys/dev/mii/rgephy.c	Mon Nov  4 05:52:33 2013	(r257612)
@@ -90,6 +90,7 @@ static void	rgephy_load_dspcode(struct m
 
 static const struct mii_phydesc rgephys[] = {
 	MII_PHY_DESC(REALTEK, RTL8169S),
+	MII_PHY_DESC(REALTEK, RTL8251),
 	MII_PHY_END
 };
 
@@ -406,7 +407,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);
 	}
@@ -439,7 +441,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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311040552.rA45qX5s024401>