summaryrefslogtreecommitdiffstats
path: root/c/src/libchip/network
diff options
context:
space:
mode:
authorJiri Gaisler <jiri@gaisler.se>2013-06-16 15:40:03 +0200
committerJoel Sherrill <joel.sherrill@oarcorp.com>2013-06-19 08:21:49 -0500
commit45fecbb6db8f52bb7f9e14732128b7cd70229e7f (patch)
treee8efde3f6813b43ac38e137baea8f563fb7d6673 /c/src/libchip/network
parentgreth: prefer full duplex if available (diff)
downloadrtems-45fecbb6db8f52bb7f9e14732128b7cd70229e7f.tar.bz2
greth: do not advertise 1000M capability if MAC does not support it.
Diffstat (limited to 'c/src/libchip/network')
-rw-r--r--c/src/libchip/network/greth.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/c/src/libchip/network/greth.c b/c/src/libchip/network/greth.c
index 2663e8d915..cab41b8f2d 100644
--- a/c/src/libchip/network/greth.c
+++ b/c/src/libchip/network/greth.c
@@ -306,6 +306,17 @@ greth_initialize_hardware (struct greth_softc *sc)
write_mii(phyaddr, 0, 0x8000 | phyctrl);
while ((read_mii(phyaddr, 0)) & 0x8000) {}
+ phystatus = read_mii(phyaddr, 1);
+
+ /* Disable Gbit auto-neg advertisement if MAC does not support it */
+
+ if ((!sc->gbit_mac) && (phystatus & 0x100)) write_mii(phyaddr, 9, 0);
+
+ /* Restart auto-negotiation if available */
+ if (phystatus & 0x08) {
+ write_mii(phyaddr, 0, phyctrl | 0x1200);
+ phyctrl = read_mii(phyaddr, 0);
+ }
/* Check if PHY is autoneg capable and then determine operating mode,
otherwise force it to 10 Mbit halfduplex */