Jump to content

Generic UEFI-arm64 on OrangePi-5+


Zaerc

Recommended Posts

So I was messing around with my new OrangePi-5+ and installed the EDK2 UEFI firmware for Rockchip RK3588 platforms onto the SPI flash (/dev/mtdblock0).  After which I tried all sorts of images and kernels with varying success, only the 5.10.160-legacy-rk3588 kernel would really have a working display.  Until I tried a generic UEFI arm64 image (Jammy-CLI on a USB stick) which gave a working display, albeit at 1080p max. (my monitor is 4K) with no acceleration (after the extra steps), and installed the Mate desktop (just my preference).

 

The big caveat is that it does not recognize the SD-card, EMMC or SPI-flash, just regular drives (e.g. sda/nvme0n1 etc) and I'm sure a lot of other hardware isn't properly recognized either.  But all of that was fixed by simply installing the old legacy kernel with apt, making a symbolic link to the correct dtb in /boot and updating grub, and a reboot later everything worked fine, the desktop popped up in 4K with acceleration and all.  In the end I installed the whole thing to an NVME with armbian-config, which didn't create the separate EFI partition, so I had to corrected it manually, but that is another story.

 

What surprises me is that the UEFI-arm64 kernel does not seem to need a Device-Tree-Blob, in fact it doesn't even boot with its own rk3588-orangepi-5-plus.dtb.

 

Anyway if anyone want's to try this I'd suggest using Balena etcher to write the ED2K firmware onto an SD-card, and a generic UEFI armbian to an USB stick so you won't have to mess up anything permanently.  Plug the stick in a USB2 port as it chokes during boot on the USB3 (blue) ports.  And you will need a lot of patience as booting from a USB2 stick will be rather slow to say the least. 

 

Install legacy kernel:

sudo apt update
sudo apt install linux-image-legacy-rk35xx

 

Create the symbolic link: (If you try this on another board or with another kernel version, you will need to adjust the link for the appropriate DTB instead)

sudo ln -s /usr/lib/linux-image-5.10.160-legacy-rk35xx/rockchip/rk3588-orangepi-5-plus.dtb /boot/dtb-5.10.160-legacy-rk35xx

 

Bonus tip, set the legacy kernel as a GRUB's default: (optional, adjust for different kernels)

sudo echo 'GRUB_DEFAULT="Armbian GNU/Linux, with Linux 5.10.160-legacy-rk35xx"' > /etc/default/grub.d/99-legacy.cfg

 

GRUB should now  automatically pick up on the DTB after updating:

sudo update-grub


So far the only downside I have found is that the audio outputs are all labeled "Built-in Audio Stereo", which was easy to solve by adding some udev-rules as the Armbian build system does when building a regular OrangePi-5+ image. 

Spoiler

Put the following lines in /etc/udev/rules.d/90-naming-audios.rules:

SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"
SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi1-sound", ENV{SOUND_DESCRIPTION}="HDMI1 Audio"
SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmiin-sound", ENV{SOUND_DESCRIPTION}="HDMI-In Audio"
SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-dp0-sound", ENV{SOUND_DESCRIPTION}="DP0 Audio"
SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-es8388-sound", ENV{SOUND_DESCRIPTION}="ES8388 Audio"

 

 

Screenshot at 2024-02-24 23-34-15.png

EDK2-UEFI_OrangePi-5+.png

Screenshot at 2024-02-24 23-45-53.png

GRUB_OrangePi-5+.png

Screenshot at 2024-02-24 23-48-49.png

login_OrangePi-5+.png

Link to comment
Share on other sites

Quote

What surprises me is that the UEFI-arm64 kernel does not seem to need a Device-Tree-Blob, in fact it doesn't even boot with its own rk3588-orangepi-5-plus.dtb.

 

Actually the kernel needs a dtb that is integrated in the UEFI EDK2  firmware and gives the dtb to the kernel EFI stub. If you are using a firmware for another SBC the dtb passed through is wrong.

 

Wait a minute.... I'm wrong. EDK2 gives it's own drivers to the kernel. The above is for UEFI U-BOOT.

Edited by maka
Link to comment
Share on other sites

Hi,

 

i went a slightly different route and built a custom image for UEFI support based on current amazingfate armbian build framework (edge kernel 6.8.1 with EDK2 0.9.1) which works well - with NVME boot support based on your instructions above. I needed to enable USB2 support in UEFI settings for the slow usb stick boot, but i've ended up with a nicely working grub on an arm64 box which feels weird 😁 ... but lovely!

 

 https://paste.armbian.com/obowabadak has the output from armbianmonitor -u

 

I did get a kernel stack trace about 8s into the kernel boot, but doesnt seem to impact anything.

 

In my case I could not get the EDK2 img md5sum to match during the SPI flash... same result everytime. I just assumed a bit of trailing garbage was the culprit and it booted anyway 🤪

Edited by ozacas
just clarification
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines