FreeBSD/ARM on the Raspberry Pi family

What is Raspberry Pi?

The original Raspberry Pi launched in early 2012 as an inexpensive ($35) PC based on a Broadcom BCM2835 SoC. It was developed by the UK-based Raspberry Pi foundation as an inexpensive system for educational use. As of April 2013, it had sold over a million units.

There are many versions of the Raspberry Pi. Where links are shown, they lead to information about models currently being sold.

Due to the bewildering number of versions, some earlier versions are not listed here.

The Raspberry Pi Hardware and Raspberry Pi revision codes pages have much more detailed information about models.

Raspberry Pi and FreeBSD

FreeBSD has supported the original Raspberry Pi since November, 2012 and Raspberry Pi 2 since March, 2015.

If you have questions, please ask on the freebsd-arm@ mailing list.

Xorg

How to Boot the Raspberry Pi

As of January 2013, FreeBSD-CURRENT fully supports either a video console (you'll need a USB keyboard and display connected) or it can be configured to use a serial console (you'll need a USB to TTL Serial Cable such as the one sold by Adafruit.com). OTG-capable boards, such as Zero, provide virtual serial console when connected to an USB host.

After connecting video, keyboard, and inserting the SDHC card, you connect power to actually boot.

Pre-Built Images

Version

ARCH

Releases

Snapshots

RPI-B

armv6 (all)

12+

12-STABLE, 13-STABLE, 14-CURRENT

RPI2

armv6 (12+), armv7 (12+)

armv6 12+, armv7 12+

12-STABLE, 13-STABLE, 14-CURRENT

RPI3

aarch64 (12)

12

12-STABLE

RPI

aarch64 (13+)

13+

13-STABLE, 14-CURRENT

For Raspberry Pi Zero use the image for RPI-B. For Raspberry Pi 3, Pi 4 and Pi 400 use the image for RPI on 13+.

The default passwords for the images are freebsd/freebsd and root/root .

How to Build Your Own Images

Raspberry Pi and Raspberry Pi 2 are supported by the Crochet build tool.

Building an image for Raspberry Pi 2

DTB Overlays

These are a recent feature. Please see this README for more information.

Features

What works

RPi 1

RPi 2

RPi 3 / RPi 3B+ / RPi 2 1.2

RPi 4

RPi Zero

RPi Zero W

Wordsize

32

32

64

64

32

32

audio

OK

OK

?

Currently unsupported

Not avail.

Not avail.

camera

Not Tested

OK

?

?

?

ethernet

OK

OK

OK

OK

Not avail.

Not avail.

GPIO

OK

OK

OK

OK

OK

OK

HDMI

OK

OK

OK

OK (max. 1080p/scfb)

OK

OK

i2c

OK

OK

?

OK (brcm BSC)

OK (12+ needs dt config)

OK (12+ needs dt config)

SD card

OK

OK

OK

OK

OK

OK

SMP

Not avail.

OK

OK

OK

Not avail.

Not avail.

SPI

OK

OK

?

OK

OK

OK

USB 2.0

OK

OK

OK

USB 3.0

OK (both device and host)

OK (both device and host)

watchdog

OK

OK

?

OK

?

UEFI/ACPI

-

-

unsupported

unsupported

?

WiFi

Unsupported (BCM43438 Driver)

Unsupported (brcmfmac43455-sdio)

Not avail.

Unsupported (BCM43438 Driver)

TV Hat

?

?

?

?

?

?

GPIO

Perl, Python and Ruby wrappers for interfacing with the GPIO ioctl are available at https://github.com/brd/freebsd-gpio

Camera

See arm/Raspberry Pi Camera.

External Displays

Some external displays made for the Raspberry Pi require extra configuration steps to work properly. The Raspberry Pi uses a config.txt file on a FAT partition instead of a traditional BIOS or UEFI firmware. Manufacturers of displays built for Raspberry Pis may provide the relevant settings as part of the documetation. The settings are often the same as on Linux-based distributions for the Raspberry Pi. After writing the bootable image to the compact flash card, mount the FAT partition contained on it as msdosfs and open the config.txt file. This can also be done from within the Pi itself, provided the display gives some form of output, otherwise another machine has to be used. The partition is mounted like this after logging in:

/dev/msdosfs/MSDOSBOOT on /boot/msdos (msdos, local, noatime)

A couple of lines are already present in /boot/msdos/config.txt. The lines from the manufacturer have to be added to the end of that file. After saving and exiting the editor, reboot the Raspberry. The updated config.txt file will be loaded and the display should work as expected.

For example, the following lines were added to config.txt to make a 5" touchscreen display from Waveshare work and use the proper resolution:

max_usb_current=1
hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1

And the following lines were added to config.txt to make a 9" display from Beetronics work and use the proper resolution:

max_usb_current=1
hdmi_group=2
hdmi_mode=69
hdmi_drive=1

Pi-Top

The Pi-Top is a cheap laptop built around the Rpi3

To get the touchpad working add this to your /boot/loader.conf:

usb_quirk_load=YES
ums_load=YES
hw.usb.quirk="0x258a 0x000c 0x0000 0xffff UQ_CFG_INDEX_1"

Device Configuration

Device Trees, overlays, and parameters

SDIO

SDIO

SDIO is implemented in r348805 and we should tether brcmfmac43455-sdio.bin / brcmfmac43455-sdio.txt to get first WIFI network for the RPI4 .

RPi3 Notes

RPI4 and RPi400 Notes

The RPi4 and RPi400 idle at 600MHz but support 1500MHz and 1800MHz respectively.

To enable automatic CPU with powerd(8):

sysctl dev.cpu.0.freq
dev.cpu.0.freq: 600

sysrc powerd_enable="YES"   
/etc/rc.d/powerd restart

If the display defaults to 592x448 under xorg, modify the file /boot/msdos/config.txt with:

hdmi_safe=0

or simply comment out "hdmi_safe=1"

The following additional config.txt setting maybe required, depending on the brand and/or model of monitor used:

max_framebuffers=2
hdmi_force_hotplug=1
hdmi_group=1
hdmi_drive=2
hdmi_mode=16

The FreeBSD-13.1-RELEASE-arm64-aarch64-RPI.img image is known to work with xorg, XFCE, Firefox, and other popular desktop applications. The mouse daemon will start automatically and need not be enabled.

Known RPi 4 Issues

Boot Loader Issues

RPi 4 Rev >= 1.2 doesn't boot with FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img image.

The u-boot.bin used when creating 13.0-RELEASE image was too old to support newer RPi4 hardware revision.

The workaround is replacing u-boot.bin with newer one from sysutils/u-boot-rpi4:

# pkg install -y u-boot-rpi4
# mdconfig -f FreeBSD-13.0-RELEASE-arm64-aarch64-RPI.img
md0
# mount_msdosfs /dev/md0s1 /mnt
cp /usr/local/share/u-boot/u-boot-rpi4/u-boot.bin /mnt/u-boot.bin
# umount /mnt
mdconfig -d -u 0

Reference: How to Check if Your Raspberry Pi 4 Model B is Rev1.2?

Console output on HDMI

If the HDMI/Micro HDMI display port shows the RPi rainbow color screen rather than console output, try the other port.


CategoryHowTo

arm/Raspberry Pi (last edited 2024-06-19T05:18:33+0000 by MichaelDexter)