summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/usb
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2019-06-21 16:39:59 -0600
committerDuncan Laurie <dlaurie@chromium.org>2019-07-02 17:42:18 +0000
commitbf2c693f893ab6f9458f1a4840c2a9cbbd4bb9f2 (patch)
tree683f50da6fbdf15a63d08de54b5a7714ff8e310c /payloads/libpayload/include/usb
parent9d0b7b902106e898d44f2bfc9b944a2e0c9a4f27 (diff)
downloadcoreboot-bf2c693f893ab6f9458f1a4840c2a9cbbd4bb9f2.tar.xz
libpayload/usb: Increase USB request timeout to 5 s
Increase the timeout for USB requests to 5 seconds for all USB host controllers. Prior to this fix, the xCHI driver was detecting false timeouts during SET ADDRESS requests when nested downstream hubs were connected to the xHCI root hub. BUG=b:124730179 BRANCH=sarien TEST=Build libpayload and depthcharge on sarien/arcada. TEST=Without change replicate USB set address timeouts in depthcharge when dock and 4K monitor connected (which includes a total of 4 USB hubs). With timeout fix, depthcharge boots OS with no USB errors and the same USB topology. Note that this tests xHCI operation only. Change-Id: I53e3e67d893420e7c9e8b52c47dd0edb979e5468 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/33671 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'payloads/libpayload/include/usb')
-rw-r--r--payloads/libpayload/include/usb/usb.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/payloads/libpayload/include/usb/usb.h b/payloads/libpayload/include/usb/usb.h
index 79c4586c4a..db7ec57d57 100644
--- a/payloads/libpayload/include/usb/usb.h
+++ b/payloads/libpayload/include/usb/usb.h
@@ -71,6 +71,24 @@ typedef enum {
/* SetAddress() recovery interval (USB 2.0 specification 9.2.6.3 */
#define SET_ADDRESS_MDELAY 2
+/*
+ * USB sets an upper limit of 5 seconds for any transfer to be completed.
+ *
+ * Data originally from EHCI driver:
+ * Tested with some USB2.0 flash sticks:
+ * TUR turn around took about 2.2s for the slowest (13fe:3800), maximum
+ * of 250ms for the others.
+ *
+ * SET ADDRESS on xHCI controllers.
+ * The USB specification indicates that devices must complete processing
+ * of a SET ADDRESS request within 50 ms. However, some hubs were found
+ * to take more than 100 ms to complete a SET ADDRESS request on a
+ * downstream port.
+ */
+#define USB_MAX_PROCESSING_TIME_US (5 * 1000 * 1000)
+
+#define USB_FULL_LOW_SPEED_FRAME_US 1000
+
typedef struct {
unsigned char bDescLength;
unsigned char bDescriptorType;