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>
diff --git a/arch/arm/mach-stm32mp/fdt.c b/arch/arm/mach-stm32mp/fdt.c
index ae82270..21b5f09 100644
--- a/arch/arm/mach-stm32mp/fdt.c
+++ b/arch/arm/mach-stm32mp/fdt.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <fdt_support.h>
+#include <tee.h>
#include <asm/arch/sys_proto.h>
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
#include <linux/io.h>
@@ -322,7 +323,8 @@
"st,package", pkg, false);
}
- if (!CONFIG_IS_ENABLED(STM32MP1_OPTEE))
+ if (!CONFIG_IS_ENABLED(OPTEE) ||
+ !tee_find_device(NULL, NULL, NULL, NULL))
stm32_fdt_disable_optee(blob);
return ret;