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_CACHE_B15_RAC)
121 # define MULTI_CACHE 1
124 #if defined(CONFIG_CPU_V7M)
125 # define MULTI_CACHE 1
128 #if !defined(_CACHE) && !defined(MULTI_CACHE)
129 #error Unknown cache maintenance model
132 #ifndef __ASSEMBLER__
133 static inline void nop_flush_icache_all(void) { }
134 static inline void nop_flush_kern_cache_all(void) { }
135 static inline void nop_flush_kern_cache_louis(void) { }
136 static inline void nop_flush_user_cache_all(void) { }
137 static inline void nop_flush_user_cache_range(unsigned long a
,
138 unsigned long b
, unsigned int c
) { }
140 static inline void nop_coherent_kern_range(unsigned long a
, unsigned long b
) { }
141 static inline int nop_coherent_user_range(unsigned long a
,
142 unsigned long b
) { return 0; }
143 static inline void nop_flush_kern_dcache_area(void *a
, size_t s
) { }
145 static inline void nop_dma_flush_range(const void *a
, const void *b
) { }
147 static inline void nop_dma_map_area(const void *s
, size_t l
, int f
) { }
148 static inline void nop_dma_unmap_area(const void *s
, size_t l
, int f
) { }
152 #define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
153 #define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
154 #define __cpuc_flush_kern_louis __glue(_CACHE,_flush_kern_cache_louis)
155 #define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
156 #define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
157 #define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
158 #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
159 #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
161 #define dmac_flush_range __glue(_CACHE,_dma_flush_range)