From 54c896e0298a441338cd7d29f312ca590304f120 Mon Sep 17 00:00:00 2001 From: Ricardo Pardini Date: Sat, 11 Nov 2023 21:43:41 +0100 Subject: [PATCH] rk3588: configure UEFI_EDK2_BOARD_ID for all UEFI-supported boards - From https://github.com/edk2-porting/edk2-rk3588/releases/tag/v0.9.1 - For example, for `rock-5b_UEFI_Release_v0.9.1.img` - `UEFI_EDK2_BOARD_ID` is `rock-5b` - **Important**: this has no effect unless optional extension is enabled - to test this out: - make sure to read carefully the instructions at https://github.com/edk2-porting/edk2-rk3588/blob/master/README.md - suppose you previously built the regular u-boot version with: - `./compile.sh BOARD=rock-5b BRANCH=legacy RELEASE=jammy` - now you can build the UEFI version with: - `./compile.sh BOARD=rock-5b BRANCH=legacy RELEASE=jammy EXT=uefi-edk2-rk3588` - write the produced image to SD or eMMC and boot it - use normally, or enter "UMS" mode by selecting that option in the grub menu - You can write image to eMMC, boot it, enter UMS, write it again to NVMe, reboot, press in UEFI and boot from NVMe - Also works if .img is written to eg USB stick, and UEFI edk2 is separately deployed to SPI flash - **Important**: make _absolutely_ sure you are able to force Maskrom mode (by shorting pins, pressing buttons, etc) before writing an UEFI image to eMMC; UEFI has no RockUSB ("Loader mode" support) at all. The new "initramfs-usb-gadget-ums" extension hopes to address this, but it is not guaranteed to work. --- config/boards/hinlink-h88k.csc | 3 ++- config/boards/indiedroid-nova.csc | 1 + config/boards/khadas-edge2.conf | 1 + config/boards/mekotronics-r58-minipc.wip | 1 + config/boards/mekotronics-r58x-4g.wip | 1 + config/boards/mekotronics-r58x-pro.csc | 1 + config/boards/mekotronics-r58x.wip | 1 + config/boards/mixtile-blade3.wip | 1 + config/boards/nanopct6.wip | 3 ++- config/boards/nanopi-r6s.conf | 3 ++- config/boards/orangepi5-plus.conf | 2 +- config/boards/orangepi5.conf | 5 +++-- config/boards/rock-5a.wip | 3 ++- config/boards/rock-5b.conf | 1 + 14 files changed, 20 insertions(+), 7 deletions(-) diff --git a/config/boards/hinlink-h88k.csc b/config/boards/hinlink-h88k.csc index 26e909fbb3..528b68d0c0 100644 --- a/config/boards/hinlink-h88k.csc +++ b/config/boards/hinlink-h88k.csc @@ -9,7 +9,8 @@ BOOT_LOGO="desktop" BOOT_FDT_FILE="rockchip/rk3588-hinlink-h88k.dtb" BOOT_SCENARIO="spl-blobs" IMAGE_PARTITION_TABLE="gpt" -SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes +SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes +declare -g UEFI_EDK2_BOARD_ID="h88k" # This _only_ used for uefi-edk2-rk3588 extension function post_family_tweaks__hinlink_h88k_naming_audios() { display_alert "$BOARD" "Renaming hinlink-h88k audios" "info" diff --git a/config/boards/indiedroid-nova.csc b/config/boards/indiedroid-nova.csc index 4438960aea..3778654e34 100644 --- a/config/boards/indiedroid-nova.csc +++ b/config/boards/indiedroid-nova.csc @@ -16,6 +16,7 @@ declare -g BOOTFS_TYPE="fat" declare -g SRC_EXTLINUX="no" # going back to standard uboot for now declare -g BL31_BLOB='rk35/rk3588_bl31_v1.38.elf' declare -g DDR_BLOB='rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.11.bin' +declare -g UEFI_EDK2_BOARD_ID="indiedroid-nova" # This _only_ used for uefi-edk2-rk3588 extension ## only applies to extlinux so not used declare -g SRC_CMDLINE="console=ttyS0,115200n8 console=tty1 console=both net.ifnames=0 rootflags=data=writeback" diff --git a/config/boards/khadas-edge2.conf b/config/boards/khadas-edge2.conf index 972b51eb64..7ac81a4fbd 100644 --- a/config/boards/khadas-edge2.conf +++ b/config/boards/khadas-edge2.conf @@ -11,6 +11,7 @@ declare -g BLUETOOTH_HCIATTACH_PARAMS="-s 115200 /dev/ttyS9 bcm43xx 1500000" # F enable_extension "bluetooth-hciattach" # Enable the bluetooth-hciattach extension declare -g KHADAS_OOWOW_BOARD_ID="Edge2" # for use with EXT=output-image-oowow +declare -g UEFI_EDK2_BOARD_ID="edge2" # This _only_ used for uefi-edk2-rk3588 extension # for the kedge2, we're counting on the blobs+u-boot in SPI working, as it comes from factory. It does not support bootscripts. function post_family_config_branch_legacy__uboot_kedge2() { diff --git a/config/boards/mekotronics-r58-minipc.wip b/config/boards/mekotronics-r58-minipc.wip index 8029507069..2fd22de405 100644 --- a/config/boards/mekotronics-r58-minipc.wip +++ b/config/boards/mekotronics-r58-minipc.wip @@ -4,6 +4,7 @@ declare -g BOARDFAMILY="rockchip-rk3588" declare -g BOARD_MAINTAINER="monkaBlyat" declare -g KERNEL_TARGET="legacy" declare -g BOOT_FDT_FILE="rockchip/rk3588-blueberry-minipc-linux.dtb" # Specific to this board +declare -g UEFI_EDK2_BOARD_ID="r58-mini" # This _only_ used for uefi-edk2-rk3588 extension # Source vendor-specific configuration source "${SRC}/config/sources/vendors/mekotronics/mekotronics-rk3588.conf.sh" diff --git a/config/boards/mekotronics-r58x-4g.wip b/config/boards/mekotronics-r58x-4g.wip index e4d6805140..4320335d66 100644 --- a/config/boards/mekotronics-r58x-4g.wip +++ b/config/boards/mekotronics-r58x-4g.wip @@ -4,6 +4,7 @@ declare -g BOARDFAMILY="rockchip-rk3588" declare -g BOARD_MAINTAINER="monkaBlyat" declare -g KERNEL_TARGET="legacy" declare -g BOOT_FDT_FILE="rockchip/rk3588-blueberry-edge-v12-linux.dtb" # Specific to this board +declare -g UEFI_EDK2_BOARD_ID="r58x" # This _only_ used for uefi-edk2-rk3588 extension # Source vendor-specific configuration source "${SRC}/config/sources/vendors/mekotronics/mekotronics-rk3588.conf.sh" diff --git a/config/boards/mekotronics-r58x-pro.csc b/config/boards/mekotronics-r58x-pro.csc index bc0672e3fa..5ad059ba29 100644 --- a/config/boards/mekotronics-r58x-pro.csc +++ b/config/boards/mekotronics-r58x-pro.csc @@ -4,6 +4,7 @@ declare -g BOARDFAMILY="rockchip-rk3588" declare -g BOARD_MAINTAINER="" declare -g KERNEL_TARGET="legacy" declare -g BOOT_FDT_FILE="rockchip/rk3588-blueberry-edge-v12-maizhuo-linux.dtb" # Specific to this board +declare -g UEFI_EDK2_BOARD_ID="r58x" # This _only_ used for uefi-edk2-rk3588 extension # Source vendor-specific configuration source "${SRC}/config/sources/vendors/mekotronics/mekotronics-rk3588.conf.sh" diff --git a/config/boards/mekotronics-r58x.wip b/config/boards/mekotronics-r58x.wip index ef8a4868f8..dec9319519 100644 --- a/config/boards/mekotronics-r58x.wip +++ b/config/boards/mekotronics-r58x.wip @@ -4,6 +4,7 @@ declare -g BOARDFAMILY="rockchip-rk3588" declare -g BOARD_MAINTAINER="monkaBlyat" declare -g KERNEL_TARGET="legacy" declare -g BOOT_FDT_FILE="rockchip/rk3588-blueberry-edge-v10-linux.dtb" # Specific to this board +declare -g UEFI_EDK2_BOARD_ID="r58x" # This _only_ used for uefi-edk2-rk3588 extension # Source vendor-specific configuration source "${SRC}/config/sources/vendors/mekotronics/mekotronics-rk3588.conf.sh" diff --git a/config/boards/mixtile-blade3.wip b/config/boards/mixtile-blade3.wip index f004ca2d37..ed2c1addc7 100644 --- a/config/boards/mixtile-blade3.wip +++ b/config/boards/mixtile-blade3.wip @@ -9,6 +9,7 @@ declare -g BOOT_SCENARIO="spl-blobs" # so we don't depend on defconfig naming co declare -g BOOT_SOC="rk3588" # so we don't depend on defconfig naming convention declare -g BOOTCONFIG="blade3_defconfig" declare -g IMAGE_PARTITION_TABLE="gpt" +declare -g UEFI_EDK2_BOARD_ID="blade3" # This _only_ used for uefi-edk2-rk3588 extension # newer blobs from rockchip. tested to work. # set as variables, early, so they're picked up by `prepare_boot_configuration()` diff --git a/config/boards/nanopct6.wip b/config/boards/nanopct6.wip index c8851a0a34..53cdcf53ce 100644 --- a/config/boards/nanopct6.wip +++ b/config/boards/nanopct6.wip @@ -14,12 +14,13 @@ BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes BOOTFS_TYPE="fat" +declare -g UEFI_EDK2_BOARD_ID="nanopc-t6" # This _only_ used for uefi-edk2-rk3588 extension function post_family_tweaks__nanopct6_naming_audios() { display_alert "$BOARD" "Renaming nanopct6 audio" "info" mkdir -p $SDCARD/etc/udev/rules.d/ - echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' >$SDCARD/etc/udev/rules.d/90-naming-audios.rules + echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' > $SDCARD/etc/udev/rules.d/90-naming-audios.rules return 0 } diff --git a/config/boards/nanopi-r6s.conf b/config/boards/nanopi-r6s.conf index c9607fe4db..1e5025cc88 100644 --- a/config/boards/nanopi-r6s.conf +++ b/config/boards/nanopi-r6s.conf @@ -14,12 +14,13 @@ SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes BOOTFS_TYPE="fat" DDR_BLOB='rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.11.bin' BL31_BLOB='rk35/rk3588_bl31_v1.38.elf' +declare -g UEFI_EDK2_BOARD_ID="nanopi-r6s" # This _only_ used for uefi-edk2-rk3588 extension function post_family_tweaks__nanopir6s_naming_audios() { display_alert "$BOARD" "Renaming nanopir6s audio" "info" mkdir -p $SDCARD/etc/udev/rules.d/ - echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' >$SDCARD/etc/udev/rules.d/90-naming-audios.rules + echo 'SUBSYSTEM=="sound", ENV{ID_PATH}=="platform-hdmi0-sound", ENV{SOUND_DESCRIPTION}="HDMI0 Audio"' > $SDCARD/etc/udev/rules.d/90-naming-audios.rules return 0 } diff --git a/config/boards/orangepi5-plus.conf b/config/boards/orangepi5-plus.conf index d786d10768..61529cfbc8 100644 --- a/config/boards/orangepi5-plus.conf +++ b/config/boards/orangepi5-plus.conf @@ -15,7 +15,7 @@ BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes BOOTFS_TYPE="ext4" - +declare -g UEFI_EDK2_BOARD_ID="orangepi-5plus" # This _only_ used for uefi-edk2-rk3588 extension function post_family_tweaks__orangepi5plus_naming_audios() { display_alert "$BOARD" "Renaming orangepi5 audios" "info" diff --git a/config/boards/orangepi5.conf b/config/boards/orangepi5.conf index 3977e4c099..35dd32075b 100644 --- a/config/boards/orangepi5.conf +++ b/config/boards/orangepi5.conf @@ -18,12 +18,13 @@ SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes BOOTFS_TYPE="fat" DDR_BLOB='rk35/rk3588_ddr_lp4_2112MHz_lp5_2736MHz_v1.11.bin' BL31_BLOB='rk35/rk3588_bl31_v1.38.elf' +declare -g UEFI_EDK2_BOARD_ID="orangepi-5" # This _only_ used for uefi-edk2-rk3588 extension declare -g BLUETOOTH_HCIATTACH_PARAMS="-s 115200 /dev/ttyS9 bcm43xx 1500000" # For the bluetooth-hciattach extension enable_extension "bluetooth-hciattach" # Enable the bluetooth-hciattach extension function post_family_tweaks_bsp__orangepi5_copy_usb2_service() { - display_alert "Installing BSP firmware and fixups" + display_alert "Installing BSP firmware and fixups" # Add USB2 init service. Otherwise, USB2 and TYPE-C won't work by default cp $SRC/packages/bsp/orangepi5/orangepi5-usb2-init.service $destination/lib/systemd/system/ @@ -32,7 +33,7 @@ function post_family_tweaks_bsp__orangepi5_copy_usb2_service() { } function post_family_tweaks__orangepi5_enable_usb2_service() { - display_alert "$BOARD" "Installing board tweaks" "info" + display_alert "$BOARD" "Installing board tweaks" "info" # enable usb2 init service chroot $SDCARD /bin/bash -c "systemctl --no-reload enable orangepi5-usb2-init.service >/dev/null 2>&1" diff --git a/config/boards/rock-5a.wip b/config/boards/rock-5a.wip index d38fd3f63d..5f39ef361c 100644 --- a/config/boards/rock-5a.wip +++ b/config/boards/rock-5a.wip @@ -12,7 +12,8 @@ BOOT_SOC="rk3588" BOOT_SUPPORT_SPI="yes" BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" -SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes +SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes +declare -g UEFI_EDK2_BOARD_ID="rock-5a" # This _only_ used for uefi-edk2-rk3588 extension function post_family_tweaks__rock5a_naming_audios() { display_alert "$BOARD" "Renaming rock5a audios" "info" diff --git a/config/boards/rock-5b.conf b/config/boards/rock-5b.conf index 04528d1ba8..ccb8726ea3 100644 --- a/config/boards/rock-5b.conf +++ b/config/boards/rock-5b.conf @@ -14,6 +14,7 @@ BOOT_SPI_RKSPI_LOADER="yes" IMAGE_PARTITION_TABLE="gpt" SKIP_BOOTSPLASH="yes" # Skip boot splash patch, conflicts with CONFIG_VT=yes BOOTFS_TYPE="ext4" +declare -g UEFI_EDK2_BOARD_ID="rock-5b" # This _only_ used for uefi-edk2-rk3588 extension function post_family_tweaks__rock5b_naming_audios() { display_alert "$BOARD" "Renaming rock5b audios" "info"