Page MenuHomeFreeBSD

Handle Raspberry Pi 4 xhci firmware loading.

Authored by on Jun 14 2020, 12:22 AM.
Referenced Files
Unknown Object (File)
Sat, Jul 13, 1:57 AM
Unknown Object (File)
Mon, Jul 8, 8:25 AM
Unknown Object (File)
Mon, Jul 8, 12:57 AM
Unknown Object (File)
Fri, Jun 28, 8:32 AM
Unknown Object (File)
Wed, Jun 19, 10:12 PM
Unknown Object (File)
Jun 14 2024, 7:00 AM
Unknown Object (File)
Jun 11 2024, 8:04 AM
Unknown Object (File)
Jun 11 2024, 8:04 AM


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

This differential builds on top of D25068.
Test Plan

Tested with new and old firmware, on several different Pi4s.

Diff Detail

rS FreeBSD src repository - subversion
Lint Not Applicable
Tests Not Applicable

Event Timeline edited the test plan for this revision. (Show Details) edited the summary of this revision. (Show Details)
86–87 ↗(On Diff #73087)

Is this correct? There is a device tree node for the XHCI device?

86–87 ↗(On Diff #73087)

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.

Add additional comments to explain the probe.

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
94 ↗(On Diff #74170)

You should place the variable decorations at the start of the function.

98 ↗(On Diff #74170)

I thunk you can use ofw_bus_is_compatible here.

86–87 ↗(On Diff #73087)

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'.

88–89 ↗(On Diff #74170)

Remove the above driver_t & replace it with the DEFINE_CLASS_0 version. They are equivalent, other than the variable name.

98 ↗(On Diff #74170)

What's the advantage of using ofw_bus_is_compatible? I would have to discover the right device_t for the "/" device.

98 ↗(On Diff #74170)

Sorry, that should be ofw_bus_node_is_compatible. fdt_is_compatible_strict should be removed as it's redundant given we have ofw_ versions.

This revision was not accepted when it landed; it landed in state Needs Review.Aug 3 2020, 10:20 AM
This revision was automatically updated to reflect the committed changes.