diff options
author | Wolfgang Grandegger <wg@denx.de> | 2011-12-21 00:01:09 +0000 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2012-03-03 16:56:35 +0100 |
commit | a1a28c6e64b9a6b0b911d066c627bc77f52179fb (patch) | |
tree | 9f5b449928c311c6c33a2ba56ace1561e1db1775 /common | |
parent | f9636e8d38abde096fbb32fee5a36bbdb02b7cae (diff) | |
download | u-boot-imx-a1a28c6e64b9a6b0b911d066c627bc77f52179fb.zip u-boot-imx-a1a28c6e64b9a6b0b911d066c627bc77f52179fb.tar.gz u-boot-imx-a1a28c6e64b9a6b0b911d066c627bc77f52179fb.tar.bz2 |
USB: relax usbcore reset timings
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 <linux@bohmer.net>
CC: Vincent Palatin <vpalatin@chromium.org>
Signed-off-by: Wolfgang Grandegger <wg@denx.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/usb_hub.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c index 576e0e6..84d0d3f 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -109,6 +109,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 */ @@ -116,8 +117,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) |