From: Wolfgang Grandegger <w...@denx.de>

Following the corresponding Linux code, this patch relaxes reset timings
waiting at least 100ms after power to the ports. There are some reports
that it helps make enumeration work better on some high speed devices.
Furthermore, the wait is only done once after power has been enabled
on all ports.

CC: Remy Bohmer <li...@bohmer.net>
CC: Vincent Palatin <vpala...@chromium.org>
Signed-off-by: Wolfgang Grandegger <w...@denx.de>
---
 common/usb.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/common/usb.c b/common/usb.c
index 63a11c8..d13dab8 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -1035,6 +1035,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 {
        int i;
        struct usb_device *dev;
+       unsigned pgood_delay = hub->desc.bPwrOn2PwrGood * 2;
 
        dev = hub->pusb_dev;
        /* Enable power to the ports */
@@ -1042,8 +1043,10 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
        for (i = 0; i < dev->maxchild; i++) {
                usb_set_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
                USB_HUB_PRINTF("port %d returns %lX\n", i + 1, dev->status);
-               wait_ms(hub->desc.bPwrOn2PwrGood * 2);
        }
+
+       /* Wait at least 100 msec for power to become stable */
+       wait_ms(max(pgood_delay, (unsigned)100));
 }
 
 void usb_hub_reset(void)
-- 
1.7.6.4

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Reply via email to