FreeBSD now runs on the Libre Computer Le Potato
For the past few weeks I've been porting FreeBSD to the Libre Computer AML-S905X-CC, better known as the Le Potato. As of this week it boots FreeBSD 15.1-RELEASE to a login prompt from either an SD card or an eMMC module, with Ethernet, USB, webcams, GPIO and I2C sensors all working. A ready-to-flash image and the source are linked below.
Why
I build monitoring units for mushroom grows: CO2, temperature and humidity sensors, a camera taking a timelapse of each grow, and a small touchscreen on the front. The Le Potato is cheaper than a Raspberry Pi and does everything I need, and I wanted the OS underneath to be FreeBSD: small, coherent, easy to audit, and quiet about phoning home. Nobody had done the port, so I did. It was also a good excuse to learn FreeBSD driver development.
What works
- Boot through Libre Computer's stock U-Boot and the FreeBSD EFI loader, from SD or eMMC
- Serial console and HDMI console, including the Beastie boot menu
- All 4 CPU cores
- 10/100 Ethernet, IPv4 (DHCP) and IPv6 (SLAAC)
- USB 2.0 host: keyboards, mice, touchscreens, USB audio and UVC webcams (1080p MJPEG via webcamd)
- GPIO on both pin banks, onboard LEDs
- I2C on the 40-pin header (tested with a Sensirion SCD40 CO2 sensor)
- X11 and Qt on the framebuffer, with touch input
- First-boot growfs to fill the card or eMMC
What doesn't work yet
- CPU temperature and frequency scaling (needs an SCPI/mailbox driver; that's next)
- Wi-Fi via USB dongle (rtwn and run drivers just need to be enabled and tested)
- The Ethernet MAC address changes every boot, and the port LEDs are dark
- Watchdog, hardware RNG, PWM, ADC, IR, CEC, hardware video, HS200 eMMC speeds
- There is no real-time clock on the board, so run ntpd
Under the hood
The port adds new drivers for the Amlogic S905X: clock controller, reset controller, pin control and GPIO, I2C, the UART, the SD/eMMC host, Ethernet glue plus the internal PHY, and the USB PHY and controller glue.
It also includes two fixes to existing FreeBSD code that I plan to send upstream, because they aren't specific to this board:
- simplefb: the console driver now skips disabled or incomplete framebuffer nodes in the device tree instead of tripping over them.
- xHCI isochronous transfers: webcam video came through corrupted with no USB errors logged. The cause was the xHCI driver marking every TRB of a page-split isochronous frame as "Isoch" when the spec says only the first one should be. Intel controllers tolerate it; the DesignWare DWC3 controller on this board doesn't, and silently drops the data. With the fix, 1080p video is clean. This one may affect other ARM boards with DWC3 USB.
Try it
- Image: FreeBSD-15.1-r7-arm64+aml-s905x-cc.img.xz (620MB / 5GB uncompressed)
Image Link - Source: github.com/beneschtech/freebsd-src-aml-905xx-cc (based on releng/15.1)
Write the image to an SD card with dd or your usual imaging tool and boot. A USB-serial adapter on the UART header is handy but not required; the HDMI console works. The default logins are the stock FreeBSD ARM ones (root/root and freebsd/freebsd), so change them right away.
This is experimental. It runs my hardware fine, but expect rough edges.
What's next
- CPU temperature and frequency scaling
- Wi-Fi dongle support
- Stable MAC address, Ethernet LEDs, faster eMMC
- Scripting the image build and writing it up for the freebsd-arm list
- Getting the xHCI and simplefb fixes upstream
Get involved
If you have a Le Potato, try the image and tell me how it goes. Bug reports and boot logs are welcome as GitHub issues on the repo. If you work on FreeBSD/arm64 or at Libre Computer, I'd love to hear from you.