Hello,
I've been trying (with limited success) to get OpenBSD 7.1 installed on
some Raspberry Pi Compute Module 4 (a.k.a. 'CM4') boards' internal flash
storage. I'm wondering if anyone else on this list might have tested
these devices with OpenBSD?
Please let me know if there's a more appropriate place to post this.
I've been testing on three different Raspberry Pi CM4 units, all with 8
GB of onboard flash storage.
The first CM4 I installed on is able to boot OpenBSD 7.1 from its
internal storage, but gives some weird U-Boot/EFI errors (which I'll
paste below) and the UEFI menu prompt doesn't appear during boot.
The second and third CM4s I've been testing have bigger problems...
Despite following the same install process as on the first CM4, I've so
far been unable to get the 2nd & 3rd CM4s to boot OpenBSD from their
internal storage at all.
All three CM4s *are* able to boot OpenBSD 7.1 from external USB disks
without any issues, using RPi's latest UEFI firmware on the USB disk's
boot partition and the latest RPi EEPROM/bootloader. The errors/failures
only happen when booting OpenBSD from the CM4's internal flash storage.
I found that the first CM4 I tested (the one which *is* able to boot
OpenBSD from its internal flash storage, despite some errors) shipped
with an older EEPROM/bootloader than the next two CM4s I tested... but
unfortunately the EEPROM/bootloader version (dated 2020-10-02) which
that first CM4 shipped with apparently isn't available from the RPi repo:
https://github.com/raspberrypi/rpi-eeprom/releases
I've tried flashing the other two CM4s with the latest RPi
EEPROM/bootloader (from 2022-08-2), and also tested older EEPROMs from
2020 and 2021 -- but sadly none of them made the 2nd & 3rd CM4s boot
OpenBSD from their onboard storage.
____
Here's a more detailed accounting of what I've tried, and the results:
1.) I dd'd the OpenBSD 7.1 (arm64) miniroot installer onto a USB disk,
and then updated the UEFI/firmware files on the miniroot USB's boot
partition with the latest version (v1.33) from this repo (which was
necessary to make the CM4 boot from the miniroot USB disk):
https://github.com/pftf/RPi4/
2.) While booting the CM4 from the miniroot USB, I entered the UEFI
settings menu (via serial console), verified that '3GB memory limit' was
disabled, and changed the 'System Table Selection' from 'ACPI' to
'Device Tree' (as recommended in various posts about OpenBSD on the
Raspberry Pi4, which has the same SoC as the CM4).
3.) The OpenBSD miniroot installer booted normally, and I installed onto
the CM4's internal flash storage (whole disk, auto-partitioned). The
install process finished without any errors (on all three CM4 units
tested).
4a.) On the *first* CM4 I tested (running the 2020-10-02
EEPROM/bootloader that it shipped with):
After the install finished, it was able to boot the fresh OpenBSD 7.1
install on the internal flash storage, with OpenBSD's stock EFI/firmware
files in the 'boot' partition... i.e. without updating any files in the
boot partition following the OpenBSD install. This surprised me, as I
*did* have to update those UEFI/firmware files on the miniroot USB disk
in order to make it boot on this same CM4... However, while it was able
to boot OpenBSD from the internal flash storage, it didn't show the
expected UEFI menu prompt during boot, and instead gave the following
U-Boot/EFI errors, before successfully booting into OpenBSD:
U-Boot 2021.10 (Jan 25 2022 - 01:09:33 -0700)
DRAM: 948 MiB
RPI Compute Module 4 (0xa03140)
MMC: mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... Unable to read "uboot.env" from
mmc0:1... In: serial
Out: serial
Err: serial
Net: eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
USB XHCI 1.00
scanning bus xhci_pci for devices... XHCI timeout on event type 33...
cannot recover.
BUG at
/usr/obj/ports/u-boot-aarch64-2021.10-aarch64/u-boot-2021.10/drivers/usb/host/xhci-ring.c:481/xhci_wait_for_event()!
BUG!
resetting ...
U-Boot 2021.10 (Jan 25 2022 - 01:09:33 -0700)
DRAM: 948 MiB
RPI Compute Module 4 (0xa03140)
MMC: mmcnr@7e300000: 1, emmc2@7e340000: 0
Loading Environment from FAT... Unable to read "uboot.env" from
mmc0:1... In: serial
Out: serial
Err: serial
Net: eth0: ethernet@7d580000
PCIe BRCM: link up, 5.0 Gbps x1 (SSC)
starting USB...
Bus xhci_pci: Register 5000420 NbrPorts 5
Starting the controller
Port not available.
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Card did not respond to voltage select! : -110
Scanning disk [email protected]...
Disk [email protected] not ready
Scanning disk [email protected]...
Found 3 disks
No EFI system partition
BootOrder not defined
EFI boot manager: Cannot load any image
Found EFI removable media binary efi/boot/bootaa64.efi
190631 bytes read in 34 ms (5.3 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Booting /efi\boot\bootaa64.efi
disks: sd0*
>> OpenBSD/arm64 BOOTAA64 1.8
boot>
[...and then it boots OpenBSD successfully, despite the U-Boot / EFI
errors above]
4b.) On the *2nd and 3rd* CM4s (running the newer 2020-10-02
EEPROM/bootloader that they shipped with, and on the several other
EEPROM versions I flashed/tested) :
The OpenBSD 7.1 installation from miniroot USB onto CM4's internal flash
storage finishes without errors, but then the CM4 fails to boot from the
fresh install.
I tested with several RPi EEPROM/bootloader versions, including the
2021-12-02 version these CM4s shipped with, the latest 2022-08-02
version, and some older 2020 & 2021 releases.
With each RPi EEPROM/bootloader version I tested, I first tried booting
with OpenBSD's stock UEFI/firmware files in the 'boot' partition (which
had surprisingly worked on the first CM4), but that gave absolutely no
output on the serial console on these two newer CM4s.
I then tried updating the boot partition's UEFI/firmware files with the
latest (v1.33) release from the RPi repo ( https://github.com/pftf/RPi4/
), after which it did show the interactive UEFI menu on boot. I adjusted
the UEFI settings as before (changed 'System Table Selection' from
'ACPI' to 'Device Tree'), but it consistently fails to boot OpenBSD from
the internal flash storage (on every EEPROM/bootloader version tested)
with the errors below:
MESS:00:00:04.399023:0: dtb_file 'bcm2711-rpi-cm4.dtb'
MESS:00:00:04.406371:0: brfs: File read: /mfs/sd/bcm2711-rpi-cm4.dtb
MESS:00:00:04.409619:0: Loading 'bcm2711-rpi-cm4.dtb' to 0x1f0000 size
0xcba0
MESS:00:00:04.429548:0: brfs: File read: 52128 bytes
MESS:00:00:04.502857:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:04.505422:0: brfs: File read: 230 bytes
MESS:00:00:04.510624:0: brfs: File read: /mfs/sd/overlays/miniuart-bt.dtbo
MESS:00:00:04.537356:0: Loaded overlay 'miniuart-bt'
MESS:00:00:04.588311:0: brfs: File read: 1819 bytes
MESS:00:00:04.590944:0: brfs: File read: /mfs/sd/overlays/upstream-pi4.dtbo
MESS:00:00:04.661396:0: Loaded overlay 'upstream-pi4'
MESS:00:00:04.835801:0: brfs: File read: 2782 bytes
MESS:00:00:04.837725:0: Failed to open command line file 'cmdline.txt'
MESS:00:00:05.116758:0: brfs: File read: /mfs/sd/RPI_EFI.fd
MESS:00:00:05.119222:0: Loading 'RPI_EFI.fd' to 0x0 size 0x1f0000
MESS:00:00:05.125048:0: No compatible kernel found
MESS:00:00:05.129550:0: Device tree loaded to 0x1f0000 (size 0xd20d)
MESS:00:00:05.137214:0: uart: Set PL011 baud rate to 103448.300000 Hz
MESS:00:00:05.144701:0: uart: Baud rate change done...
MESS:00:00:05.146723:0: uart: Baud rate change done...
MESS:00:00:05.153354:0: gpioman: gpioman_get_pin_num: pin
SDCARD_CONTROL_POWER not defined
NOTICE: BL31: v2.6(release):
NOTICE: BL31: Built : 16:56:46, Jan 7 2022
UEFI firmware (version UEFI Firmware v1.33 built at 17:06:11 on Mar 7 2022)
Synchronous Exception at 0x0000000037101468
____
Addendum:
To flash & test the different RPi EEPROM/bootloader versions, I followed
the EEPROM-update steps from here:
https://www.raspberrypi.com/documentation/computers/compute-module.html#cm4bootloader
And I found the various EEPROM versions in Raspberry Pi git repos, here:
https://github.com/raspberrypi/usbboot
https://github.com/raspberrypi/rpi-eeprom/releases
Here's the list of all RPi EEPROM/bootloader releases I flashed / tested
on the 2nd CM4 (none of which were able to boot OpenBSD 7.1 from the
CM4's internal storage):
2022-08-02 - current release included in the RPi 'usbboot' repo
2022-04-26 - the latest release from the 'rpi-eeprom' repo
2021-12-02 - the version my 2nd & 3rd CM4s shipped with
2021-03-18 - closest available release after 2020-10-02 (the date of the
mostly-working EEPROM that the 1st CM4 shipped with)
2020-09-03 - closest release before 2020-10-02
Please let me know if anything needs clarification, or if you have any
suggestions for what to try next.
Thanks!
Ian