diff options
author | Tim Harvey <tharvey@gateworks.com> | 2015-04-08 12:21:12 -0700 |
---|---|---|
committer | Marek Vasut <marex@denx.de> | 2015-04-14 05:47:48 +0200 |
commit | 319418c01c95f3c6a0d37a4d82740b437aa23b0e (patch) | |
tree | 0f483d78cf7f1536a343d91196bca2cbb807fc30 /common/usb_hub.c | |
parent | 25c0673635da1bef75ab5a9d852f92e0f0b581df (diff) | |
download | u-boot-319418c01c95f3c6a0d37a4d82740b437aa23b0e.tar.gz |
usb: hub: allow pgood_delay to be specified via env
Some USB devices break the spec and require longer warm-up times. Allow
the usb_pgood_delay env variable to override the calculated time.
Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'common/usb_hub.c')
-rw-r--r-- | common/usb_hub.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/common/usb_hub.c b/common/usb_hub.c index 66b4a725d1..f54a404a49 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -86,6 +86,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; + const char *env; dev = hub->pusb_dev; @@ -98,7 +99,14 @@ static void usb_hub_power_on(struct usb_hub_device *hub) /* * Wait for power to become stable, * plus spec-defined max time for device to connect + * but allow this time to be increased via env variable as some + * devices break the spec and require longer warm-up times */ + env = getenv("usb_pgood_delay"); + if (env) + pgood_delay = max(pgood_delay, + (unsigned)simple_strtol(env, NULL, 0)); + debug("pgood_delay=%dms\n", pgood_delay); mdelay(pgood_delay + 1000); } |