summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-05-01 14:56:49 -0700
committerJulius Werner <jwerner@chromium.org>2020-05-02 01:51:22 +0000
commit50c1f27069535beedc6ee36232a3ebab35b5c625 (patch)
tree9a181c851d0b1cdf13defbd6bde4403767670b69 /payloads
parent806ea463dbc20c9a577923af51e9976baaf6790a (diff)
libpayload: xhci: Fix CAPREG address calculation
I rushed CB:40895 in to fix a bug only to introduce another. xhci_init() no longer crashes, but it doesn't correctly initialize the XHCI controller either, and unfortunately the error messages are all hidden behind USB_DEBUG. This patch fixes the incorrect address calculation to what it was before CB:39838. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I14293e2135108db30ba6fd2efea0573fe266fa37 Reviewed-on: https://review.coreboot.org/c/coreboot/+/40956 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/drivers/usb/xhci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c
index 21af579f4c..08a81ef5d5 100644
--- a/payloads/libpayload/drivers/usb/xhci.c
+++ b/payloads/libpayload/drivers/usb/xhci.c
@@ -185,7 +185,7 @@ xhci_init (unsigned long physical_bar)
goto _free_xhci;
}
- xhci->capreg = phys_to_virt(physical_bar) + sizeof(xhci->capreg);
+ xhci->capreg = phys_to_virt(physical_bar);
xhci->opreg = phys_to_virt(physical_bar) + CAP_GET(CAPLEN, xhci->capreg);
xhci->hcrreg = phys_to_virt(physical_bar) + xhci->capreg->rtsoff;
xhci->dbreg = phys_to_virt(physical_bar) + xhci->capreg->dboff;