aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/drivers/usb/xhci_rh.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2020-03-17 19:32:14 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-04-14 09:47:22 +0000
commit287cf6c7d101d98cdbba8926651d87945534b7d9 (patch)
treed584740b961638cd4c052eef3ed1c1d283400dc6 /payloads/libpayload/drivers/usb/xhci_rh.c
parentbc885c194c0175b7a3ac9442cf9c82a0fa28ac2a (diff)
lp/drivers/usb: Work around QEMU XHCI register issue
The QEMU XHCI controller does not support byte/word reads from the capability register and it expects dword reads only. In order to make this work move the access of the capability register fields to use macros instead of a packed struct bitfield. This issue was filed upstream: https://bugs.launchpad.net/qemu/+bug/1693050 The original fix attempt in 2012 was not effective: https://github.com/qemu/qemu/commit/6ee021d41078844df60a3a466e3829a3e82776f3 With this change the controller is detected properly by the libpayload USB drivers. Change-Id: I048ed14921a4c9c0620c10b315b42476b6e5c512 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/39838 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'payloads/libpayload/drivers/usb/xhci_rh.c')
-rw-r--r--payloads/libpayload/drivers/usb/xhci_rh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/usb/xhci_rh.c b/payloads/libpayload/drivers/usb/xhci_rh.c
index 453fa5b409..865b9ac18b 100644
--- a/payloads/libpayload/drivers/usb/xhci_rh.c
+++ b/payloads/libpayload/drivers/usb/xhci_rh.c
@@ -160,7 +160,7 @@ xhci_rh_init (usbdev_t *dev)
dev->port = -1;
const int num_ports = /* TODO: maybe we need to read extended caps */
- (XHCI_INST(dev->controller)->capreg->hcsparams1 >> 24) & 0xff;
+ CAP_GET(MAXPORTS, XHCI_INST(dev->controller)->capreg);
generic_hub_init(dev, num_ports, &xhci_rh_ops);
usb_debug("xHCI: root hub init done\n");