summaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/usb/usbhub.c
diff options
context:
space:
mode:
authorEric Lai <ericr_lai@compal.corp-partner.google.com>2019-08-22 12:41:12 +0800
committerPatrick Georgi <pgeorgi@google.com>2019-08-27 07:21:00 +0000
commitda10b9224aaa0c41571b5c0c7017b75d4343ebe4 (patch)
tree5a4fabc348f14f2424da214cf0e747d36ac7bb04 /payloads/libpayload/drivers/usb/usbhub.c
parent1458777c3ba714b9f62799f8cf4bbbf2e82b9d75 (diff)
libpayload/usb: add USB 3.1 GEN2 support
USB 3.1 GEN2 report speed type 4, add into speed enum. BUG=b:139787920 BRANCH=N/A TEST=Build libpayload and depthcharge on sarien and boot with USB GEN2 HUB with USB disk. Check ultra speed device in cbmem log. Signed-off-by: Eric Lai <ericr_lai@compal.corp-partner.google.com> Change-Id: Ia0ef12b2f0d91bf0d0db766bbc9019de1614a4f4 Reviewed-on: https://review.coreboot.org/c/coreboot/+/35023 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads/libpayload/drivers/usb/usbhub.c')
-rw-r--r--payloads/libpayload/drivers/usb/usbhub.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/payloads/libpayload/drivers/usb/usbhub.c b/payloads/libpayload/drivers/usb/usbhub.c
index 340e47ae3d..78643c0e70 100644
--- a/payloads/libpayload/drivers/usb/usbhub.c
+++ b/payloads/libpayload/drivers/usb/usbhub.c
@@ -96,8 +96,8 @@ usb_hub_port_speed(usbdev_t *const dev, const int port)
int ret = get_status (dev, port, DR_PORT, sizeof(buf), buf);
if (ret >= 0 && (buf[0] & PORT_ENABLE)) {
/* SuperSpeed hubs can only have SuperSpeed devices. */
- if (dev->speed == SUPER_SPEED)
- return SUPER_SPEED;
+ if (is_usb_speed_ss(dev->speed))
+ return dev->speed;
/*[bit] 10 9 (USB 2.0 port status word)
* 0 0 full speed
@@ -176,7 +176,7 @@ usb_hub_port_initialize(usbdev_t *const dev, const int port)
void
usb_hub_init(usbdev_t *const dev)
{
- int type = dev->speed == SUPER_SPEED ? 0x2a : 0x29; /* similar enough */
+ int type = is_usb_speed_ss(dev->speed) ? 0x2a : 0x29; /* similar enough */
hub_descriptor_t desc; /* won't fit the whole thing, we don't care */
if (get_descriptor(dev, gen_bmRequestType(device_to_host, class_type,
dev_recp), type, 0, &desc, sizeof(desc)) != sizeof(desc)) {
@@ -185,7 +185,7 @@ usb_hub_init(usbdev_t *const dev)
return;
}
- if (dev->speed == SUPER_SPEED)
+ if (is_usb_speed_ss(dev->speed))
usb_hub_set_hub_depth(dev);
if (generic_hub_init(dev, desc.bNbrPorts, &usb_hub_ops) < 0)
return;