Hello Duncan Laurie,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/40956
to review the following change.
Change subject: libpayload: xhci: Fix CAPREG address calculation ......................................................................
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 --- M payloads/libpayload/drivers/usb/xhci.c 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/56/40956/1
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c index ef1d73f..9d721d9 100644 --- a/payloads/libpayload/drivers/usb/xhci.c +++ b/payloads/libpayload/drivers/usb/xhci.c @@ -185,7 +185,7 @@ 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;