From c3d57c4a00cf39aa885aa65a26eb4aa984b7f0fd Mon Sep 17 00:00:00 2001 From: Nicolas Saenz Julienne Date: Tue, 5 May 2020 18:26:07 +0200 Subject: [PATCH] usb: xhci: Load Raspberry Pi 4 VL805's firmware When needed, RPi4's co-processor (called VideoCore) has to be instructed to load VL805's firmware (the chip providing xHCI support). VideCore's firmware expects the board's PCIe bus to be already configured in order for it to load the xHCI chip firmware. So we have to make sure this happens in between the PCIe configuration and xHCI startup. Introduce a callback in xhci_pci_probe() to run this platform specific routine. Signed-off-by: Nicolas Saenz Julienne [mszyprow: backport of https://patchwork.ozlabs.org/project/uboot/list/?series=174860&state=%2A&archive=both the final mainline patch depends on DTS changes not present in vendor tree] Signed-off-by: Marek Szyprowski Change-Id: I1391806cae261d1ce22137e1a8baf5e261cb865a --- board/raspberrypi/rpi/rpi.c | 1 + drivers/usb/host/xhci-pci.c | 6 ++++++ include/usb/xhci.h | 3 +++ 3 files changed, 10 insertions(+) diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c index a5bee9c..1203c0e 100644 --- a/board/raspberrypi/rpi/rpi.c +++ b/board/raspberrypi/rpi/rpi.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 9fb6d2f..4438091 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -13,6 +13,10 @@ #include #include +__weak void xhci_pci_fixup(struct udevice *dev) +{ +} + static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr, struct xhci_hcor **ret_hcor) { @@ -42,6 +46,8 @@ static int xhci_pci_probe(struct udevice *dev) struct xhci_hccr *hccr; struct xhci_hcor *hcor; + xhci_pci_fixup(dev); + xhci_pci_init(dev, &hccr, &hcor); return xhci_register(dev, hccr, hcor); diff --git a/include/usb/xhci.h b/include/usb/xhci.h index 7d34103..75b374c 100644 --- a/include/usb/xhci.h +++ b/include/usb/xhci.h @@ -17,6 +17,7 @@ #define HOST_XHCI_H_ #include +#include #include #include #include @@ -1286,4 +1287,6 @@ extern struct dm_usb_ops xhci_usb_ops; struct xhci_ctrl *xhci_get_ctrl(struct usb_device *udev); +extern void xhci_pci_fixup(struct udevice *dev); + #endif /* HOST_XHCI_H_ */ -- 2.7.4