when resetting RTL8211F, make sure to disable manual MDI mode

This commit is contained in:
jmcneill 2015-03-31 21:01:02 +00:00
parent c380b27c05
commit 3c1e6be6f8
2 changed files with 14 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: rgephy.c,v 1.38 2015/03/04 18:21:00 jmcneill Exp $ */
/* $NetBSD: rgephy.c,v 1.39 2015/03/31 21:01:02 jmcneill Exp $ */
/*
* Copyright (c) 2003
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.38 2015/03/04 18:21:00 jmcneill Exp $");
__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.39 2015/03/31 21:01:02 jmcneill Exp $");
/*
@ -619,7 +619,7 @@ rgephy_load_dspcode(struct mii_softc *sc)
static void
rgephy_reset(struct mii_softc *sc)
{
uint16_t ssr;
uint16_t ssr, phycr1;
mii_phy_reset(sc);
DELAY(1000);
@ -634,6 +634,13 @@ rgephy_reset(struct mii_softc *sc)
ssr &= ~RGEPHY_SSR_ALDPS;
PHY_WRITE(sc, RGEPHY_MII_SSR, ssr);
}
} else if (sc->mii_mpd_rev == 6) {
/* RTL8211F */
phycr1 = PHY_READ(sc, RGEPHY_MII_PHYCR1);
if ((phycr1 & RGEPHY_PHYCR1_MDI_MMCE) != 0) {
phycr1 &= ~RGEPHY_PHYCR1_MDI_MMCE;
PHY_WRITE(sc, RGEPHY_MII_PHYCR1, phycr1);
}
} else {
PHY_WRITE(sc, 0x1F, 0x0000);
PHY_WRITE(sc, 0x0e, 0x0000);

View File

@ -1,4 +1,4 @@
/* $NetBSD: rgephyreg.h,v 1.7 2015/03/04 18:21:00 jmcneill Exp $ */
/* $NetBSD: rgephyreg.h,v 1.8 2015/03/31 21:01:02 jmcneill Exp $ */
/*
* Copyright (c) 2003
@ -56,6 +56,9 @@
#define RGEPHY_SSR_JABBER 0x0001 /* Jabber */
/* RTL8211F */
#define RGEPHY_MII_PHYCR1 0x18 /* PHY Specific control register 1 */
#define RGEPHY_PHYCR1_MDI_MMCE __BIT(9)
#define RGEPHY_MII_PHYSR 0x1a /* PHY Specific status register */
#define RGEPHY_PHYSR_ALDPS __BIT(14)
#define RGEPHY_PHYSR_MDI_PLUG __BIT(13)