Module Name: src
Committed By: jmcneill
Date: Sat Dec 23 12:49:55 UTC 2017
Modified Files:
src/sys/dev/mii: rgephy.c
Log Message:
Add a no-rx-delay device property for RGE8211E that disables RX internal
delay using some undocumented registers. Required for stable gigabit links
on Pine64+.
To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/dev/mii/rgephy.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/mii/rgephy.c
diff -u src/sys/dev/mii/rgephy.c:1.40 src/sys/dev/mii/rgephy.c:1.41
--- src/sys/dev/mii/rgephy.c:1.40 Fri Aug 21 12:22:22 2015
+++ src/sys/dev/mii/rgephy.c Sat Dec 23 12:49:54 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: rgephy.c,v 1.40 2015/08/21 12:22:22 jmcneill Exp $ */
+/* $NetBSD: rgephy.c,v 1.41 2017/12/23 12:49:54 jmcneill Exp $ */
/*
* Copyright (c) 2003
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.40 2015/08/21 12:22:22 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.41 2017/12/23 12:49:54 jmcneill Exp $");
/*
@@ -634,6 +634,18 @@ rgephy_reset(struct mii_softc *sc)
ssr &= ~RGEPHY_SSR_ALDPS;
PHY_WRITE(sc, RGEPHY_MII_SSR, ssr);
}
+ } else if (sc->mii_mpd_rev == 5) {
+ /* RTL8211E */
+ prop_dictionary_t prop = device_properties(sc->mii_dev);
+ bool no_rx_delay = false;
+ prop_dictionary_get_bool(prop, "no-rx-delay", &no_rx_delay);
+ if (no_rx_delay) {
+ /* Disable RX internal delay (undocumented) */
+ PHY_WRITE(sc, 0x1f, 0x0007);
+ PHY_WRITE(sc, 0x1e, 0x00a4);
+ PHY_WRITE(sc, 0x1c, 0xb591);
+ PHY_WRITE(sc, 0x1f, 0x0000);
+ }
} else if (sc->mii_mpd_rev == 6) {
/* RTL8211F */
phycr1 = PHY_READ(sc, RGEPHY_MII_PHYCR1);