summaryrefslogtreecommitdiff
path: root/arch/arm/include
diff options
context:
space:
mode:
authorCedric Neveux <cedric.neveux@nxp.com>2018-10-23 13:52:54 +0200
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:35:16 +0800
commit46a30aca7f5cbbb7f3f952634c7ebcb63014d520 (patch)
tree059587591d54aa69732f5ec9cea4f5361f2026e9 /arch/arm/include
parent24f3cee476a47145a30b2d1bf5ac315ae803c176 (diff)
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 <cedric.neveux@nxp.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/outercache.h23
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)