Merge tag 'u-boot-atmel-fixes-2020.07-a' of https://gitlab.denx.de/u-boot/custodians...
[oweals/u-boot.git] / arch / arm / mach-stm32mp / fdt.c
index ae82270e4241f0e8c0e388ace2004bab2bb5dbc6..c723b223e08258ff46112ef933f55d032bbae7cf 100644 (file)
@@ -5,6 +5,8 @@
 
 #include <common.h>
 #include <fdt_support.h>
+#include <log.h>
+#include <tee.h>
 #include <asm/arch/sys_proto.h>
 #include <dt-bindings/pinctrl/stm32-pinfunc.h>
 #include <linux/io.h>
@@ -322,7 +324,8 @@ int ft_system_setup(void *blob, bd_t *bd)
                                       "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;