From 50c1f27069535beedc6ee36232a3ebab35b5c625 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Fri, 1 May 2020 14:56:49 -0700 Subject: 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 Change-Id: I14293e2135108db30ba6fd2efea0573fe266fa37 Reviewed-on: https://review.coreboot.org/c/coreboot/+/40956 Tested-by: build bot (Jenkins) Reviewed-by: Duncan Laurie Reviewed-by: Nico Huber --- payloads/libpayload/drivers/usb/xhci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'payloads/libpayload/drivers/usb') 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; -- cgit v1.2.3