Raspberry Pi / SoC

Raspberry Pi SoC drivers: temperature, cpufreq, watchdog, RNG

On a Pi 5 booted through UEFI, FreeBSD has drivers for the temperature sensor, CPU clock, watchdog and random number generator. None of them attach, because they only look in a device tree.

A worried raspberry imp next to a red thermometer and a bubble reading 48.5 C.

built, not loaded FreeBSD 15.1-RELEASE-p7. All four modules build without warnings and have 100% coverage in host tests. None has been loaded on a board yet. The repository is not public yet.

The modules

ModuleBoardsProvides
rpitempPi 5, Pi 4, Zero 2 Whw.rpitemp.temperature, .raw, .invalid, .board, .slope, .offset; on the Pi 5 also dev.cpu.0.temperature
rpifreqPi 5CPU frequency steps for powerd(8). Tunables hw.rpifreq.step_mhz (100) and hw.rpifreq.mailbox (0), read-only hw.rpifreq.route
rpiwdogPi 5Hardware watchdog, timeouts up to 15.99 s. hw.rpiwdog.timeout_ms, hw.rpiwdog.armed_count
rpirngPi 5The RNG200 block as a random(4) entropy source. hw.rpirng.bytes, resets, empty

Try it

make test
make coverage
make modules
kldload ./driver/rpitemp/rpitemp.ko && sysctl hw.rpitemp

rpitemp is the safest to try first: it only reads. Leave the watchdog for last, since a wrong timeout reboots the board.

Built with ssg