2 * arch/arm/include/asm/glue-cache.h
4 * Copyright (C) 1999-2002 Russell King
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #ifndef ASM_GLUE_CACHE_H
11 #define ASM_GLUE_CACHE_H
22 #if defined(CONFIG_CPU_CACHE_V4)
24 # define MULTI_CACHE 1
30 #if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
31 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
32 defined(CONFIG_CPU_ARM1026)
33 # define MULTI_CACHE 1
36 #if defined(CONFIG_CPU_FA526)
38 # define MULTI_CACHE 1
44 #if defined(CONFIG_CPU_ARM926T)
46 # define MULTI_CACHE 1
48 # define _CACHE arm926
52 #if defined(CONFIG_CPU_ARM940T)
54 # define MULTI_CACHE 1
56 # define _CACHE arm940
60 #if defined(CONFIG_CPU_ARM946E)
62 # define MULTI_CACHE 1
64 # define _CACHE arm946
68 #if defined(CONFIG_CPU_CACHE_V4WB)
70 # define MULTI_CACHE 1
76 #if defined(CONFIG_CPU_XSCALE)
78 # define MULTI_CACHE 1
80 # define _CACHE xscale
84 #if defined(CONFIG_CPU_XSC3)
86 # define MULTI_CACHE 1
92 #if defined(CONFIG_CPU_MOHAWK)
94 # define MULTI_CACHE 1
96 # define _CACHE mohawk
100 #if defined(CONFIG_CPU_FEROCEON)
101 # define MULTI_CACHE 1
104 #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
106 # define MULTI_CACHE 1
112 #if defined(CONFIG_CPU_V7)
114 # define MULTI_CACHE 1
120 #if defined(CONFIG_CPU_V7M)
121 # define MULTI_CACHE 1
124 #if !defined(_CACHE) && !defined(MULTI_CACHE)
125 #error Unknown cache maintenance model
128 #ifndef __ASSEMBLER__
129 static inline void nop_flush_icache_all(void) { }
130 static inline void nop_flush_kern_cache_all(void) { }
131 static inline void nop_flush_kern_cache_louis(void) { }
132 static inline void nop_flush_user_cache_all(void) { }
133 static inline void nop_flush_user_cache_range(unsigned long a,
134 unsigned long b, unsigned int c) { }
136 static inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
137 static inline int nop_coherent_user_range(unsigned long a,
138 unsigned long b) { return 0; }
139 static inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
141 static inline void nop_dma_flush_range(const void *a, const void *b) { }
143 static inline void nop_dma_map_area(const void *s, size_t l, int f) { }
144 static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
148 #define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
149 #define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
150 #define __cpuc_flush_kern_louis __glue(_CACHE,_flush_kern_cache_louis)
151 #define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
152 #define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
153 #define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
154 #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
155 #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
157 #define dmac_flush_range __glue(_CACHE,_dma_flush_range)