Report: FreeBSD on Rpi4 8 GB model

Robert Crowston crowston at protonmail.com
Tue Jun 9 23:16:49 UTC 2020


I figured out how to start the xhci driver.

The snag is, it seems the message to the VC to reinstall the xhci firmware has to be delivered *after* the bridge memory window is configured on the controller by the pci_pci bridge, and *before* the xhci controller is started.

That kind of ordering is not straightforward to arrange, as far as I can see: I cannot hack the message onto the end of the pcie attach function, since we need the bridge child to have attached, but not the xhci grandchild.

I think the best way then is to create a shim driver for the xhci controller whose probe() is designed only to succeed on the Rpi4. The shim's attach() will instruct the VC to load the xhci firmware, and then defer to the generic xhci_pci_attach(). All other methods will be inherited from the xhci_pci driver.

Another idea is to put the logic directly in the xhci_pci.c file, but I think creating a dependency out to the Rpi4 mailbox API from the generic XHCI framework is quite a hack.

Anyone have any thoughts?

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, 6 June 2020 19:15, Robert Crowston via freebsd-arm <freebsd-arm at freebsd.org> wrote:

> What works:
>
> -   FreeBSD SMP (see below)
> -   All 8 GB of memory (less video RAM).
>
>     What does not work on the 8 GB model (but does work on the 4 GB model):
>
> -   xhci (with my driver, there has been a change in the way the firmware is loaded)
> -   ethernet (genet0 is detected fine, appears to be up, but no packets go over the interface)
> -   JTAG debugging (urgh)
>
>     dmesg: https://dmesgd.nycbug.org/index.cgi?do=view&id=5534
>
>     You will need the latest u-boot. The one in pkg doesn't work. I compiled from head: https://github.com/u-boot/u-boot.git
>
>     For SMP, you need also need to tell u-boot not to clobber over our processor start up function set up by armstub8-gic.bin.
>
>     Edit board/raspberrypi/rpi/Kconfig, set RPI_EFI_NR_SPIN_PAGES to a larger number (I picked 10, probably too big, but it was easier than doing the arithmetic).
>
>     $ CROSS_COMPILE=aarch64-none-elf- gmake rpi_4_defconfig
>     $ CROSS_COMPILE=aarch64-none-elf- gmake
>
>     Overwrite the u-boot.bin file on your sdcard with the one just built.
>
>     You will also need the latest versions of the pi4 firmware files on your MSDOS partition, bcm2711-rpi-4-b.dtb, fixup4.dat, start4.elf, and the overlays/ directory.
>
>
> freebsd-arm at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"




More information about the freebsd-arm mailing list