diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2007-02-05 08:48:08 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-02-08 09:49:40 -0500 |
commit | 953233dc9958ba2b29753d0f24e37a33a076a5f6 (patch) | |
tree | b9cc9ddc82722dc79a72a8c6f4977566ec2e0384 /include | |
parent | 7f8e33546d17c7d8849be3a6623c3b6b3c9b588b (diff) |
[ARM] 4134/1: Add generic support for outer caches
The outer cache can be L2 as on RealView/EB MPCore platform or even L3
or further on ARMv7 cores. This patch adds the generic support for
flushing the outer cache in the DMA operations.
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-arm/cacheflush.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/asm-arm/cacheflush.h b/include/asm-arm/cacheflush.h index 5f531ea03059..ce60b3702ba5 100644 --- a/include/asm-arm/cacheflush.h +++ b/include/asm-arm/cacheflush.h | |||
@@ -190,6 +190,12 @@ struct cpu_cache_fns { | |||
190 | void (*dma_flush_range)(unsigned long, unsigned long); | 190 | void (*dma_flush_range)(unsigned long, unsigned long); |
191 | }; | 191 | }; |
192 | 192 | ||
193 | struct outer_cache_fns { | ||
194 | void (*inv_range)(unsigned long, unsigned long); | ||
195 | void (*clean_range)(unsigned long, unsigned long); | ||
196 | void (*flush_range)(unsigned long, unsigned long); | ||
197 | }; | ||
198 | |||
193 | /* | 199 | /* |
194 | * Select the calling method | 200 | * Select the calling method |
195 | */ | 201 | */ |
@@ -246,6 +252,37 @@ extern void dmac_flush_range(unsigned long, unsigned long); | |||
246 | 252 | ||
247 | #endif | 253 | #endif |
248 | 254 | ||
255 | #ifdef CONFIG_OUTER_CACHE | ||
256 | |||
257 | extern struct outer_cache_fns outer_cache; | ||
258 | |||
259 | static inline void outer_inv_range(unsigned long start, unsigned long end) | ||
260 | { | ||
261 | if (outer_cache.inv_range) | ||
262 | outer_cache.inv_range(start, end); | ||
263 | } | ||
264 | static inline void outer_clean_range(unsigned long start, unsigned long end) | ||
265 | { | ||
266 | if (outer_cache.clean_range) | ||
267 | outer_cache.clean_range(start, end); | ||
268 | } | ||
269 | static inline void outer_flush_range(unsigned long start, unsigned long end) | ||
270 | { | ||
271 | if (outer_cache.flush_range) | ||
272 | outer_cache.flush_range(start, end); | ||
273 | } | ||
274 | |||
275 | #else | ||
276 | |||
277 | static inline void outer_inv_range(unsigned long start, unsigned long end) | ||
278 | { } | ||
279 | static inline void outer_clean_range(unsigned long start, unsigned long end) | ||
280 | { } | ||
281 | static inline void outer_flush_range(unsigned long start, unsigned long end) | ||
282 | { } | ||
283 | |||
284 | #endif | ||
285 | |||
249 | /* | 286 | /* |
250 | * flush_cache_vmap() is used when creating mappings (eg, via vmap, | 287 | * flush_cache_vmap() is used when creating mappings (eg, via vmap, |
251 | * vmalloc, ioremap etc) in kernel space for pages. Since the | 288 | * vmalloc, ioremap etc) in kernel space for pages. Since the |