public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alexandru Gagniuc <mr.nuke.me@gmail.com>
To: u-boot@lists.denx.de
Cc: Alexandru Gagniuc <mr.nuke.me@gmail.com>,
	patrick.delaunay@foss.st.com, etienne.carriere@linaro.org,
	sbabic@denx.de, festevam@gmail.com
Subject: [PATCH 3/4] lib: optee: Remove CONFIG_OPTEE_LOAD_ADDR
Date: Tue,  7 Sep 2021 12:07:08 -0500	[thread overview]
Message-ID: <20210907170709.2684890-4-mr.nuke.me@gmail.com> (raw)
In-Reply-To: <20210907170709.2684890-1-mr.nuke.me@gmail.com>

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 <mr.nuke.me@gmail.com>
---
 configs/warp7_defconfig | 1 -
 include/configs/warp7.h | 5 -----
 lib/optee/Kconfig       | 7 -------
 3 files changed, 13 deletions(-)

diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 1514019064..b872548464 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -71,6 +71,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 a5d52e3977..0df7e3b146 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -34,10 +34,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" \
@@ -52,7 +48,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 831e9f4ac6..26677b7548 100644
--- a/lib/optee/Kconfig
+++ b/lib/optee/Kconfig
@@ -7,13 +7,6 @@ config OPTEE
           OPTEE specific checks before booting an OPTEE image created with
           mkimage.
 
-config OPTEE_LOAD_ADDR
-	hex "OPTEE load address"
-	default 0x00000000
-	depends on OPTEE
-	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
-- 
2.31.1


  parent reply	other threads:[~2021-09-07 17:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 17:07 [PATCH 0/4] Repeal and replace TZDRAM_ related config options Alexandru Gagniuc
2021-09-07 17:07 ` [PATCH 1/4] lib: optee: Avoid CONFIG_TZDRAM_* in optee_verify_bootm_image() Alexandru Gagniuc
2021-10-05 22:01   ` Tom Rini
2021-09-07 17:07 ` [PATCH 2/4] lib: optee: Remove CONFIG_OPTEE_TZDRAM_BASE Alexandru Gagniuc
2021-10-05 22:01   ` Tom Rini
2021-09-07 17:07 ` Alexandru Gagniuc [this message]
2021-10-05 22:01   ` [PATCH 3/4] lib: optee: Remove CONFIG_OPTEE_LOAD_ADDR Tom Rini
2021-09-07 17:07 ` [PATCH 4/4] arm: imx: mx7: Move CONFIG_OPTEE_TZDRAM_SIZE from lib/optee Alexandru Gagniuc
2021-10-05 22:02   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210907170709.2684890-4-mr.nuke.me@gmail.com \
    --to=mr.nuke.me@gmail.com \
    --cc=etienne.carriere@linaro.org \
    --cc=festevam@gmail.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sbabic@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox