From e00ba2168bf9e61535b83ab4320364fa8e26910c Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 24 Sep 2013 20:03:54 -0700 Subject: libpayload: usb: Unify USB speed between XHCI stack and USB core This patch removes the confusing concept of a special "xhci_speed" with a different numeric value from the usual speed used throughout the USB core (except for the places directly interacting with the xHC, which are explicitly marked). It also moves the MPS0 decoding function into the core and moves some definitions around in preparation of later changes that will make the stack SuperSpeed-ready. It makes both set_address implementations share a constant for the specification-defined SetAddress() recovery delay and removes pointless additional delays from the non-XHCI version. Change-Id: I422379d05d4a502b12dae183504e5231add5466a Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/170664 Reviewed-by: Stefan Reinauer Commit-Queue: Ronald Minnich (cherry picked from commit f160d4439c0d7cea1d2e6b97207935d61dcbb2f2) Signed-off-by: Isaac Christensen Reviewed-on: http://review.coreboot.org/6776 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- payloads/libpayload/drivers/usb/usbhub.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'payloads/libpayload/drivers/usb/usbhub.c') diff --git a/payloads/libpayload/drivers/usb/usbhub.c b/payloads/libpayload/drivers/usb/usbhub.c index ff7904cbd0..503a9a8528 100644 --- a/payloads/libpayload/drivers/usb/usbhub.c +++ b/payloads/libpayload/drivers/usb/usbhub.c @@ -77,7 +77,7 @@ usb_hub_port_enabled(usbdev_t *const dev, const int port) return (buf[0] & PORT_ENABLE) != 0; } -static int +static usb_speed usb_hub_port_speed(usbdev_t *const dev, const int port) { unsigned short buf[2] = { 0, 0 }; @@ -87,6 +87,7 @@ usb_hub_port_speed(usbdev_t *const dev, const int port) * 0 0 full speed * 0 1 low speed * 1 0 high speed + * 1 1 super speed (hack, not in spec!) */ return (buf[0] >> 9) & 0x3; } else { -- cgit v1.2.3