Solved FreeBSD on RPi CM4?

  • Thread starter Deleted member 69908
  • Start date
D

Deleted member 69908

Guest
I am trying to run FreeBSD 13 on a Raspberry Pi Compute Module 4 with the corresponding (official) IO board.
Note that my device has no wifi, bluetooth, emmc.

The rpi-firmware port already provides the CM4 dtb which I simply added to the boot folder. To get the USB ports
working I additionally included the dwc2.dtbo overlay and adjusted the config.txt accordingly.

U-boot shows no problems and my keyboard also works. According to the boot logs, the provided dtb is is being used by the EFI loader.
Yet, trying to run the kernel I am getting a kernel panic and the system resets. FreeBSD 13 on my RPi 4B doesn't have these issues and boots as expected.

Does anyone have a CM4 and managed to run FreeBSD on it?

I guess the kernel itself doesn't support the CM4 at the moment. If someone is interested I can also provided some logs of the booting process.
 
I am having similar issue with CM4 (latest rpi-update and eeeprom version) and FreeBSD13.2 - keeps rebooting constantly. How can I mount the CM4 so I can add the devmatch_enable="NO" to /etc/rc.conf?
When I connect it to the MacBook and issue ./rpiboot I see the MS-DOS partition only. I can edit the config.txt, but can not access the FreeBSD partitions.
Any hints, please?
 
I found the way to do it in a FreeBSD system, basically following the steps:
  1. Download FreeBSD 13.2 RPI image
  2. It is an xz archive, so firs un-archive: xz -d -v FreeBSD-13.2-RELEASE-arm64-aarch64-RPI.img.xz
  3. Check the img file with: file -s Freebsd….
  4. mdconfig -a -t vnode -f FreeBSD-13.2-RELEASE-arm64-aarch64-RPI.img -u 0
  5. This will mount the different partitions of the image in md0 md0s1 md0s2 md0s2a
  6. Make directory 1 and 2 in /tmp
  7. Md0s1 is the MS-DOS boot partition, so mount it like: mount -t msdosfs /dev/md0s1 /tmp/1
  8. Md2s2a is the UFS partition of the freebsd: mount -t ufs /dev/md0s2a /tmp/2
  9. Add devmatch_enable="NO" to rc.conf
  10. Copy bcm2711-rpi-cm4.dtb and bcm2711-rpi-cm4s.dtb too the MS-DOS partition in /tmp/1/. Download them from here - https://github.com/raspberrypi/firmware/tree/master/boot
  11. Detach by issuing the command: mdconfig -d -u 0
  12. Compress back to xz archive with issueing the command: zx FreeBSD-13.2-RELEASE-arm64-aarch64-RPI.img
  13. Write to the eMMC with RPI Imager
 
Back
Top