diff options
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/outercache.h | 23 |
1 files changed, 23 insertions, 0 deletions
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) |