From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 05/10] AVR32: macb - Disable 100mbps if clock is slow
Date: Thu, 16 Oct 2008 23:00:44 -0700 [thread overview]
Message-ID: <48F82A0C.9030505@gmail.com> (raw)
In-Reply-To: <09189b13a9a10f413f4f12395032140345592cf3.1223643536.git.olavmrk@gmail.com>
Olav Morken 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,
> + (rmii_mode ? "RMII" : "MII"));
> +
> + adv &= ~ADVERTISE_100FULL;
> + adv &= ~ADVERTISE_100HALF;
> + adv &= ~ADVERTISE_100BASE4;
> + }
>
> - adv = ADVERTISE_CSMA | ADVERTISE_ALL;
> macb_mdio_write(macb, MII_ADVERTISE, adv);
> printf("%s: Starting autonegotiation...\n", netdev->name);
> macb_mdio_write(macb, MII_BMCR, (BMCR_ANENABLE
>
Applied to net/testing.
regards,
Ben
next prev parent reply other threads:[~2008-10-17 6:00 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 13:15 [U-Boot] [PATCH 00/10] AVR32: RFC/preview - support for ATEVK1100 evaluation board Olav Morken
2008-10-10 13:15 ` [U-Boot] [PATCH 01/10] Fix IP alignement problem Olav Morken
2008-10-10 14:42 ` Haavard Skinnemoen
2008-10-10 17:01 ` Ben Warren
2008-10-10 18:56 ` Olav Morken
2008-10-10 19:13 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-10 19:52 ` Olav Morken
[not found] ` <3b41dc450810101153h73bb0ec4s424ebbc39564e92d@mail.gmail.com>
2008-10-15 5:07 ` Ben Warren
2008-10-15 15:11 ` Olav Morken
2008-10-17 10:47 ` Jean-Christophe PLAGNIOL-VILLARD
2008-10-17 11:24 ` Olav Morken
2008-10-17 6:00 ` Ben Warren
2008-10-10 13:15 ` [U-Boot] [PATCH 02/10] AVR32: atmel_usart - Make sure that all interrupts are disabled during startup Olav Morken
2008-10-10 13:15 ` [U-Boot] [PATCH 03/10] AVR32: Make cacheflush cpu-dependent Olav Morken
2008-11-18 23:44 ` Wolfgang Denk
2008-10-10 13:15 ` [U-Boot] [PATCH 04/10] AVR32: Move addrspace.h to arch-directory, and move some functions from io.h to addrspace.h Olav Morken
2008-11-18 23:45 ` Wolfgang Denk
2008-10-10 13:15 ` [U-Boot] [PATCH 05/10] AVR32: macb - Disable 100mbps if clock is slow Olav Morken
2008-10-17 6:00 ` Ben Warren [this message]
2008-11-18 23:49 ` Wolfgang Denk
2008-11-18 23:48 ` Wolfgang Denk
2008-10-10 13:15 ` [U-Boot] [PATCH 06/10] AVR32: macb - Search for PHY id Olav Morken
2008-10-17 6:01 ` Ben Warren
2008-10-10 13:15 ` [U-Boot] [PATCH 07/10] AVR32: Disable relocation of command table when on AT32UC3A for now Olav Morken
2008-11-18 23:51 ` Wolfgang Denk
2008-11-19 13:07 ` Haavard Skinnemoen
2008-10-10 13:15 ` [U-Boot] [PATCH 08/10] AVR32: Must add NOPs after disabling interrupts for AT32UC3A0512ES Olav Morken
2008-10-10 13:15 ` [U-Boot] [PATCH 09/10] AVR32: CPU support for AT32UC3A0xxx CPUs Olav Morken
2008-10-17 6:01 ` Ben Warren
2008-10-17 9:05 ` Wolfgang Denk
2008-10-17 16:47 ` Ben Warren
2008-10-18 11:32 ` Haavard Skinnemoen
2008-10-19 2:44 ` Ben Warren
2008-10-23 12:52 ` Haavard Skinnemoen
2008-10-28 6:57 ` Ben Warren
2008-11-18 23:59 ` Wolfgang Denk
2008-11-19 13:44 ` Haavard Skinnemoen
2008-11-19 14:06 ` Haavard Skinnemoen
2008-10-10 13:15 ` [U-Boot] [PATCH 10/10] AVR32: Board support for ATEVK1100 Olav Morken
2008-11-19 0:02 ` Wolfgang Denk
2008-11-19 15:09 ` [U-Boot] [PATCH 00/10] AVR32: RFC/preview - support for ATEVK1100 evaluation board Haavard Skinnemoen
2008-11-19 15:35 ` Wolfgang Denk
2008-11-19 15:50 ` Haavard Skinnemoen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48F82A0C.9030505@gmail.com \
--to=biggerbadderben@gmail.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox