The newer hardware revisions of the Raspberry Pi 4 removed the ability of the VIA VL805 xhci controller to load its own firmware. Instead the firmware must be installed at the appropriate time by the VideoCore coprocessor. This differential builds on top of D25068.
- rS363795: Handle Raspberry Pi 4 xhci firmware loading.
Tested with new and old firmware, on several different Pi4s.
There is a device tree node, but it's disabled and in any case we do not use it. The controller is discovered through ordinary enumeration of the PCI bus, both on Linux and in the driver I wrote.
The intention of the device tree inspection here is so I can check if the computer is a Raspberry Pi 4. The VIA controller is a commodity controller, but this quirk where the Pi Foundation removed the firmware EEPROM is limited to the Pi SBC.
I tried this on my Raspberry Pi 4 & got the following error.
xhci0: <VL805 USB 3.0 controller (on the Raspberry Pi 4b)> irq 78 at device 0.0 on pci1 mbox0: mbox response error xhci0: warning: xhci firmware install failed (error 5). xhci0: 32 bytes context size, 64-bit DMA
This device has no node associated with it do the call to ofw_bus_status_okay will call ofw_bus_get_status that returns NULL so we return a status of 'ok'.
You should place the variable decorations at the start of the function.
I thunk you can use ofw_bus_is_compatible here.
Remove the above driver_t & replace it with the DEFINE_CLASS_0 version. They are equivalent, other than the variable name.