
Dear Olav Morken,
In message 09189b13a9a10f413f4f12395032140345592cf3.1223643536.git.olavmrk@gmail.com you wrote:
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 100mbps mode.
Signed-off-by: Gunnar Rangoy gunnar@rangoy.com Signed-off-by: Paul Driveklepp pauldriveklepp@gmail.com Signed-off-by: Olav Morken olavmrk@gmail.com
drivers/net/macb.c | 23 ++++++++++++++++++++++- 1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/drivers/net/macb.c b/drivers/net/macb.c index 08bebf7..4fef374 100644 --- a/drivers/net/macb.c +++ b/drivers/net/macb.c @@ -296,8 +296,29 @@ static void macb_phy_reset(struct macb_device *macb) struct eth_device *netdev = &macb->netdev; int i; u16 status, adv;
- int rmii_mode;
- unsigned min_hz;
+#ifdef CONFIG_RMII
- rmii_mode = 1;
- min_hz = 50000000;
+#else
- rmii_mode = 0;
- min_hz = 25000000;
+#endif
- adv = ADVERTISE_CSMA | ADVERTISE_ALL ;
- if (get_hsb_clk_rate() < min_hz) {
printf("%s: HSB clock < %u MHz in %s mode - "
"disabling 100mbit.\n", netdev->name, min_hz / 1000000,
Use str_mhz() to round and print the frequency. And please use "Mbit/s" or "Mbps" instead of "mbit". See http://en.wikipedia.org/wiki/Mbps#Megabit_per_second
Best regards,
Wolfgang Denk