Tidy up some dangling OP-TEE gotchas
cover Tidy up some dangling OP-TEE gotchas
Rober P Day rightly pointed out that some odd OP-TEE specific defines were appearing in his defconfig, despite not having CONFIG_OPTEE=y set in his defconfig.
Looking into this with a small bit of restructure we can fix this corner case.
- Make sure OP-TEE CONFIG options only appear when you are compiling for OPTEE
- Fix WaRP7 BL33 so that the low-level init skipping routines can tolerate the afore mentioned change.
- Update MAINTAINERS with my own details so that questions pertaining to lib/optee comes my way.
Bryan O'Donoghue (4):
optee: Make TZDRAM config options contingent on CONFIG_OPTEE
warp7: include: configs: Skip low-level init if BOOTM_OPTEE false
warp7: configs: bl33: Tidy up OPTEE defines
MAINTAINERS: Update lib/optee with my details
MAINTAINERS | 5 +++++ configs/warp7_bl33_defconfig | 4 +++- include/configs/warp7.h | 4 +--- lib/optee/Kconfig | 2 ++ 4 files changed, 11 insertions(+), 4 deletions(-)
Signature · 1 line
2.20.1
PATCH 1/4 optee: Make TZDRAM config options contingent on CONFIG_OPTEE
Commit c7b3a7ee5351 ("optee: adjust dependencies and default values for dram") makes the TZDRAM defines for OPTEE show up for all configs as a side-effect. While not harmful its not what we really want.
This patch makes the following defines contingent on CONFIG_OPTEE=y
CONFIG_OPTEE_TZDRAM_BASECONFIG_OPTEE_TZDRAM_SIZE
Rightly, if you don't have CONFIG_OPTEE=y you don't care about the above two defines.
--- lib/optee/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
lib/optee/Kconfig +2 -0
@@ -17,6 +17,7 @@ config OPTEE_LOAD_ADDR config OPTEE_TZDRAM_SIZE hex "Amount of Trust-Zone RAM for the OPTEE image" default 0x0000000 + depends on OPTEE help The size of pre-allocated Trust Zone DRAM to allocate for the OPTEE runtime.
@@ -24,6 +25,7 @@ config OPTEE_TZDRAM_SIZE config OPTEE_TZDRAM_BASE hex "Base address of Trust-Zone RAM for the OPTEE image" default 0x00000000 + depends on OPTEE help The base address of pre-allocated Trust Zone DRAM for the OPTEE runtime.
Signature · 1 line
2.20.1
PATCH 2/4 warp7: include: configs: Skip low-level init if BOOTM_OPTEE false
In reply to Bryan O'DonoghueCommit c7b3a7ee5351 ("optee: adjust dependencies and default values for dram") wants to skip low-level init of i.MX7 hardware in the case where OP-TEE has already run and u-boot is being run as BL33 in normal world.
Currently we check for both #ifdef CONFIG_OPTEE_TZDRAM_SIZE and #ifndef CONFIG_OPTEE to determine if lowlevel init should be skipped, however, in order to ensure non-OPTEE users never see OPTEE related defines we cannot rely on this method.
Fortunately we can use CONFIG_BOOTM_OPTEE for the same purpose. CONFIG_BOOTM_OPTEE is only relevant if you want u-boot to load OP-TEE not if u-boot has already been loaded by OP-TEE.
--- include/configs/warp7.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
include/configs/warp7.h +1 -3
@@ -18,11 +18,9 @@* launched by OPTEE, because of that we shall skip all the low level * initialization since it was already done by ATF or OPTEE */ -#ifdef CONFIG_OPTEE_TZDRAM_SIZE -#ifndef CONFIG_OPTEE +#ifndef CONFIG_BOOTM_OPTEE #define CONFIG_SKIP_LOWLEVEL_INIT #endif -#endif #define CONFIG_MXC_UART_BASE UART1_IPS_BASE_ADDR
Signature · 1 line
2.20.1
PATCH 3/4 warp7: configs: bl33: Tidy up OPTEE defines
In reply to Bryan O'DonoghueWhen booting in BL33 mode i.e. with u-boot loaded by OP-TEE we get the following print-out.
Board: WARP7 in secure mode OPTEE DRAM 0xa0000000-0xa0000000
This is incorrect the right range is 0x9e000000-0xa0000000. This patch fixes the defines on the warp7_bl33_defconfig file to tidy up the output.
--- configs/warp7_bl33_defconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
configs/warp7_bl33_defconfig +3 -1
@@ -50,4 +50,6 @@ 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_TZDRAM_SIZE=0x2000000 +CONFIG_OPTEE=y +CONFIG_OPTEE_TZDRAM_BASE=0x9e000000 +CONFIG_OPTEE_TZDRAM_SIZE=0x02000000
Signature · 1 line
2.20.1
PATCH 4/4 MAINTAINERS: Update lib/optee with my details
In reply to Bryan O'DonoghueCommit 32ce6179fb99 ("optee: Add lib entries for sharing OPTEE code across ports") adds code into lib/optee but neglects to update MAINTAINERS to make me buggable for questions and maintenance.
--- MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+)
MAINTAINERS +5 -0
@@ -754,6 +754,11 @@ F: drivers/tee/ F: include/tee.h F: include/tee/ +TEE-lib +M: Bryan O'Donoghue <[email protected]> +S: Maintained +F: lib/optee + UBI M: Kyungmin Park <[email protected]> M: Heiko Schocher <[email protected]>
Signature · 1 line
2.20.1
cover Tidy up some dangling OP-TEE gotchas
In reply to Bryan O'DonoghueQuoted 3 lines · Bryan O'Donoghue
Rober P Day rightly pointed out that some odd OP-TEE specific defines were appearing in his defconfig, despite not having
CONFIG_OPTEE=yset in his defconfig.
Ping,
Robert, Rui, Fabio - do you guys want changes here ?
---
bod
cover Tidy up some dangling OP-TEE gotchas
Hi Bryan,
Quoted 8 lines · Bryan O'Donoghue
Quoted 3 lines · Bryan O'Donoghue
Rober P Day rightly pointed out that some odd OP-TEE specific defines were appearing in his defconfig, despite not having
CONFIG_OPTEE=yset in his defconfig.Ping,
Robert, Rui, Fabio - do you guys want changes here ?
Regarding OPTEE, patches 1/4 and 2/4:
---
Cheers,
Rui
cover Tidy up some dangling OP-TEE gotchas
In reply to Bryan O'DonoghueQuoted 11 lines · Bryan O'Donoghue
Quoted 3 lines · Bryan O'Donoghue
Rober P Day rightly pointed out that some odd OP-TEE specific defines were appearing in his defconfig, despite not having
CONFIG_OPTEE=yset in his defconfig.Ping,
Robert, Rui, Fabio - do you guys want changes here ?
Looks good to me.