[U-Boot] [PATCH] usb: hub: Increase the query delay

Marek Vasut marex at denx.de
Wed May 4 23:32:50 CEST 2016


Increase the query delay, otherwise some sticks are not detected.
The problem shows up on the USB bus analyzer such that the stick
takes longer time to switch from FS mode to HS mode than the code
allows when the controller starts from completely off state.

Signed-off-by: Marek Vasut <marex at denx.de>
Cc: Chin Liang See <clsee at altera.com>
Cc: Dinh Nguyen <dinguyen at opensource.altera.com>
Cc: Hans de Goede <hdegoede at redhat.com>
Cc: Stefan Roese <sr at denx.de>
Cc: Stephen Warren <swarren at nvidia.com>
---
V2: Special-case this only for DWC2
---
 common/usb_hub.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/common/usb_hub.c b/common/usb_hub.c
index 0f39c9f..4795ea1 100644
--- a/common/usb_hub.c
+++ b/common/usb_hub.c
@@ -144,8 +144,14 @@ static void usb_hub_power_on(struct usb_hub_device *hub)
 	/*
 	 * Do a minimum delay of the larger value of 100ms or pgood_delay
 	 * so that the power can stablize before the devices are queried
+	 * DWC2 (and possibly others?) needs longer time to stabilize when
+	 * coming out of cold start. 1 second seems to work reliably.
 	 */
+#ifdef CONFIG_USB_DWC2
+	hub->query_delay = get_timer(0) + max(1000, (int)pgood_delay);
+#else
 	hub->query_delay = get_timer(0) + max(100, (int)pgood_delay);
+#endif
 
 	/*
 	 * Record the power-on timeout here. The max. delay (timeout)
-- 
2.7.0



More information about the U-Boot mailing list