public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sumit Garg <sumit.garg@kernel.org>
To: u-boot-qcom@groups.io, u-boot@lists.denx.de
Cc: trini@konsulko.com, casey.connolly@linaro.org,
	neil.armstrong@linaro.org, jens.wiklander@linaro.org,
	ilias.apalodimas@linaro.org, jorge.ramirez@oss.qualcomm.com,
	varadarajan.narayanan@oss.qualcomm.com, tonyh@qti.qualcomm.com,
	Sumit Garg <sumit.garg@oss.qualcomm.com>
Subject: [PATCH v3 1/3] tee: optee: Export OP-TEE message UID check API
Date: Tue, 27 Jan 2026 11:53:39 +0530	[thread overview]
Message-ID: <20260127062341.723966-2-sumit.garg@kernel.org> (raw)
In-Reply-To: <20260127062341.723966-1-sumit.garg@kernel.org>

From: Sumit Garg <sumit.garg@oss.qualcomm.com>

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>
---
 drivers/tee/optee/core.c | 5 +++++
 include/tee/optee.h      | 9 +++++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c
index 5fc0505c788..4d67c948ec1 100644
--- a/drivers/tee/optee/core.c
+++ b/drivers/tee/optee/core.c
@@ -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);
diff --git a/include/tee/optee.h b/include/tee/optee.h
index 77729450bb6..d1194493780 100644
--- a/include/tee/optee.h
+++ b/include/tee/optee.h
@@ -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 */
-- 
2.51.0


  reply	other threads:[~2026-01-27  6:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-27  6:23 [PATCH v3 0/3] mach-snapdragon: Enable OP-TEE support Sumit Garg
2026-01-27  6:23 ` Sumit Garg [this message]
2026-02-09 18:53   ` [PATCH v3 1/3] tee: optee: Export OP-TEE message UID check API Casey Connolly
2026-01-27  6:23 ` [PATCH v3 2/3] mach-snapdragon: of_fixup: Add OP-TEE DT fixup support Sumit Garg
2026-02-09 18:49   ` Casey Connolly
2026-02-10  5:20     ` Sumit Garg
2026-01-27  6:23 ` [PATCH v3 3/3] board/qualcomm: Introduce TF-A and OP-TEE config fragment Sumit Garg
2026-02-09 18:53   ` Casey Connolly
2026-03-24 11:47 ` [PATCH v3 0/3] mach-snapdragon: Enable OP-TEE support Sumit Garg
2026-03-24 11:50   ` Casey Connolly
2026-04-06 12:40     ` Sumit Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260127062341.723966-2-sumit.garg@kernel.org \
    --to=sumit.garg@kernel.org \
    --cc=casey.connolly@linaro.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jens.wiklander@linaro.org \
    --cc=jorge.ramirez@oss.qualcomm.com \
    --cc=neil.armstrong@linaro.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=tonyh@qti.qualcomm.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=varadarajan.narayanan@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox