ARM: Add base support for ARMv7-M
[deliverable/linux.git] / arch / arm / include / asm / glue-cache.h
CommitLineData
753790e7
RK
1/*
2 * arch/arm/include/asm/glue-cache.h
3 *
4 * Copyright (C) 1999-2002 Russell King
5 *
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.
9 */
10#ifndef ASM_GLUE_CACHE_H
11#define ASM_GLUE_CACHE_H
12
13#include <asm/glue.h>
14
15/*
16 * Cache Model
17 * ===========
18 */
19#undef _CACHE
20#undef MULTI_CACHE
21
22#if defined(CONFIG_CPU_CACHE_V3)
23# ifdef _CACHE
24# define MULTI_CACHE 1
25# else
26# define _CACHE v3
27# endif
28#endif
29
30#if defined(CONFIG_CPU_CACHE_V4)
31# ifdef _CACHE
32# define MULTI_CACHE 1
33# else
34# define _CACHE v4
35# endif
36#endif
37
38#if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
39 defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
40 defined(CONFIG_CPU_ARM1026)
41# define MULTI_CACHE 1
42#endif
43
44#if defined(CONFIG_CPU_FA526)
45# ifdef _CACHE
46# define MULTI_CACHE 1
47# else
48# define _CACHE fa
49# endif
50#endif
51
52#if defined(CONFIG_CPU_ARM926T)
53# ifdef _CACHE
54# define MULTI_CACHE 1
55# else
56# define _CACHE arm926
57# endif
58#endif
59
60#if defined(CONFIG_CPU_ARM940T)
61# ifdef _CACHE
62# define MULTI_CACHE 1
63# else
64# define _CACHE arm940
65# endif
66#endif
67
68#if defined(CONFIG_CPU_ARM946E)
69# ifdef _CACHE
70# define MULTI_CACHE 1
71# else
72# define _CACHE arm946
73# endif
74#endif
75
76#if defined(CONFIG_CPU_CACHE_V4WB)
77# ifdef _CACHE
78# define MULTI_CACHE 1
79# else
80# define _CACHE v4wb
81# endif
82#endif
83
84#if defined(CONFIG_CPU_XSCALE)
85# ifdef _CACHE
86# define MULTI_CACHE 1
87# else
88# define _CACHE xscale
89# endif
90#endif
91
92#if defined(CONFIG_CPU_XSC3)
93# ifdef _CACHE
94# define MULTI_CACHE 1
95# else
96# define _CACHE xsc3
97# endif
98#endif
99
100#if defined(CONFIG_CPU_MOHAWK)
101# ifdef _CACHE
102# define MULTI_CACHE 1
103# else
104# define _CACHE mohawk
105# endif
106#endif
107
108#if defined(CONFIG_CPU_FEROCEON)
109# define MULTI_CACHE 1
110#endif
111
bd1274dc 112#if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
a67e1ce1 113# ifdef _CACHE
753790e7 114# define MULTI_CACHE 1
a67e1ce1
RK
115# else
116# define _CACHE v6
117# endif
753790e7
RK
118#endif
119
120#if defined(CONFIG_CPU_V7)
a67e1ce1 121# ifdef _CACHE
753790e7 122# define MULTI_CACHE 1
a67e1ce1
RK
123# else
124# define _CACHE v7
125# endif
753790e7
RK
126#endif
127
55bdd694
CM
128#if defined(CONFIG_CPU_V7M)
129# ifdef _CACHE
130# define MULTI_CACHE 1
131# else
132# define _CACHE nop
133# endif
134#endif
135
753790e7 136#if !defined(_CACHE) && !defined(MULTI_CACHE)
25985edc 137#error Unknown cache maintenance model
753790e7
RK
138#endif
139
55bdd694
CM
140#ifndef __ASSEMBLER__
141extern inline void nop_flush_icache_all(void) { }
142extern inline void nop_flush_kern_cache_all(void) { }
143extern inline void nop_flush_kern_cache_louis(void) { }
144extern inline void nop_flush_user_cache_all(void) { }
145extern inline void nop_flush_user_cache_range(unsigned long a,
146 unsigned long b, unsigned int c) { }
147
148extern inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
149extern inline int nop_coherent_user_range(unsigned long a,
150 unsigned long b) { return 0; }
151extern inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
152
153extern inline void nop_dma_flush_range(const void *a, const void *b) { }
154
155extern inline void nop_dma_map_area(const void *s, size_t l, int f) { }
156extern inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
157#endif
158
753790e7
RK
159#ifndef MULTI_CACHE
160#define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
161#define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
031bd879 162#define __cpuc_flush_kern_louis __glue(_CACHE,_flush_kern_cache_louis)
753790e7
RK
163#define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
164#define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
165#define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
166#define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
167#define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
168
169#define dmac_map_area __glue(_CACHE,_dma_map_area)
170#define dmac_unmap_area __glue(_CACHE,_dma_unmap_area)
171#define dmac_flush_range __glue(_CACHE,_dma_flush_range)
172#endif
173
174#endif
This page took 0.153868 seconds and 5 git commands to generate.