Hello fellow MNT enthusiasts!
Some of you might have seen my fedi post, but I spent some time working on getting OpenBSD 7.4 running on my Reform with 2.0 motherboard and iMX8MQ module, and indeed got it running.
Firstly, I want to say that all of the hard work on getting OpenBSD running on Reform was done by other members of this community, I just put things together - bluerise has done a lot of work getting Reform support into mainline u-boot, for example, and was very helpful in helping me understand the current state of things. I’ve also seen sigrid and cinap’s work on 9front referenced in a lot of places, which I also understand was pivotal in improving the u-boot and device trees for Reform as well. So I want to thank everyone involved in that work, also those who I did not mention who worked on it.
So, I’ve been able to boot OpenBSD 7.4 using the stock install74.img
file for arm64. The panic
on boot mentioned in this thread is due to the older version of u-boot and the way in which the u-boot/UEFI memory map is translated into the OpenBSD page table. Using a newer u-boot with the mainline device tree file fixes this and the page table mapping works correctly. Additionally, it is no longer required to disable NVMe - NVMe works fine.
A non-exhaustive list of things which work:
- Display
- Keyboard
- Trackball
- Ethernet
- NVMe storage
- Full disk encryption
A non-exhaustive list of things which do not work
- Automatic power-off on shutdown
- PCIE WiFi card (not detected)
- Accelerated video & 3D, the u-boot framebuffer is used for video. The performance is pretty good though!
A list of things I haven’t tested yet
- Inbuilt sound chip
- Suspend or resume
- Various sensors
- Battery level information
- Building firmware for or flashing various Reform components
To get this booting, the following steps are required. I can share the binary with those who need it or can’t compile u-boot though (maybe ask on IRC). Perhaps MNT will want to host it somewhere also?
Steps:
- Download arm64 install74.img from
cdn.openbsd.org
- Write it to an SD card
- Clone the
mnt
branch of bluerise’s u-boot repo withgit clone -b mnt https://github.com/bluerise/u-boot
- Also clone the mnt boundary uboot repo with
git clone https://source.mnt.re/reform/reform-boundary-uboot
somewhere, as you’ll need the binary blobs for DDR training, and the bl31 binary. - Copy
*.bin
from thereform-boundary-uboot
repo into theu-boot
directory which you cloned from bluerise’s project - Switch to the mainline/bluerise u-boot project checkout directory
- Run
ln -s bl31-iMX8MQ.bin bl31.bin
to make sure u-boot knows how to find thebl31
binary. There’s probably a more elegant way to handle this. - Apply the patch from commit cff1714a875a94ca483a69ad1a3c39bff2dab3a2 from
reform-boundary-uboot
to your checkout of bluerise’s u-boot source. This allows modifier keys (shift, for example) to work in u-boot and the OpenBSD bootloader. I’m working out how best to handle this patch so we can either mainline it or no longer need it. Maybe some changes to the keyboard firmware are possible. - Make sure you have the dependencies installed for building u-boot, documented here
- Run
make imx8mq_reform2_defconfig
, you can also tweak the config if you like - I cross-compiled, so I ran
ARCH=arm CROSS_COMPILE=aarch64-unknown-linux-gnu- make flash.bin
- butCROSS_COMPILE
will vary a little based on which aarch64 compiler you have installed. If you compile natively on arm64, you don’t needARCH
orCROSS_COMPILE
specified. - You should have a
flash.bin
now, so write it to the SD card withdd if=flash.bin of=/dev/<name of your SD card device> bs=1k seek=33
- Install the SD card in your reform (assuming you have the boot switch set to SD) and you should be presented with u-boot, which will boot into the OpenBSD bootloader. Interrupt the OpenBSD bootloader and type “set tty fb0”, then press enter to boot the installer.
- Install OpenBSD as normal, you should be able to install to NVMe without issue. Full disk encryption also works, as well as unlocking the disk in the bootloader.
- At the end of the install, don’t select reboot, instead choose shell. In the shell run
echo "set tty fb0" > /mnt/etc/boot.conf
to make sure the framebuffer console is used on boot
Please feel free to let me know if you have any questions. I’ll continue to test & work on various improvements as I can. I hope this information helps someone.