]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
tee: optee: Export OP-TEE message UID check API
authorSumit Garg <sumit.garg@oss.qualcomm.com>
Tue, 27 Jan 2026 06:23:39 +0000 (11:53 +0530)
committerCasey Connolly <casey.connolly@linaro.org>
Mon, 27 Apr 2026 10:38:44 +0000 (12:38 +0200)
OP-TEE message UID check API can be useful to know whether OP-TEE
is enabled on not assuming the corresponding SMC call is properly
handled if OP-TEE is not supported.

This API can be used by platform code to know OP-TEE presence and
on that basis OP-TEE DT node can be added as part of DT fixups for
the OP-TEE driver probe to happen for both U-Boot and Linux.

Signed-off-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Reviewed-by: Casey Connolly <casey.connolly@linaro.org>
Link: https://patch.msgid.link/20260127062341.723966-2-sumit.garg@kernel.org
Signed-off-by: Casey Connolly <casey.connolly@linaro.org>
drivers/tee/optee/core.c
include/tee/optee.h

index 5fc0505c788d8c031008b21460ed7c4f4957f081..4d67c948ec19f59a08d457cab3d7099bcf498e32 100644 (file)
@@ -795,6 +795,11 @@ static optee_invoke_fn *get_invoke_func(struct udevice *dev)
        return ERR_PTR(-EINVAL);
 }
 
+bool is_optee_smc_api(void)
+{
+       return is_optee_api(optee_smccc_smc);
+}
+
 static int optee_of_to_plat(struct udevice *dev)
 {
        struct optee_pdata *pdata = dev_get_plat(dev);
index 77729450bb6ba2c341cfd8b363d7ba796c5d5040..d119449378088ad1b0f6a9e0f9291e714837b1ce 100644 (file)
@@ -65,4 +65,13 @@ static inline int optee_copy_fdt_nodes(void *new_blob)
 }
 #endif
 
+#if defined(CONFIG_OPTEE)
+bool is_optee_smc_api(void);
+#else
+static inline bool is_optee_smc_api(void)
+{
+       return false;
+}
+#endif
+
 #endif /* _OPTEE_H */