]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tee: add a stub for tee_find_device
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Thu, 2 Sep 2021 09:56:17 +0000 (11:56 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 5 Oct 2021 12:44:48 +0000 (08:44 -0400)
Add stub for tee_find_device function when CONFIG_TEE is not activated
to simplify the caller code.

This patch allows to remove the CONFIG_IS_ENABLED(OPTEE) tests
for stm32 platform.

Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Acked-by: Etienne Carriere <etienne.carriere@inaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
arch/arm/mach-stm32mp/fdt.c
board/st/common/stm32mp_mtdparts.c
include/tee.h

index a19e954cf7aa2d82bdd87afca8f50607d9a64f30..91330a68a49f000a31b16bd78eda7b3302ec64c1 100644 (file)
@@ -341,7 +341,6 @@ int ft_system_setup(void *blob, struct bd_info *bd)
         * when FIP is not used by TF-A
         */
        if (CONFIG_IS_ENABLED(STM32MP15x_STM32IMAGE) &&
-           CONFIG_IS_ENABLED(OPTEE) &&
            !tee_find_device(NULL, NULL, NULL, NULL))
                stm32_fdt_disable_optee(blob);
 
index 8b636d62faf9f40d2fbb0cd116ab605e484dff3a..18878424c7a8eb24f6ebc5c94ca0939fe594cd98 100644 (file)
@@ -119,8 +119,7 @@ void board_mtdparts_default(const char **mtdids, const char **mtdparts)
        }
 
 #ifdef CONFIG_STM32MP15x_STM32IMAGE
-       if (!serial && CONFIG_IS_ENABLED(OPTEE) &&
-           tee_find_device(NULL, NULL, NULL, NULL))
+       if (!serial && tee_find_device(NULL, NULL, NULL, NULL))
                tee = true;
 #endif
 
index 2ef29bfc8fa93bcc507686ed5e5fed23dc9b01da..44e9cd4321bcab2a0b7d2385655943c0651b519c 100644 (file)
@@ -307,11 +307,22 @@ bool tee_shm_is_registered(struct tee_shm *shm, struct udevice *dev);
  * Returns a probed TEE device of the first TEE device matched by the
  * match() callback or NULL.
  */
+#if CONFIG_IS_ENABLED(TEE)
 struct udevice *tee_find_device(struct udevice *start,
                                int (*match)(struct tee_version_data *vers,
                                             const void *data),
                                const void *data,
                                struct tee_version_data *vers);
+#else
+static inline struct udevice *tee_find_device(struct udevice *start,
+                                             int (*match)(struct tee_version_data *vers,
+                                                          const void *data),
+                                             const void *data,
+                                             struct tee_version_data *vers)
+{
+       return NULL;
+}
+#endif
 
 /**
  * tee_get_version() - Query capabilities of TEE device