diff options
author | Patrick Delaunay <patrick.delaunay@st.com> | 2020-03-18 09:22:49 +0100 |
---|---|---|
committer | Patrick Delaunay <patrick.delaunay@st.com> | 2020-05-14 09:02:12 +0200 |
commit | 43df0a159df6ef4c627553915634cd3d961d4da8 (patch) | |
tree | 698bab2f1c71d24866daffc5e16b39ed6846c2a9 /board | |
parent | 4a1b975dac0270f553f5a58b0e7d809c8c8ef61f (diff) | |
download | u-boot-43df0a159df6ef4c627553915634cd3d961d4da8.tar.gz |
stm32mp1: dynamically detect op-tee presence
Activate OP-TEE driver for trusted and optee defconfig.
This driver allows detection of TEE presence for boot from flash;
CONFIG_STM32MP1_OPTEE is also removed.
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/dhelectronics/dh_stm32mp1/board.c | 4 | ||||
-rw-r--r-- | board/st/common/stm32mp_mtdparts.c | 6 | ||||
-rw-r--r-- | board/st/stm32mp1/stm32mp1.c | 4 |
3 files changed, 6 insertions, 8 deletions
diff --git a/board/dhelectronics/dh_stm32mp1/board.c b/board/dhelectronics/dh_stm32mp1/board.c index 873fa86e53..ec1edd5c68 100644 --- a/board/dhelectronics/dh_stm32mp1/board.c +++ b/board/dhelectronics/dh_stm32mp1/board.c @@ -116,9 +116,7 @@ int checkboard(void) const char *fdt_compat; int fdt_compat_len; - if (IS_ENABLED(CONFIG_STM32MP1_OPTEE)) - mode = "trusted with OP-TEE"; - else if (IS_ENABLED(CONFIG_TFABOOT)) + if (IS_ENABLED(CONFIG_TFABOOT)) mode = "trusted"; else mode = "basic"; diff --git a/board/st/common/stm32mp_mtdparts.c b/board/st/common/stm32mp_mtdparts.c index d4c0a7db9f..2b6413be16 100644 --- a/board/st/common/stm32mp_mtdparts.c +++ b/board/st/common/stm32mp_mtdparts.c @@ -9,6 +9,7 @@ #include <env_internal.h> #include <mtd.h> #include <mtd_node.h> +#include <tee.h> #define MTDPARTS_LEN 256 #define MTDIDS_LEN 128 @@ -49,7 +50,7 @@ static void board_get_mtdparts(const char *dev, strncat(mtdparts, ",", MTDPARTS_LEN); } - if (CONFIG_IS_ENABLED(STM32MP1_OPTEE) && tee) { + if (tee) { strncat(mtdparts, tee, MTDPARTS_LEN); strncat(mtdparts, ",", MTDPARTS_LEN); } @@ -72,7 +73,8 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts) return; } - if (CONFIG_IS_ENABLED(STM32MP1_OPTEE)) + if (CONFIG_IS_ENABLED(OPTEE) && + tee_find_device(NULL, NULL, NULL, NULL)) tee = true; memset(parts, 0, sizeof(parts)); diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 3ccb12d817..496ca56a14 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -87,9 +87,7 @@ int checkboard(void) const char *fdt_compat; int fdt_compat_len; - if (IS_ENABLED(CONFIG_STM32MP1_OPTEE)) - mode = "trusted with OP-TEE"; - else if (IS_ENABLED(TFABOOT)) + if (IS_ENABLED(CONFIG_TFABOOT)) mode = "trusted"; else mode = "basic"; |