mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
net: macb: Add small delay after link establishment
I've noticed that the first ethernet packet after PHY link establishment is not tranferred correctly most of the time on my AT91SAM9G25 board. Here I usually see a timeout of a few seconds, which is quite annoying. Adding a small delay (10ms in this case) after the link establishment helps to solve this problem. With this patch applied, this timeout on the first packet is not seen any more. Signed-off-by: Stefan Roese <sr@denx.de> Cc: Wenyou Yang <wenyou.yang@atmel.com> Cc: Eugen Hristev <eugen.hristev@microchip.com> Cc: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
This commit is contained in:
parent
068d4c0a11
commit
7bf9bca7c0
1 changed files with 7 additions and 1 deletions
|
@ -550,8 +550,14 @@ static int macb_phy_init(struct macb_device *macb, const char *name)
|
|||
|
||||
for (i = 0; i < MACB_AUTONEG_TIMEOUT / 100; i++) {
|
||||
status = macb_mdio_read(macb, MII_BMSR);
|
||||
if (status & BMSR_LSTATUS)
|
||||
if (status & BMSR_LSTATUS) {
|
||||
/*
|
||||
* Delay a bit after the link is established,
|
||||
* so that the next xfer does not fail
|
||||
*/
|
||||
mdelay(10);
|
||||
break;
|
||||
}
|
||||
udelay(100);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue