From c71572aa544ca64cbd2ff2052c79bc7e3573baed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= Date: Mon, 6 Jun 2022 16:57:00 +0200 Subject: [PATCH] ARM: at91: add sam_linux_is_optee_available() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add sam_linux_is_optee_available() which allows to know if OP-TEE is available for Linux. This function is used by code which needs to know if we running with OP-TEE available or not. Signed-off-by: Clément Léger [claudiu.beznea: edit commit title and message, renamed sam_linux_is_in_normal_world() into sam_linux_is_optee_available()] Signed-off-by: Claudiu Beznea Link: https://lore.kernel.org/r/20220606145701.185552-2-clement.leger@bootlin.com --- arch/arm/mach-at91/sam_secure.c | 6 ++++++ arch/arm/mach-at91/sam_secure.h | 1 + 2 files changed, 7 insertions(+) diff --git a/arch/arm/mach-at91/sam_secure.c b/arch/arm/mach-at91/sam_secure.c index 2a01f7a7d13fc..f7789cbe289f9 100644 --- a/arch/arm/mach-at91/sam_secure.c +++ b/arch/arm/mach-at91/sam_secure.c @@ -27,6 +27,12 @@ struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1) return res; } +bool sam_linux_is_optee_available(void) +{ + /* If optee has been detected, then we are running in normal world */ + return optee_available; +} + void __init sam_secure_init(void) { struct device_node *np; diff --git a/arch/arm/mach-at91/sam_secure.h b/arch/arm/mach-at91/sam_secure.h index 1e7d8b20ba1ea..1a0b5ebbfc397 100644 --- a/arch/arm/mach-at91/sam_secure.h +++ b/arch/arm/mach-at91/sam_secure.h @@ -14,5 +14,6 @@ void __init sam_secure_init(void); struct arm_smccc_res sam_smccc_call(u32 fn, u32 arg0, u32 arg1); +bool sam_linux_is_optee_available(void); #endif /* SAM_SECURE_H */