Skip to contentSkip to conversation

Raspberry Pi 4 VL805 firmware load

PATCH Superseded Nicolas Saenz Julienne 4 participants 13 messages Apr 28, 2020 – Apr 29, 2020

Subsystems (6)

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

cover Raspberry Pi 4 VL805 firmware load

Newer revisions of the RPi4 need their xHCI chip, VL805, firmware to be loaded explicitly. Earlier versions didn't need that as they where using an EEPROM for that purpose. This series takes care of setting up the relevant infrastructure and run the firmware loading routine at the right moment.

Patch 2 is a little invasive, but I couldn't find a mechanism in u-boot similar to Linux's PCI quirks.

Nicolas Saenz Julienne (2):
arm: rpi: Add function to trigger VL805's firmware load
usb: xhci: Load Raspberry Pi 4 VL805's firmware

 arch/arm/mach-bcm283x/include/mach/mbox.h | 13 +++++++
 arch/arm/mach-bcm283x/include/mach/msg.h  |  7 ++++
 arch/arm/mach-bcm283x/msg.c               | 41 +++++++++++++++++++++++
 drivers/usb/host/xhci-pci.c               |  6 ++++
 4 files changed, 67 insertions(+)
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/2 arm: rpi: Add function to trigger VL805's firmware load

On the Raspberry Pi 4, after a PCI reset, VL805's (a xHCI chip) firmware may either be loaded directly from an EEPROM or, if not present, by the SoC's VideCore (the SoC's co-processor). Introduce the function that informs VideCore that VL805 may need its firmware loaded.

---
 arch/arm/mach-bcm283x/include/mach/mbox.h | 13 +++++++
 arch/arm/mach-bcm283x/include/mach/msg.h  |  7 ++++
 arch/arm/mach-bcm283x/msg.c               | 41 +++++++++++++++++++++++
 3 files changed, 61 insertions(+)
arch/arm/mach-bcm283x/include/mach/mbox.h +13 -0
index 60e226ce1d..2ae2d3d97c 100644
@@ -491,6 +491,19 @@ struct bcm2835_mbox_tag_set_palette {
 	} body;
 };
 
+#define BCM2835_MBOX_TAG_NOTIFY_XHCI_RESET          0x00030058
+
+struct bcm2835_mbox_tag_pci_dev_addr {
+	struct bcm2835_mbox_tag_hdr tag_hdr;
+	union {
+		struct {
+			u32 dev_addr;
+		} req;
+		struct {
+		} resp;
+	} body;
+};
+
 /*
  * Pass a raw u32 message to the VC, and receive a raw u32 back.
  *
arch/arm/mach-bcm283x/include/mach/msg.h +7 -0
index 4afb08631b..c63fa4f6ee 100644
@@ -48,4 +48,11 @@ int bcm2835_set_video_params(int *widthp, int *heightp, int depth_bpp,
 			     int pixel_order, int alpha_mode, ulong *fb_basep,
 			     ulong *fb_sizep, int *pitchp);
 
+/**
+ * bcm2711_load_vl805_firmware() - get vl805's firmware loaded
+ *
+ * @return 0 if OK, -ve on error
+ */
+int bcm2711_load_vl805_firmware(void);
+
 #endif
arch/arm/mach-bcm283x/msg.c +41 -0

50 lines not on this page · raw message

Signature · 1 line
2.26.2
#2 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

In reply to Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +6 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
 			  struct xhci_hcor **ret_hcor)
 {
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
 	struct xhci_hcor *hcor;
 	u32 cmd;
 
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
 	hcor = (struct xhci_hcor *)((uintptr_t) hccr +
Signature · 1 line
2.26.2
#3 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 25 lines · Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +2 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
 			  struct xhci_hcor **ret_hcor)
 {

drivers/usb/host/xhci-pci.c static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr, · line 29

Quoted 10 lines
drivers/usb/host/xhci-pci.c +4 -0
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
 	struct xhci_hcor *hcor;
 	u32 cmd;
 
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
 	hcor = (struct xhci_hcor *)((uintptr_t) hccr +

I think socfpga arria10 has some firmware loader implementation that is generic, so can't we use that ?

#4 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 30 lines · Marek Vasut
Quoted 29 lines · Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +2 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
 			  struct xhci_hcor **ret_hcor)
 {
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct
 xhci_hccr **ret_hccr,
 	struct xhci_hcor *hcor;
 	u32 cmd;
 
Quoted 10 lines
Quoted 7 lines
drivers/usb/host/xhci-pci.c +4 -0
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);

hcor = (struct xhci_hcor *)((uintptr_t) hccr +

I think socfpga arria10 has some firmware loader implementation that is generic, so can't we use that ?

I don't think so. I've been told the firmware upgrade protocol is private and specific to the VL80X family of devices. The Raspberry Pi foundation decided to implement it in their closed source VideoCore firmware. All we have access to from arm is this mailbox interface where we just trigger the process.

Then there's an extra potential issue as it's the RPi4 co-processor firmware image that contains VL805's firmware. We'd had to somehow extract it from there every time they update it.

As a recap of what's happening here:
- arm configures PCI
- arm triggers VL805 firmware reload
- VideoCore somehow transfers firmware (trough PCI) into VL805 if no EEPROM present
- VL805 is up and running
- arm can carry on with xHCI init

Note that all this is only relevant if you have newer revision of the board. So most people will not need it right now. But as it becomes more widespread we'll start seeing complaints.

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200429/a05a0776/attachment.sig>

#5 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 42 lines · Nicolas Saenz Julienne
Quoted 30 lines · Marek Vasut
Quoted 29 lines · Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +2 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
 			  struct xhci_hcor **ret_hcor)
 {
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct
 xhci_hccr **ret_hccr,
 	struct xhci_hcor *hcor;
 	u32 cmd;
 
Quoted 10 lines
Quoted 7 lines
drivers/usb/host/xhci-pci.c +4 -0
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);

hcor = (struct xhci_hcor *)((uintptr_t) hccr +

I think socfpga arria10 has some firmware loader implementation that is generic, so can't we use that ?

Quoted 3 lines

I don't think so. I've been told the firmware upgrade protocol is private and specific to the VL80X family of devices. The Raspberry Pi foundation decided to implement it in their closed source VideoCore firmware.

What I meant was that U-Boot has a way to load files from various storage roughly the same way Linux firmware loader API does.

#6 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 44 lines · Marek Vasut
Quoted 43 lines · Nicolas Saenz Julienne
Quoted 41 lines · Marek Vasut
Quoted 36 lines · Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +2 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr
 **ret_hccr,
 			  struct xhci_hcor **ret_hcor)

{

drivers/usb/host/xhci-pci.c +4 -0
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct
 xhci_hccr **ret_hccr,
 	struct xhci_hcor *hcor;
 	u32 cmd;
 
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
Quoted 1 line

hcor = (struct xhci_hcor *)((uintptr_t) hccr +

I think socfpga arria10 has some firmware loader implementation that is generic, so can't we use that ?

Quoted 8 lines
Quoted 5 lines

I don't think so. I've been told the firmware upgrade protocol is private and
specific to the VL80X family of devices. The Raspberry Pi foundation decided to
implement it in their closed source VideoCore firmware.

What I meant was that U-Boot has a way to load files from various storage roughly the same way Linux firmware loader API does.

As far as generic APIs are concerned I've had a look at request_firmware_into_buf() which socfpga uses in its spl_board_init(). But sadly it doesn't help here.

What bcm2711_load_vl805_firmware() does here is just informing the co-processor that it's free to start the VL805 firmware load operation. I'm by no means providing anything, think of it as a doorbell if you will. I'll try to find an alternative to 'load' in the function name so the distinction with regular firmware loading is more explicit.

Also bare in mind we have to time this operation in between PCIe configuration and xHCI init. Which, IIUC, blocks us from using board_init() and the likes of it (which would be way nicer IMO).

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200429/cdd7e892/attachment.sig>

#7 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 58 lines · Nicolas Saenz Julienne
Quoted 44 lines · Marek Vasut
Quoted 43 lines · Nicolas Saenz Julienne
Quoted 41 lines · Marek Vasut
Quoted 36 lines · Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +2 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr
 **ret_hccr,
 			  struct xhci_hcor **ret_hcor)

{

drivers/usb/host/xhci-pci.c +4 -0
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct
 xhci_hccr **ret_hccr,
 	struct xhci_hcor *hcor;
 	u32 cmd;
 
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
Quoted 1 line

hcor = (struct xhci_hcor *)((uintptr_t) hccr +

I think socfpga arria10 has some firmware loader implementation that is generic, so can't we use that ?

Quoted 8 lines
Quoted 5 lines

I don't think so. I've been told the firmware upgrade protocol is private and
specific to the VL80X family of devices. The Raspberry Pi foundation decided to
implement it in their closed source VideoCore firmware.

What I meant was that U-Boot has a way to load files from various storage roughly the same way Linux firmware loader API does.

As far as generic APIs are concerned I've had a look at request_firmware_into_buf() which socfpga uses in its spl_board_init(). But sadly it doesn't help here.

Quoted 5 lines

What bcm2711_load_vl805_firmware() does here is just informing the co-processor that it's free to start the VL805 firmware load operation. I'm by no means providing anything, think of it as a doorbell if you will. I'll try to find an alternative to 'load' in the function name so the distinction with regular firmware loading is more explicit.

Oh, that's how it is, I see.

Quoted 3 lines

Also bare in mind we have to time this operation in between PCIe configuration and xHCI init. Which, IIUC, blocks us from using board_init() and the likes of it (which would be way nicer IMO).

Maybe you need some callback there ?

#8 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 77 lines · Marek Vasut
Quoted 66 lines · Nicolas Saenz Julienne
Quoted 58 lines · Marek Vasut
Quoted 49 lines · Nicolas Saenz Julienne
Quoted 36 lines · Marek Vasut
Quoted 35 lines · Nicolas Saenz Julienne

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.

---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/usb/host/xhci- renamed from drivers/usb/host/xhci-pci.c +0 -0

pci.c
index c1f60da541..5c17ea6932 100644

drivers/usb/host/xhci-pci.c +2 -0
@@ -11,6 +11,8 @@
 #include <usb.h>
 #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+
 static void xhci_pci_init(struct udevice *dev, struct xhci_hccr
 **ret_hccr,
 			  struct xhci_hcor **ret_hcor)

{

drivers/usb/host/xhci-pci.c +0 -0
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev,

struct
xhci_hccr **ret_hccr,

drivers/usb/host/xhci-pci.c +0 -0
 	struct xhci_hcor *hcor;
 	u32 cmd;
Quoted 11 lines

drivers/usb/host/xhci-pci.c static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr, · line 29

Quoted 7 lines
drivers/usb/host/xhci-pci.c +4 -0
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
 	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
 			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
 	hcor = (struct xhci_hcor *)((uintptr_t) hccr +

I think socfpga arria10 has some firmware loader implementation that is
generic, so can't we use that ?

Quoted 7 lines

I don't think so. I've been told the firmware upgrade protocol is private
and
specific to the VL80X family of devices. The Raspberry Pi foundation decided
to
implement it in their closed source VideoCore firmware.

Quoted 2 lines

What I meant was that U-Boot has a way to load files from various storage roughly the same way Linux firmware loader API does.

As far as generic APIs are concerned I've had a look at request_firmware_into_buf() which socfpga uses in its spl_board_init(). But sadly it doesn't help here.

Quoted 7 lines

What bcm2711_load_vl805_firmware() does here is just informing the co- processor
that it's free to start the VL805 firmware load operation. I'm by no means providing anything, think of it as a doorbell if you will. I'll try to find an
alternative to 'load' in the function name so the distinction with regular firmware loading is more explicit.

Oh, that's how it is, I see.

Quoted 7 lines
Quoted 5 lines

Also bare in mind we have to time this operation in between PCIe configuration
and xHCI init. Which, IIUC, blocks us from using board_init() and the likes of
it (which would be way nicer IMO).

Maybe you need some callback there ?

Indeed, in Linux I'm using PCI fixups. I guess I could create a similar concept, albeit simpler, that calls board specific code for fixups after scanning and detecting PCI devices. Or even simpler if we do it after PCI bus probes.

I'll look into it.

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200429/0c87afbe/attachment.sig>

#9 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

In reply to Nicolas Saenz Julienne

Hi Nicolas,

Quoted 16 lines · Nicolas Saenz Julienne

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.

---
  drivers/usb/host/xhci-pci.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +0 -0
index c1f60da541..5c17ea6932 100644

drivers/usb/host/xhci-pci.c line 15

Quoted 5 lines
drivers/usb/host/xhci-pci.c +2 -0
@@ -11,6 +11,8 @@
  #include <usb.h>
  #include <usb/xhci.h>
 
+#include <asm/arch/msg.h>
+

Does the above include works on the other archs?

Quoted 4 lines
drivers/usb/host/xhci-pci.c +0 -0
  static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
  			  struct xhci_hcor **ret_hcor)
  {

drivers/usb/host/xhci-pci.c static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr, · line 29

Quoted 10 lines
drivers/usb/host/xhci-pci.c +4 -0
@@ -18,6 +20,10 @@ static void xhci_pci_init(struct udevice *dev, struct xhci_hccr **ret_hccr,
  	struct xhci_hcor *hcor;
  	u32 cmd;
 
+#ifdef CONFIG_BCM2711
+	bcm2711_load_vl805_firmware();
+#endif
+
  	hccr = (struct xhci_hccr *)dm_pci_map_bar(dev,
  			PCI_BASE_ADDRESS_0, PCI_REGION_MEM);
  	hcor = (struct xhci_hcor *)((uintptr_t) hccr +

Best regards

Signature · 2 lines
Marek Szyprowski, PhD
Samsung R&D Institute Poland
#10 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Quoted 22 lines · Marek Szyprowski

Hi Nicolas,

Quoted 19 lines · Nicolas Saenz Julienne

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.

---
  drivers/usb/host/xhci-pci.c | 6 ++++++
  1 file changed, 6 insertions(+)
drivers/usb/host/xhci-pci.c +0 -0
index c1f60da541..5c17ea6932 100644
@@ -11,6 +11,8 @@
  #include <usb.h>
  #include <usb/xhci.h>
 
Quoted 4 lines

drivers/usb/host/xhci-pci.c line 15

Quoted 2 lines
drivers/usb/host/xhci-pci.c +2 -0
+#include <asm/arch/msg.h>
+

Does the above include works on the other archs?

It doesn't I should have enclosed it with '#ifdef CONFIG_BCM2711' as well.

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200429/0a596b50/attachment.sig>

#11 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

In reply to Nicolas Saenz Julienne

Hi Nicolas,

Quoted 7 lines · Nicolas Saenz Julienne

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.

I am a little bit confused. I thought we already solved the xHCI driver issuw on RPi4. What's this firmware used for?

Quoted 5 lines
---
 drivers/usb/host/xhci-pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

Regards,
Bin

#12 lore raw

PATCH 2/2 usb: xhci: Load Raspberry Pi 4 VL805's firmware

Hi Bin,

Quoted 11 lines · Bin Meng

Hi Nicolas,

Quoted 6 lines · Nicolas Saenz Julienne

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.

Quoted 2 lines

I am a little bit confused. I thought we already solved the xHCI driver issuw on RPi4. What's this firmware used for?

This is not related to the issues Sylwester fixed. It builds on it (I should have been more explicit in that regard). It relates to a design change the RPi foundation did on newer revisions of boards. VL805, the xHCI chip, needs its firmware loaded. On older revisions of the board -- the one most people have right now -- this is achieved using an EEPROM that is rooted directly into VL805. Newer board revisions removed the EEPROM and now let VideoCore (the board co-processor) take care of loading the firmware into the VL805 chip.

All we have left from arm's perspective is a mailbox interface to VideoCore, where we can trigger the VL805 firmware load. Which can only happen as long as we've have properly configured the PCI bus.

Regards,
Nicolas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200429/f6282a23/attachment.sig>