From c891ad99f8de6cfee754eb38ec9c8deceed49912 Mon Sep 17 00:00:00 2001 From: Stijn Tintel Date: Tue, 18 Mar 2025 10:56:25 +0200 Subject: [PATCH] arm-trusted-firmware-rockchip: support rk3588 ATF supports rk3588 since version 2.12, so let's enable it in arm-trusted-firmware-rockchip. We still need the TPL to initialize RAM, but keeping rk3588 in rkbin would cause a duplicate package name, so rename rk3588 to rk3588-tpl in rkbin. Finally, point uboot-rockchip for rk3588 to bl31 built by this package, and add a dependency on the new trusted-firmware-a-rk3588-tpl pacakge. While this doesn't necessarily add features, we now no longer rely on the rk3588_bl31_v1.45.elf blob provided by Rockchip, which is always a good thing. Tested on Radxa ROCK 5B+. Signed-off-by: Stijn Tintel --- package/boot/arm-trusted-firmware-rockchip/Makefile | 8 +++++++- package/boot/rkbin/Makefile | 7 ++++--- package/boot/uboot-rockchip/Makefile | 6 ++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/package/boot/arm-trusted-firmware-rockchip/Makefile b/package/boot/arm-trusted-firmware-rockchip/Makefile index b517c9e37d2..7ed8e9d328f 100644 --- a/package/boot/arm-trusted-firmware-rockchip/Makefile +++ b/package/boot/arm-trusted-firmware-rockchip/Makefile @@ -34,9 +34,15 @@ define Trusted-Firmware-A/rk3399 PLAT:=rk3399 endef +define Trusted-Firmware-A/rk3588 + BUILD_SUBTARGET:=armv8 + PLAT:=rk3588 +endef + TFA_TARGETS:= \ rk3328 \ - rk3399 + rk3399 \ + rk3588 ifeq ($(BUILD_VARIANT),rk3399) M0_GCC_NAME:=gcc-arm diff --git a/package/boot/rkbin/Makefile b/package/boot/rkbin/Makefile index d895c06547b..86b440692aa 100644 --- a/package/boot/rkbin/Makefile +++ b/package/boot/rkbin/Makefile @@ -57,9 +57,8 @@ define Trusted-Firmware-A/rk3568-e25 TPL:=rk35/rk3568_ddr_1560MHz_uart2_m0_115200_v1.21.bin endef -define Trusted-Firmware-A/rk3588 +define Trusted-Firmware-A/rk3588-tpl BUILD_SUBTARGET:=armv8 - ATF:=rk35/rk3588_bl31_v1.45.elf TPL:=rk35/rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin endef @@ -69,7 +68,7 @@ TFA_TARGETS:= \ rk3566 \ rk3568 \ rk3568-e25 \ - rk3588 + rk3588-tpl ifeq ($(BUILD_VARIANT),rk3308-rock-pi-s) TPL_FILE:=rk3308_ddr_589MHz_uart0_m0_v2.07.bin @@ -109,7 +108,9 @@ endef define Package/trusted-firmware-a/install $(INSTALL_DIR) $(STAGING_DIR_IMAGE) +ifneq ($(ATF),) $(CP) $(PKG_BUILD_DIR)/bin/$(ATF) $(STAGING_DIR_IMAGE)/ +endif $(CP) $(PKG_BUILD_DIR)/bin/$(TPL) $(STAGING_DIR_IMAGE)/ endef diff --git a/package/boot/uboot-rockchip/Makefile b/package/boot/uboot-rockchip/Makefile index ed93b63c343..a9367539aaf 100644 --- a/package/boot/uboot-rockchip/Makefile +++ b/package/boot/uboot-rockchip/Makefile @@ -247,8 +247,10 @@ endef define U-Boot/rk3588/Default BUILD_SUBTARGET:=armv8 - DEPENDS:=+PACKAGE_u-boot-$(1):trusted-firmware-a-rk3588 - ATF:=rk3588_bl31_v1.45.elf + DEPENDS:= \ + +PACKAGE_u-boot-$(1):trusted-firmware-a-rk3588 \ + +PACKAGE_u-boot-$(1):trusted-firmware-a-rk3588-tpl + ATF:=rk3588_bl31.elf TPL:=rk3588_ddr_lp4_2112MHz_lp5_2400MHz_v1.16.bin endef