From 46a30aca7f5cbbb7f3f952634c7ebcb63014d520 Mon Sep 17 00:00:00 2001 From: Cedric Neveux Date: Tue, 23 Oct 2018 13:52:54 +0200 Subject: MLK-20052 L2 Cache TEE/Linux shared mutex Modification of the L2 Cache operations to use a TEE/Linux Shared mutex Signed-off-by: Cedric Neveux --- arch/arm/include/asm/outercache.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'arch/arm/include') diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h index c2bf24f40177..405ec8ddcd1a 100644 --- a/arch/arm/include/asm/outercache.h +++ b/arch/arm/include/asm/outercache.h @@ -39,6 +39,11 @@ struct outer_cache_fns { /* This is an ARM L2C thing */ void (*write_sec)(unsigned long, unsigned); void (*configure)(const struct l2x0_regs *); + +#ifdef CONFIG_OPTEE + /* Set a mutex with OPTEE for maintenance */ + int (*set_mutex)(void *mutex); +#endif }; extern struct outer_cache_fns outer_cache; @@ -115,6 +120,24 @@ static inline void outer_resume(void) outer_cache.resume(); } +#ifdef CONFIG_OPTEE +/** + * @brief Setup the Cache Mutex + * + * @param[in] Reference to the Mutex object + * + * @retval 0 Success + * @retval -EINVAL Invalid value + */ +static inline int outer_mutex(void *mutex) +{ + if (outer_cache.set_mutex) + return outer_cache.set_mutex(mutex); + + return -EINVAL; +} +#endif + #else static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) -- cgit v1.2.3