diff options
author | Andrew F. Davis <afd@ti.com> | 2020-01-03 00:19:41 +0300 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2020-01-13 21:06:25 +0300 |
commit | dbebc8bfe9dcb760b72ec7e2bb9de30a174ff8dc (patch) | |
tree | d228822cb180b38dd4525bf38be207c3b897c39d /arch/arm/mach-omap2/omap-secure.c | |
parent | db711893eac81442fb5cde3801e183d3abfe5693 (diff) | |
download | linux-dbebc8bfe9dcb760b72ec7e2bb9de30a174ff8dc.tar.xz |
ARM: OMAP2+: Introduce check for OP-TEE in omap_secure_init()
This check and associated flag can be used to signal the presence
of OP-TEE on the platform. This can be used to determine which
SMC calls to make to perform secure operations.
Signed-off-by: Andrew F. Davis <afd@ti.com>
Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap2/omap-secure.c')
-rw-r--r-- | arch/arm/mach-omap2/omap-secure.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/mach-omap2/omap-secure.c b/arch/arm/mach-omap2/omap-secure.c index e936732cdc4f..568646660081 100644 --- a/arch/arm/mach-omap2/omap-secure.c +++ b/arch/arm/mach-omap2/omap-secure.c @@ -12,6 +12,7 @@ #include <linux/init.h> #include <linux/io.h> #include <linux/memblock.h> +#include <linux/of.h> #include <asm/cacheflush.h> #include <asm/memblock.h> @@ -20,6 +21,23 @@ static phys_addr_t omap_secure_memblock_base; +bool optee_available; + +static void __init omap_optee_init_check(void) +{ + struct device_node *np; + + /* + * We only check that the OP-TEE node is present and available. The + * OP-TEE kernel driver is not needed for the type of interaction made + * with OP-TEE here so the driver's status is not checked. + */ + np = of_find_node_by_path("/firmware/optee"); + if (np && of_device_is_available(np)) + optee_available = true; + of_node_put(np); +} + /** * omap_sec_dispatcher: Routine to dispatch low power secure * service routines @@ -166,4 +184,5 @@ u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag) void __init omap_secure_init(void) { + omap_optee_init_check(); } |