Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mii Add a no-rx-delay device property for RGE8211E t...
details: https://anonhg.NetBSD.org/src/rev/9975af5517cd
branches: trunk
changeset: 358348:9975af5517cd
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sat Dec 23 12:49:54 2017 +0000
description:
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+.
diffstat:
sys/dev/mii/rgephy.c | 16 ++++++++++++++--
1 files changed, 14 insertions(+), 2 deletions(-)
diffs (37 lines):
diff -r c8f0770bf8a8 -r 9975af5517cd sys/dev/mii/rgephy.c
--- a/sys/dev/mii/rgephy.c Sat Dec 23 10:15:52 2017 +0000
+++ b/sys/dev/mii/rgephy.c Sat Dec 23 12:49:54 2017 +0000
@@ -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 @@
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);
Home |
Main Index |
Thread Index |
Old Index