From: Olav Morken <olav...@gmail.com>

For 100mbps operation, the ethernet controller requires a 25 MHz clock
in MII mode, and a 50 MHz clock in RMII mode. If the clock is slower,
disable 100 Mbps mode.

Signed-off-by: Gunnar Rangoy <gun...@rangoy.com>
Signed-off-by: Paul Driveklepp <pauldrivekl...@gmail.com>
Signed-off-by: Olav Morken <olav...@gmail.com>
---
 drivers/net/macb.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 08bebf7..d47a052 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -297,7 +297,17 @@ static void macb_phy_reset(struct macb_device *macb)
        int i;
        u16 status, adv;
 
-       adv = ADVERTISE_CSMA | ADVERTISE_ALL;
+       adv = ADVERTISE_CSMA | ADVERTISE_ALL ;
+
+#ifdef CONFIG_MACB_FORCE10M
+       printf("%s: 100Mbps is not supported on this board - forcing 10Mbps.\n",
+              netdev->name);
+
+       adv &= ~ADVERTISE_100FULL;
+       adv &= ~ADVERTISE_100HALF;
+       adv &= ~ADVERTISE_100BASE4;
+#endif
+
        macb_mdio_write(macb, MII_ADVERTISE, adv);
        printf("%s: Starting autonegotiation...\n", netdev->name);
        macb_mdio_write(macb, MII_BMCR, (BMCR_ANENABLE
-- 
1.6.0.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to