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;
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40956 )
Change subject: libpayload: xhci: Fix CAPREG address calculation ......................................................................
Patch Set 1: Code-Review+2
Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40956 )
Change subject: libpayload: xhci: Fix CAPREG address calculation ......................................................................
Patch Set 1: Code-Review+2
Julius Werner has submitted this change. ( https://review.coreboot.org/c/coreboot/+/40956 )
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 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 --- M payloads/libpayload/drivers/usb/xhci.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Nico Huber: Looks good to me, approved
diff --git a/payloads/libpayload/drivers/usb/xhci.c b/payloads/libpayload/drivers/usb/xhci.c index 21af579..08a81ef 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;
9elements QA has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/40956 )
Change subject: libpayload: xhci: Fix CAPREG address calculation ......................................................................
Patch Set 2:
Automatic boot test returned (PASS/FAIL/TOTAL): 4/0/4 Emulation targets: "QEMU x86 q35/ich9" using payload TianoCore : SUCCESS : https://lava.9esec.io/r/3100 "QEMU x86 q35/ich9" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3099 "QEMU x86 i440fx/piix4" using payload SeaBIOS : SUCCESS : https://lava.9esec.io/r/3098 "QEMU AArch64" using payload LinuxBoot_u-root_kexec : SUCCESS : https://lava.9esec.io/r/3097
Please note: This test is under development and might not be accurate at all!