summaryrefslogtreecommitdiff
path: root/recipes-bsp/u-boot/u-boot-2012.10/u-boot-2010.06-macb-autoneg-timeout.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-bsp/u-boot/u-boot-2012.10/u-boot-2010.06-macb-autoneg-timeout.patch')
-rw-r--r--recipes-bsp/u-boot/u-boot-2012.10/u-boot-2010.06-macb-autoneg-timeout.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/recipes-bsp/u-boot/u-boot-2012.10/u-boot-2010.06-macb-autoneg-timeout.patch b/recipes-bsp/u-boot/u-boot-2012.10/u-boot-2010.06-macb-autoneg-timeout.patch
new file mode 100644
index 0000000..5294b1a
--- /dev/null
+++ b/recipes-bsp/u-boot/u-boot-2012.10/u-boot-2010.06-macb-autoneg-timeout.patch
@@ -0,0 +1,53 @@
+Index: u-boot-2010.06/drivers/net/macb.c
+===================================================================
+--- u-boot-2010.06.orig/drivers/net/macb.c 2013-01-04 16:57:21.460051123 -0600
++++ u-boot-2010.06/drivers/net/macb.c 2013-01-04 17:03:28.880052058 -0600
+@@ -57,7 +57,7 @@
+ #define CONFIG_SYS_MACB_RX_RING_SIZE (CONFIG_SYS_MACB_RX_BUFFER_SIZE / 128)
+ #define CONFIG_SYS_MACB_TX_RING_SIZE 16
+ #define CONFIG_SYS_MACB_TX_TIMEOUT 1000
+-#define CONFIG_SYS_MACB_AUTONEG_TIMEOUT 5000000
++#define CONFIG_SYS_MACB_AUTONEG_TIMEOUT 3000000
+
+ struct macb_dma_desc {
+ u32 addr;
+@@ -322,11 +322,12 @@
+ return 0;
+ }
+
+-static void macb_phy_reset(struct macb_device *macb)
++static u16 macb_phy_reset(struct macb_device *macb)
+ {
+ struct eth_device *netdev = &macb->netdev;
+ int i;
+- u16 status, adv;
++ u16 status = 0;
++ u16 adv;
+
+ adv = ADVERTISE_CSMA | ADVERTISE_ALL;
+ macb_mdio_write(macb, MII_ADVERTISE, adv);
+@@ -346,6 +347,8 @@
+ else
+ printf("%s: Autonegotiation timed out (status=0x%04x)\n",
+ netdev->name, status);
++
++ return status;
+ }
+
+ #ifdef CONFIG_MACB_SEARCH_PHY
+@@ -397,14 +400,7 @@
+ status = macb_mdio_read(macb, MII_BMSR);
+ if (!(status & BMSR_LSTATUS)) {
+ /* Try to re-negotiate if we don't have link already. */
+- macb_phy_reset(macb);
+-
+- for (i = 0; i < CONFIG_SYS_MACB_AUTONEG_TIMEOUT / 100; i++) {
+- status = macb_mdio_read(macb, MII_BMSR);
+- if (status & BMSR_LSTATUS)
+- break;
+- udelay(100);
+- }
++ status = macb_phy_reset(macb);
+ }
+
+ if (!(status & BMSR_LSTATUS)) {