Raspberry Pi

FreeBSD on Raspberry Pi

Stock FreeBSD boots on the Pi 4, Pi 5 and Zero 2 W, but a lot of the board stays dark. These drivers switch the rest on, one chip at a time.

A raspberry with horns peeks over a green circuit board that says "boot: ok".

Every driver here is a loadable kernel module for a stock GENERIC arm64 kernel on FreeBSD 15.1-RELEASE. No kernel rebuild: build a .ko, drop it into /boot/modules and load it. All code is under the BSD 2-Clause licence.

What works on which board

FunctionPi 5Pi 4Zero 2 WModule
Wi-Fi 2.4 GHzworksworksworkscywfm
Wi-Fi 5 GHzworksworksno 5 GHz radiocywfm
Fan controlworksn/an/arp1fan
Analogue sound (jack)out of scopefirst soundnot triedvchiq, bcm2835_audio
Bluetoothblocked: no UART driverbuilt, never runsimulator onlyng_h4
SoC temperaturebuiltbuiltbuiltrpitemp
CPU frequency, watchdog, RNGbuiltn/an/arpifreq, rpiwdog, rpirng
GPIO via RP1early coden/an/arp1, rp1gpio

Boards marked "expected to work" in the Wi-Fi docs (other Pi 4 revisions, Pi 400, CM4, Pi 3 B+ and 3 A+, CM5, Pi 500) have the right chip but nobody has tried them yet. For owners of those boards, a board report is the most useful contribution.

Before starting: FreeBSD on the card

  1. Download the FreeBSD-15.1-RELEASE-arm64-aarch64-RPI.img.xz image from the FreeBSD download site.

  2. Write it to the SD card. On FreeBSD:

    xz -dc FreeBSD-15.1-RELEASE-arm64-aarch64-RPI.img.xz | dd of=/dev/da0 bs=1m conv=sync
    

    Check the device name twice: dd does not ask.

  3. Boot the board. Without Wi-Fi, Ethernet or a serial console is needed: pin 6 is GND, pin 8 TXD, pin 10 RXD, 115200 8N1, 3.3 V only.

  4. Log in as root/root (or freebsd/freebsd) and change both passwords before anything else.

  5. For drivers built on the board, install the kernel sources so /usr/src/sys exists. Then pick a driver from the list above.

The Pi 5 boots FreeBSD through UEFI firmware (tested with v0.3), so it gets ACPI tables instead of a device tree. That is why several stock FreeBSD drivers that exist for the Pi do not attach on the Pi 5: they only look in the device tree.

Built with ssg