Over on Mastodon / in the fediverse, Lukas made this post, demonstrating the EDK2 UEFI implementation on the rk3588 on mnt reform 2. In the post, he writes:
amazing: i can just flash the rk3588 EDK2 image for firefly aio on an sd card and booom! EDK2 (UEFI) on the MNT Reform.
Unfortunately, I’m having trouble reproducing this.
I downloaded the EDK2 image from here, same as Lukas, and used dd to flash an SD card. Unfortunately, my reform will still boot from the eMMC first. I always end up in my OS, not the UEFI.
I didn’t think I saw a DIP switch on the rk3588 SOM when installing it. So is there some other way to change the boot order?
Of course I am aware that when I insert an SD card with an OS installation on it, the reform will boot from that. BUT, afaik, this is handled not by the CPU / SOM but rather by u-boot. But u-boot does not «chain-load» the boot loader on the SD card, rather it searches for a u-boot script on the SD card’s first partition. Hence it works fine for an OS image that comes with such a u-boot script, but it does not work for my use case where I want to load a boot loader from the SD card.
I have also tried using u-boot’s bootefi command, to have u-boot load the EDK2 UEFI image. For that i wrote a simple u-boot script and put that plus the EDK2 image file into the first partition of the SD card. However, this does not work because the EDK2 images available for download here are not just the UEFI binary but rather an entire SD-card image containing a partition table and so on. Thus far I’ve been too lazy to build EDK2 myself or figure out how to extract the binary from the image…
I’ve managed to switch my mnt reform 2 over from U-Boot to EDK2 + GRUB. It works pretty well like that and I now get to see the boot process on the laptop’s built in display.
There are some quirks though, like the system clock not syncing at start up and the laptop not shutting down properly. But nothing major so far.
To have Wifi, eMMC and the SD Card reader, I had to switch from ACPI to device tree and then tell GRUB to load the dtb file. Here’s the relevant setting in EDK2:
Device manager → Rockchip Platform Configuration → ACPI / Device Tree → Set Config Table Mode to Device Tree and also Support DTB override & overlays to Enabled
I guess to have ACPI work propperly, one would have to update EDK2’s own device tree (or equivalent thereof)?
The next thing I want to try is switching to a mainline kernel. I was able to boot Fedora workstation and Ubuntu Server just fine, so I guess a stock kernel would work at least OK on rk3588
Currently booting from SD card. Will have to see how well this holds up in day to day use and then decide whether to tackle getting this into the eMMC or revert back to u-boot instead…