aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-16 06:52:55 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-05-22 11:38:46 -0400
commitbc4f94d85cad6035d02d2bed1b27f9bea7e7b6e6 (patch)
tree59ebae07f095804c2a461cc5a0f430eea6db6191 /arch/arm/include
parentd453ef752cf01e96168ea012016baea0079f5377 (diff)
ARM: outer cache: add documentation of outer cache functions
Add some documentation to cover the outer cache functions so that their requirements can be better understood. Of particular note are the flush_all() and disable() methods which must not be called except in very specific circumstances. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/outercache.h48
1 files changed, 47 insertions, 1 deletions
diff --git a/arch/arm/include/asm/outercache.h b/arch/arm/include/asm/outercache.h
index 0e4420858990..2615b3d9e807 100644
--- a/arch/arm/include/asm/outercache.h
+++ b/arch/arm/include/asm/outercache.h
@@ -39,35 +39,75 @@ struct outer_cache_fns {
39extern struct outer_cache_fns outer_cache; 39extern struct outer_cache_fns outer_cache;
40 40
41#ifdef CONFIG_OUTER_CACHE 41#ifdef CONFIG_OUTER_CACHE
42 42/**
43 * outer_inv_range - invalidate range of outer cache lines
44 * @start: starting physical address, inclusive
45 * @end: end physical address, exclusive
46 */
43static inline void outer_inv_range(phys_addr_t start, phys_addr_t end) 47static inline void outer_inv_range(phys_addr_t start, phys_addr_t end)
44{ 48{
45 if (outer_cache.inv_range) 49 if (outer_cache.inv_range)
46 outer_cache.inv_range(start, end); 50 outer_cache.inv_range(start, end);
47} 51}
52
53/**
54 * outer_clean_range - clean dirty outer cache lines
55 * @start: starting physical address, inclusive
56 * @end: end physical address, exclusive
57 */
48static inline void outer_clean_range(phys_addr_t start, phys_addr_t end) 58static inline void outer_clean_range(phys_addr_t start, phys_addr_t end)
49{ 59{
50 if (outer_cache.clean_range) 60 if (outer_cache.clean_range)
51 outer_cache.clean_range(start, end); 61 outer_cache.clean_range(start, end);
52} 62}
63
64/**
65 * outer_flush_range - clean and invalidate outer cache lines
66 * @start: starting physical address, inclusive
67 * @end: end physical address, exclusive
68 */
53static inline void outer_flush_range(phys_addr_t start, phys_addr_t end) 69static inline void outer_flush_range(phys_addr_t start, phys_addr_t end)
54{ 70{
55 if (outer_cache.flush_range) 71 if (outer_cache.flush_range)
56 outer_cache.flush_range(start, end); 72 outer_cache.flush_range(start, end);
57} 73}
58 74
75/**
76 * outer_flush_all - clean and invalidate all cache lines in the outer cache
77 *
78 * Note: depending on implementation, this may not be atomic - it must
79 * only be called with interrupts disabled and no other active outer
80 * cache masters.
81 *
82 * It is intended that this function is only used by implementations
83 * needing to override the outer_cache.disable() method due to security.
84 * (Some implementations perform this as a clean followed by an invalidate.)
85 */
59static inline void outer_flush_all(void) 86static inline void outer_flush_all(void)
60{ 87{
61 if (outer_cache.flush_all) 88 if (outer_cache.flush_all)
62 outer_cache.flush_all(); 89 outer_cache.flush_all();
63} 90}
64 91
92/**
93 * outer_disable - clean, invalidate and disable the outer cache
94 *
95 * Disable the outer cache, ensuring that any data contained in the outer
96 * cache is pushed out to lower levels of system memory. The note and
97 * conditions above concerning outer_flush_all() applies here.
98 */
65static inline void outer_disable(void) 99static inline void outer_disable(void)
66{ 100{
67 if (outer_cache.disable) 101 if (outer_cache.disable)
68 outer_cache.disable(); 102 outer_cache.disable();
69} 103}
70 104
105/**
106 * outer_resume - restore the cache configuration and re-enable outer cache
107 *
108 * Restore any configuration that the cache had when previously enabled,
109 * and re-enable the outer cache.
110 */
71static inline void outer_resume(void) 111static inline void outer_resume(void)
72{ 112{
73 if (outer_cache.resume) 113 if (outer_cache.resume)
@@ -89,6 +129,12 @@ static inline void outer_resume(void) { }
89#endif 129#endif
90 130
91#ifdef CONFIG_OUTER_CACHE_SYNC 131#ifdef CONFIG_OUTER_CACHE_SYNC
132/**
133 * outer_sync - perform a sync point for outer cache
134 *
135 * Ensure that all outer cache operations are complete and any store
136 * buffers are drained.
137 */
92static inline void outer_sync(void) 138static inline void outer_sync(void)
93{ 139{
94 if (outer_cache.sync) 140 if (outer_cache.sync)