usb: xhci: Load Raspberry Pi 4 VL805's firmware
authorNicolas Saenz Julienne <nsaenzjulienne@suse.de>
Tue, 5 May 2020 16:26:07 +0000 (18:26 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 21 Oct 2020 10:30:57 +0000 (19:30 +0900)
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 <nsaenzjulienne@suse.de>
[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 <m.szyprowski@samsung.com>
Change-Id: I1391806cae261d1ce22137e1a8baf5e261cb865a

board/raspberrypi/rpi/rpi.c
drivers/usb/host/xhci-pci.c
include/usb/xhci.h

index a5bee9c334e22e236079d56ee947771a46276655..1203c0e56f87124a8c910c9cefab4f1834ad0a8e 100644 (file)
@@ -14,6 +14,7 @@
 #include <lcd.h>
 #include <memalign.h>
 #include <mmc.h>
+#include <usb/xhci.h>
 #include <asm/gpio.h>
 #include <asm/arch/mbox.h>
 #include <asm/arch/msg.h>
index 9fb6d2f763532bb17ce2e735dd972c74d20a178d..4438091ef98612aea6e0e3459abec55a12198716 100644 (file)
 #include <usb.h>
 #include <usb/xhci.h>
 
+__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);
index 7d34103fd5ca147083cab16d0876dd5803bfe22c..75b374cbf48d896f5f29fe63f955a4c294df4e33 100644 (file)
@@ -17,6 +17,7 @@
 #define HOST_XHCI_H_
 
 #include <reset.h>
+#include <usb.h>
 #include <asm/types.h>
 #include <asm/cache.h>
 #include <asm/io.h>
@@ -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_ */