[U-Boot] [PATCH] common: usb: Adding delay after set configuration to support legacy devices

Sriram Dash sriram.dash at freescale.com
Thu Dec 17 10:21:37 CET 2015


We faced random enumeration failure issue for USB sticks on XHCI driver,
specifically the legacy i.e. USB 2.0 storage devices. It seems they do not
respond to a USB string descriptor submission within the allowed U-Boot
timeout, which is just after sending set configuration.

USB stick where this this problem has been noticed are:
SanDisk U3 Cruzer Micro 0875530C9FC38749 (Vendor: 0x0781, Product 0x5406)

This problem has been reproduced on the Freescale LS2080A, and expected to be
hit for any platform with XHCI controller using legacy USB 2.0 devices.

This patch solves the above problem by:
Adding 10 ms delay after set configuration and let the device to settle down

Signed-off-by: Sriram Dash <sriram.dash at freescale.com>
Signed-off-by: Rajesh Bhagat <rajesh.bhagat at freescale.com>
---
 common/usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/usb.c b/common/usb.c
index 700bfc3..c624a88 100644
--- a/common/usb.c
+++ b/common/usb.c
@@ -1104,6 +1104,7 @@ int usb_select_config(struct usb_device *dev)
 			"len %d, status %lX\n", dev->act_len, dev->status);
 		return err;
 	}
+	mdelay(10);     /* Let the SET_CONFIGURATION settle */
 	debug("new device strings: Mfr=%d, Product=%d, SerialNumber=%d\n",
 	      dev->descriptor.iManufacturer, dev->descriptor.iProduct,
 	      dev->descriptor.iSerialNumber);
-- 
2.1.0



More information about the U-Boot mailing list