]> git.sur5r.net Git - u-boot/commitdiff
usb: hub: make minimum power-on delay configurable
authorKuo-Jung Su <dantesu@faraday-tech.com>
Wed, 15 May 2013 07:29:22 +0000 (15:29 +0800)
committerMarek Vasut <marex@denx.de>
Wed, 12 Jun 2013 20:22:51 +0000 (22:22 +0200)
This patch makes the minimum power-on delay for USB HUB
become configurable. The original design waits at least
100 msec here, but some EHCI controlers(e.g. Faraday EHCI)
are known to require much longer delay interval.

Signed-off-by: Kuo-Jung Su <dantesu@faraday-tech.com>
CC: Marek Vasut <marex@denx.de>
README
common/usb_hub.c

diff --git a/README b/README
index 33bda8c929e1e4e35451b399cf9ca353d6a167a9..ac1ec44d155b06620303a6ccf7672fd2f15e5201 100644 (file)
--- a/README
+++ b/README
@@ -1261,6 +1261,9 @@ The following options need to be configured:
                CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the
                txfilltuning field in the EHCI controller on reset.
 
+               CONFIG_USB_HUB_MIN_POWER_ON_DELAY defines the minimum
+               interval for usb hub power-on delay.(minimum 100msec)
+
 - USB Device:
                Define the below if you wish to use the USB console.
                Once firmware is rebuilt from a serial console issue the
index 0d79ec3ea84abfc8d61988cbfc30c8ba17cec60e..fc3a8c177099cf6766d050c9d6eca106552802b7 100644 (file)
 #include <asm/4xx_pci.h>
 #endif
 
+#ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY
+#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY      100
+#endif
+
 #define USB_BUFSIZ     512
 
 static struct usb_hub_device hub_dev[USB_MAX_HUB];
@@ -148,8 +152,8 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
                debug("port %d returns %lX\n", i + 1, dev->status);
        }
 
-       /* Wait at least 100 msec for power to become stable */
-       mdelay(max(pgood_delay, (unsigned)100));
+       /* Wait for power to become stable */
+       mdelay(max(pgood_delay, CONFIG_USB_HUB_MIN_POWER_ON_DELAY));
 }
 
 void usb_hub_reset(void)