mii: Add support for Realtek RTL8211F-VD PHY

The RTL8211F-VD is a replacement/upgrade for the RTL8211F. Based on
bb726b753f,
the only difference is the lack of the PCR2 register, which FreeBSD
doesn't use.

This fixes autonegotiation problems using the RTL8211F with ukphy(4).
Reviewed by:	manu, bz
MFC after:	1 month
Differential Revision:  <https://reviews.freebsd.org/D45109
This commit is contained in:
Peter Jeremy 2024-05-08 18:17:00 +10:00
parent b54d4a1627
commit 3fe25a9bfc
No known key found for this signature in database
GPG key ID: 16A597A0E4A20B34
3 changed files with 6 additions and 2 deletions

View file

@ -330,6 +330,7 @@ model REALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch
model REALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface
model REALTEK RTL8251 0x0000 RTL8251/8153 1000BASE-T media interface
model REALTEK RTL8169S 0x0011 RTL8169S/8110S/8211 1000BASE-T media interface
model REALTEK RTL8211FVD 0x0007 RTL8211F-VD 1000BASE-T media interface
/* Seeq Seeq PHYs */
model SEEQ 80220 0x0003 Seeq 80220 10/100 media interface

View file

@ -93,6 +93,7 @@ static void rgephy_disable_eee(struct mii_softc *);
static const struct mii_phydesc rgephys[] = {
MII_PHY_DESC(REALTEK, RTL8169S),
MII_PHY_DESC(REALTEK, RTL8251),
MII_PHY_DESC(REALTEK, RTL8211FVD),
MII_PHY_END
};
@ -283,7 +284,7 @@ rgephy_linkup(struct mii_softc *sc)
linkup = 0;
if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 &&
sc->mii_mpd_rev >= RGEPHY_8211B) {
if (sc->mii_mpd_rev == RGEPHY_8211F) {
if (sc->mii_mpd_rev >= RGEPHY_8211F) {
reg = PHY_READ(sc, RGEPHY_F_MII_SSR);
if (reg & RGEPHY_F_SSR_LINK)
linkup++;
@ -338,7 +339,7 @@ rgephy_status(struct mii_softc *sc)
if ((sc->mii_flags & MIIF_PHYPRIV0) == 0 &&
sc->mii_mpd_rev >= RGEPHY_8211B) {
if (sc->mii_mpd_rev == RGEPHY_8211F) {
if (sc->mii_mpd_rev >= RGEPHY_8211F) {
ssr = PHY_READ(sc, RGEPHY_F_MII_SSR);
switch (ssr & RGEPHY_F_SSR_SPD_MASK) {
case RGEPHY_F_SSR_S1000:
@ -523,6 +524,7 @@ rgephy_reset(struct mii_softc *sc)
switch (sc->mii_mpd_rev) {
case RGEPHY_8211F:
case RGEPHY_8211FVD:
pcr = PHY_READ(sc, RGEPHY_F_MII_PCR1);
pcr &= ~(RGEPHY_F_PCR1_MDI_MM | RGEPHY_F_PCR1_ALDPS_EN);
PHY_WRITE(sc, RGEPHY_F_MII_PCR1, pcr);

View file

@ -38,6 +38,7 @@
#define RGEPHY_8211B 2
#define RGEPHY_8211C 3
#define RGEPHY_8211F 6
#define RGEPHY_8211FVD 8
/*
* RealTek 8169S/8110S gigE PHY registers