summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorcegger <cegger@NetBSD.org>2009-02-11 23:01:07 +0000
committercegger <cegger@NetBSD.org>2009-02-11 23:01:07 +0000
commite6e201ff78d24fd4f664209b4602268fd4291101 (patch)
tree036c599ac1b76c5607d5550ad6703d8fde770795 /sys/dev
parentc0b7d45df7cc68091105048ddaf102e4c0226ce4 (diff)
revert changes in rgephy_reset() done in rev. 1.25.
Should fix PR 40586
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/mii/rgephy.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/dev/mii/rgephy.c b/sys/dev/mii/rgephy.c
index eb2913d5963..a6854888a40 100644
--- a/sys/dev/mii/rgephy.c
+++ b/sys/dev/mii/rgephy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rgephy.c,v 1.25 2009/01/14 19:24:32 cegger Exp $ */
+/* $NetBSD: rgephy.c,v 1.26 2009/02/11 23:01:07 cegger Exp $ */
/*
* Copyright (c) 2003
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.25 2009/01/14 19:24:32 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.26 2009/02/11 23:01:07 cegger Exp $");
/*
@@ -593,17 +593,20 @@ rgephy_reset(struct mii_softc *sc)
struct rgephy_softc *rsc;
uint16_t ssr;
+ mii_phy_reset(sc);
+ DELAY(1000);
+
rsc = (struct rgephy_softc *)sc;
- if (rsc->mii_revision == 3) {
+ if (rsc->mii_revision < 2) {
+ rgephy_load_dspcode(sc);
+ } else if (rsc->mii_revision == 3) {
/* RTL8211C(L) */
ssr = PHY_READ(sc, RGEPHY_MII_SSR);
if ((ssr & RGEPHY_SSR_ALDPS) != 0) {
ssr &= ~RGEPHY_SSR_ALDPS;
PHY_WRITE(sc, RGEPHY_MII_SSR, ssr);
}
- }
-#if 0
- else {
+ } else {
PHY_WRITE(sc, 0x1F, 0x0001);
PHY_WRITE(sc, 0x09, 0x273a);
PHY_WRITE(sc, 0x0e, 0x7bfb);
@@ -629,9 +632,4 @@ rgephy_reset(struct mii_softc *sc)
/* NWay enable and Restart NWay */
PHY_WRITE(sc, RGEPHY_MII_BMCR,
RGEPHY_BMCR_RESET | RGEPHY_BMCR_AUTOEN | RGEPHY_BMCR_STARTNEG);
-#endif
-
- mii_phy_reset(sc);
- DELAY(1000);
- rgephy_load_dspcode(sc);
}