UEFI / EDK2 on the Rock 5B

I’d love to see the latest version of uefi.
I think you’ve already seen it


Yes, we can discuss it.

I just got some new info from Rockchip. They are working on HDMI right now, and will add serial number support in SMBIOS. They will also release a new version this month (unknown if above features will be included or not).

3 Likes

Maybe RockChip will look at Jared’s code and it will make it easier for them. I really like Jared’s code, it’s so clear and simple

1 Like

I was able to get FreeBSD running on Rock 5B using the uefi bootloader.
I used the master branch and I had to completely block the pci code otherwise the system hung on the pci initialization.

This code is for Rockchip development board and needs to be modified for Rock 5B

is HDMI allready working? or was it through the serial console and what boot device did you use and would it be possible to boot linux via grub

I used console.
As mentioned earlier, the HDMI initialization code is not in uefi yet.
I tested booting efi loader from efi partition and running FreeBSD OSes. It works. Only blue USB ports work and for some reason in USB 2.0 mode. All this requires study, the uefi code is very raw this is the Alfa version.

and did you try it with linux? if yes did it work and where is your code?

I think Linux can be tried to run, but this is not a great specialist.
This patch - disable pci

diff --git a/edk2-platforms/Platform/Rockchip/RK3588/AcpiTables/Dsdt.asl b/edk2-platforms/Platform/Rockchip/RK3588/AcpiTables/Dsdt.asl
index c7d03babd5..db7c865a25 100755
--- a/edk2-platforms/Platform/Rockchip/RK3588/AcpiTables/Dsdt.asl
+++ b/edk2-platforms/Platform/Rockchip/RK3588/AcpiTables/Dsdt.asl
@@ -10,6 +10,11 @@
  *  SPDX-License-Identifier: BSD-2-Clause-Patent
  *
  **/
+/** ^M
+ *   include ("Pcie.aslc")^M
+ *   include ("Sata.asl")^M
+ *   include ("Gmac.asl")^M
+ **/^M
 
 #include "AcpiTables.h"
 
@@ -65,10 +70,7 @@ DefinitionBlock ("Dsdt.aml", "DSDT", 2, "RPIFDN", "RPI", 2)
       }
     }
 
-    include ("Pcie.aslc")
-    include ("Sata.asl")
     include ("Emmc.asl")
-    include ("Gmac.asl")
     include ("Gpio.asl")
     include ("I2c.asl")
     include ("Uart.asl")

Hi @SleepWalker

Could you please point to a HOWTO about building EDK2?
I got an errors during build attempt.
Thanks.

UPD: successfully built it under Debian… but had a errors under Gentoo.

UPD2: not such successfully as i thought

cd u-boot and re-packet uboot.img: ./scripts/fit-repack.sh -f uboot.img -d unpack/
./make.sh: line 35: cd: ../u-boot: No such file or directory
cp: cannot stat 'uboot.img': No such file or directory
cp: cannot create regular file 'unpack/uboot': No such file or directory
mv: cannot stat 'uboot_uefi.img': No such file or directory
****Build NOR FLASH IMAGE****

The u-boot directory is missing and i’m not sure where to find it, any clues? thx.

UPD3: Successfully built it after downloading u-boot and build-tools.

might be useful :slight_smile:

i hope windows wont boot on the rock 5b

Hello!
Thanks to the help of @strongtz , UEFI for Rock 5B now almost works PCIe30.

root@Rock-5B:~ # pciconf -lv
none0@pci0:0:2:0:       class=0x010802 rev=0x03 hdr=0x00 vendor=0x126f device=0x2263 subvendor=0x126f subdevice=0x2263
    vendor     = 'Silicon Motion, Inc.'
    device     = 'SM2263EN/SM2263XT SSD Controller'
    class      = mass storage
    subclass   = NVM
none1@pci0:0:3:0:       class=0x010802 rev=0x03 hdr=0x00 vendor=0x126f device=0x2263 subvendor=0x126f subdevice=0x2263
    vendor     = 'Silicon Motion, Inc.'
    device     = 'SM2263EN/SM2263XT SSD Controller'
    class      = mass storage
    subclass   = NVM
none2@pci0:0:18:0:      class=0x010802 rev=0x03 hdr=0x00 vendor=0x126f device=0x2263 subvendor=0x126f subdevice=0x2263
    vendor     = 'Silicon Motion, Inc.'
    device     = 'SM2263EN/SM2263XT SSD Controller'
    class      = mass storage
    subclass   = NVM
none3@pci0:0:19:0:      class=0x010802 rev=0x03 hdr=0x00 vendor=0x126f device=0x2263 subvendor=0x126f subdevice=0x2263
    vendor     = 'Silicon Motion, Inc.'
    device     = 'SM2263EN/SM2263XT SSD Controller'
    class      = mass storage
    subclass   = NVM
root@Rock-5B:~ #

Hopefully, with the help of Radxa Team and Rockchip, we should have more HDMI. :sunglasses:

Latest update here

3 Likes

Any update for the HDMI support now? And really thanks for sharing the uefi repo. :slight_smile:

No news so far. We will ask about that (and PCIe support) in our next meeting.

2 Likes

I am currently checking the work of EDK2 to run Armbian. And I found some interesting nuances.

  1. The settings indicate a waiting time of 3 seconds, but in reality 10 seconds are used. a cursory analysis showed a line in which 10 seconds are indicated and if it is changed, the time changes. It is possible that the processing of variables from the general settings file is triggered before the reconfiguration is performed.

  2. The RAM size is limited to 8 GB. Even if you change the settings in the general settings file, it doesn’t change anything.

1 Like

@balbes-150
Yes, indeed the maximum memory size is 8Gbyte.
And a change in the configuration files does not affect this, it is not clear how to fix it.

I looked at the EDK2 code for rk356x, the RAM size is automatically determined there (I’m studying the commit that does it there), maybe there’s a chance to try using these algorithms for rk3588 as well?

I figured out the USB, found the reason.

p.s. By the way, I took your screensaver designs for Station and used them in my builds, I hope you don’t mind? :slight_smile:

In my opinion, this commit ruined the work of USB.

As the classic said.
“Хотели как лучше, получилось - как всегда”
"Никогда такого не было, и вот ОПЯТЬ.
:joy:

Откатил этот PR, и заодно убрал комент в Dsdt.asl с usb2. загрузка пошла , но виснет в процессе запуска системы.

Если ты запускаешься в режиме FDT - тебе нужен правильный DTB файл, если в режиме ACPI,
я сильно сомневаюсь. Я на всякий случая откатываю и коммит который удаляет DTB.
Я запускаю FreeBSD с USB в режиме ACPI, так как у меня ещё нет полной поддержки RK3588