usb_hub_power_on() currently waits for the maximum of (a) the hub port's
power output to become good, (b) the max time the USB specification
allows a device to take to connect.
However, these two operations must occur in series rather than in
parallel. First, the power supply ramps up to the level required to
power the USB device, and then the device may take a certain amount of
time to connect (assert D+/D- pullups).
Related, the maximum time that a device has to assert pullups is 1s not
100ms.
This is explained in "Connect Timing ECN.pdf", itself part of
usb_20_042814.zip from www.usb.org.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
#endif
#ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY
-#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 100
+#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 1000
#endif
#define USB_BUFSIZ 512
debug("port %d returns %lX\n", i + 1, dev->status);
}
- /* Wait for power to become stable */
- mdelay(max(pgood_delay, CONFIG_USB_HUB_MIN_POWER_ON_DELAY));
+ /*
+ * Wait for power to become stable,
+ * plus spec-defined max time for device to connect
+ */
+ mdelay(pgood_delay + CONFIG_USB_HUB_MIN_POWER_ON_DELAY);
}
void usb_hub_reset(void)