From: Alexandru Gagniuc Date: Tue, 7 Sep 2021 17:07:08 +0000 (-0500) Subject: lib: optee: Remove CONFIG_OPTEE_LOAD_ADDR X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=f6953047cb99d50cca0dc73740337b08fbdc1bf8;p=u-boot.git lib: optee: Remove CONFIG_OPTEE_LOAD_ADDR This value is not used by u-boot, and it should not. The load address of an OPTEE image is defined by said image. Either a uImage or a FIT will have a defined load address and entry point. Those values are the correct ones, not CONFIG_OPTEE_LOAD_ADDR. Commit f25006b96e9f ("optee: Add CONFIG_OPTEE_LOAD_ADDR") justifies this config by requiring its presence in u-boot's .config for other images as part of a larger build, claiming it is "the best way". This argument is not persuasive. U-boot's configuration is driven by platform requirements, not the other way around. It seems more likely that the argument is conflating tooling issues with Kconfig. Yocto and buildroot have excellent mechanisms for defining values across the board (pun intended). u-boot's Kconfig is the wrong place to do it. Furthermore, it is not "best" for u-boot because it hardcodes a value which is then not used. In fact the load address that u-boot uses is the one derived from the OPTEE image. Confused yet? I sure was. To prevent future confusion, remove CONFIG_OPTEE_LOAD_ADDR. Signed-off-by: Alexandru Gagniuc --- diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig index 27529dd991..db8d4f625a 100644 --- a/configs/warp7_defconfig +++ b/configs/warp7_defconfig @@ -73,6 +73,5 @@ CONFIG_USB_GADGET_DOWNLOAD=y CONFIG_USB_ETHER=y CONFIG_USB_ETH_CDC=y CONFIG_USBNET_HOST_ADDR="de:ad:be:af:00:00" -CONFIG_OPTEE_LOAD_ADDR=0x84000000 CONFIG_OPTEE_TZDRAM_SIZE=0x3000000 CONFIG_BOOTM_OPTEE=y diff --git a/include/configs/warp7.h b/include/configs/warp7.h index 0822eaf555..74fb988b76 100644 --- a/include/configs/warp7.h +++ b/include/configs/warp7.h @@ -28,10 +28,6 @@ #define BOOT_SCR_STRING "source ${bootscriptaddr}\0" #endif -#ifndef CONFIG_OPTEE_LOAD_ADDR -#define CONFIG_OPTEE_LOAD_ADDR 0 -#endif - #define CONFIG_EXTRA_ENV_SETTINGS \ CONFIG_DFU_ENV_SETTINGS \ "script=boot.scr\0" \ @@ -46,7 +42,6 @@ "fdt_file=imx7s-warp.dtb\0" \ "fdt_addr=" __stringify(CONFIG_SYS_FDT_ADDR)"\0" \ "fdtovaddr=0x83100000\0" \ - "optee_addr=" __stringify(CONFIG_OPTEE_LOAD_ADDR)"\0" \ "boot_fdt=try\0" \ "ip_dyn=yes\0" \ "mmcdev="__stringify(CONFIG_SYS_MMC_ENV_DEV)"\0" \ diff --git a/lib/optee/Kconfig b/lib/optee/Kconfig index 3f8ce49678..e6834d4d3e 100644 --- a/lib/optee/Kconfig +++ b/lib/optee/Kconfig @@ -11,13 +11,6 @@ config OPTEE_IMAGE This option enable the OPTEE specific checks done before booting an OPTEE image created with mkimage -config OPTEE_LOAD_ADDR - hex "OPTEE load address" - default 0x00000000 - depends on OPTEE_LIB - help - The load address of the bootable OPTEE binary. - config OPTEE_TZDRAM_SIZE hex "Amount of Trust-Zone RAM for the OPTEE image" default 0x0000000