diff mbox series

boot/uboot: make OP-TEE binary in U-Boot selectable

Message ID 20241014-optee-cleanup-v1-1-70a2fa042ba1@ti.com
State New
Headers show
Series boot/uboot: make OP-TEE binary in U-Boot selectable | expand

Commit Message

Bryan Brattlof Oct. 14, 2024, 8:07 p.m. UTC
There are a few different versions of OP-TEE we can select. Rather than
manually adding these in the BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS field,
allow them to be selectable from the U-Boot menu.

Signed-off-by: Bryan Brattlof <bb@ti.com>
---
 boot/uboot/Config.in             | 21 +++++++++++++++++----
 boot/uboot/uboot.mk              |  4 ++++
 configs/beagleboneai64_defconfig |  3 ++-
 configs/beagleplay_defconfig     |  3 ++-
 configs/ti_am62ax_sk_defconfig   |  3 ++-
 configs/ti_am62x_sk_defconfig    |  3 ++-
 configs/ti_am64x_sk_defconfig    |  3 ++-
 7 files changed, 31 insertions(+), 9 deletions(-)


---
base-commit: 0ad7035fce67cbe91db9dea7d81e6a4bc0691ad1
change-id: 20241014-optee-cleanup-1a7fcce5e828

Best regards,
diff mbox series

Patch

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index bfe61cd167d6b..3bc3853e855c7 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -268,13 +268,26 @@  config BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF
 endchoice
 
 config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE
-	bool "U-Boot needs OPTEE TEE"
+	bool "U-Boot needs OP-TEE"
 	depends on BR2_TARGET_OPTEE_OS_CORE
 	help
 	  Some platforms (such as Rockchip) encapsulate the TEE inside
-	  U-Boot. This option makes sure optee-os gets built prior to
-	  U-Boot, and that the TEE variable pointing to OPTEE's
-	  tee.elf, is passed during the Buildroot build.
+	  U-Boot. This option makes sure optee-os is built prior to
+	  U-Boot, and that the TEE variable, pointing to the OP-TEE
+	  binary, is passed during the Buildroot build.
+
+choice
+	prompt "U-Boot OP-TEE format"
+	default BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_ELF
+	depends on BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE
+
+config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_ELF
+	bool "tee.elf"
+
+config BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN
+	bool "tee-pager_v2.bin"
+
+endchoice
 
 config BR2_TARGET_UBOOT_NEEDS_OPENSBI
 	bool "U-Boot needs OpenSBI"
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index d8faef648fadd..f1caa59f331a8 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -196,7 +196,11 @@  endif
 
 ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE),y)
 UBOOT_DEPENDENCIES += optee-os
+ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_ELF),y)
 UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee.elf
+else ifeq ($(BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN),y)
+UBOOT_MAKE_OPTS += TEE=$(BINARIES_DIR)/tee-pager_v2.bin
+endif
 endif
 
 # TI K3 devices needs at least ti-sysfw (System Firmware) provided
diff --git a/configs/beagleboneai64_defconfig b/configs/beagleboneai64_defconfig
index 0429dd63e17c6..a7be263b3f846 100644
--- a/configs/beagleboneai64_defconfig
+++ b/configs/beagleboneai64_defconfig
@@ -37,12 +37,13 @@  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="j721e_beagleboneai64_a72"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN=y
 BR2_TARGET_UBOOT_USE_BINMAN=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="tispl.bin_unsigned"
-BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/beagleplay_defconfig b/configs/beagleplay_defconfig
index 42aa2fbd6ed20..4ba735c808062 100644
--- a/configs/beagleplay_defconfig
+++ b/configs/beagleplay_defconfig
@@ -42,6 +42,8 @@  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_beagleplay_a53"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN=y
 BR2_TARGET_UBOOT_USE_BINMAN=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_IMG=y
@@ -49,7 +51,6 @@  BR2_TARGET_UBOOT_FORMAT_CUSTOM=y
 BR2_TARGET_UBOOT_FORMAT_CUSTOM_NAME="u-boot.img_unsigned"
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="tispl.bin_unsigned"
-BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/ti_am62ax_sk_defconfig b/configs/ti_am62ax_sk_defconfig
index 77aa4a88e8ccd..bac4bab1ea7df 100644
--- a/configs/ti_am62ax_sk_defconfig
+++ b/configs/ti_am62ax_sk_defconfig
@@ -34,12 +34,13 @@  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62ax_evm_a53"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN=y
 BR2_TARGET_UBOOT_USE_BINMAN=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="tispl.bin"
-BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/ti_am62x_sk_defconfig b/configs/ti_am62x_sk_defconfig
index e11b803b73e43..e634cbc68dfe4 100644
--- a/configs/ti_am62x_sk_defconfig
+++ b/configs/ti_am62x_sk_defconfig
@@ -37,12 +37,13 @@  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am62x_evm_a53"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN=y
 BR2_TARGET_UBOOT_USE_BINMAN=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="tispl.bin"
-BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
diff --git a/configs/ti_am64x_sk_defconfig b/configs/ti_am64x_sk_defconfig
index a9ec5e3d536fd..c8c3f6f8bace3 100644
--- a/configs/ti_am64x_sk_defconfig
+++ b/configs/ti_am64x_sk_defconfig
@@ -37,12 +37,13 @@  BR2_TARGET_UBOOT_BOARD_DEFCONFIG="am64x_evm_a53"
 BR2_TARGET_UBOOT_NEEDS_DTC=y
 BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE=y
+BR2_TARGET_UBOOT_NEEDS_OPTEE_TEE_PAGER_V2_BIN=y
 BR2_TARGET_UBOOT_USE_BINMAN=y
 # BR2_TARGET_UBOOT_FORMAT_BIN is not set
 BR2_TARGET_UBOOT_FORMAT_IMG=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="tispl.bin"
-BR2_TARGET_UBOOT_CUSTOM_MAKEOPTS="TEE=$(BINARIES_DIR)/tee-pager_v2.bin"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y