diff options
author | Chao Xie <chao.xie@marvell.com> | 2012-05-06 23:23:59 -0400 |
---|---|---|
committer | Haojian Zhuang <haojian.zhuang@gmail.com> | 2012-05-06 23:43:48 -0400 |
commit | 89326f76b7ae602eb6a2d3e4cc028190fc8d480f (patch) | |
tree | 29d55ffa2b9c46f22962e6a7ff08e3b04e9b0dbe /arch/arm/mm | |
parent | 3f5d081957cee794fe2937bb7edafa7ac949044d (diff) |
ARM: cache: tauros2: add disable and resume callback
For the SOC chips using tauros2 cache, will need disable
and resume tauros2 cache for SOC suspend/resume.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Diffstat (limited to 'arch/arm/mm')
-rw-r--r-- | arch/arm/mm/cache-tauros2.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/arm/mm/cache-tauros2.c b/arch/arm/mm/cache-tauros2.c index 1fbca05fe906..23a7643e9a87 100644 --- a/arch/arm/mm/cache-tauros2.c +++ b/arch/arm/mm/cache-tauros2.c | |||
@@ -108,6 +108,26 @@ static void tauros2_flush_range(unsigned long start, unsigned long end) | |||
108 | 108 | ||
109 | dsb(); | 109 | dsb(); |
110 | } | 110 | } |
111 | |||
112 | static void tauros2_disable(void) | ||
113 | { | ||
114 | __asm__ __volatile__ ( | ||
115 | "mcr p15, 1, %0, c7, c11, 0 @L2 Cache Clean All\n\t" | ||
116 | "mrc p15, 0, %0, c1, c0, 0\n\t" | ||
117 | "bic %0, %0, #(1 << 26)\n\t" | ||
118 | "mcr p15, 0, %0, c1, c0, 0 @Disable L2 Cache\n\t" | ||
119 | : : "r" (0x0)); | ||
120 | } | ||
121 | |||
122 | static void tauros2_resume(void) | ||
123 | { | ||
124 | __asm__ __volatile__ ( | ||
125 | "mcr p15, 1, %0, c7, c7, 0 @L2 Cache Invalidate All\n\t" | ||
126 | "mrc p15, 0, %0, c1, c0, 0\n\t" | ||
127 | "orr %0, %0, #(1 << 26)\n\t" | ||
128 | "mcr p15, 0, %0, c1, c0, 0 @Enable L2 Cache\n\t" | ||
129 | : : "r" (0x0)); | ||
130 | } | ||
111 | #endif | 131 | #endif |
112 | 132 | ||
113 | static inline u32 __init read_extra_features(void) | 133 | static inline u32 __init read_extra_features(void) |
@@ -194,6 +214,8 @@ void __init tauros2_init(void) | |||
194 | outer_cache.inv_range = tauros2_inv_range; | 214 | outer_cache.inv_range = tauros2_inv_range; |
195 | outer_cache.clean_range = tauros2_clean_range; | 215 | outer_cache.clean_range = tauros2_clean_range; |
196 | outer_cache.flush_range = tauros2_flush_range; | 216 | outer_cache.flush_range = tauros2_flush_range; |
217 | outer_cache.disable = tauros2_disable; | ||
218 | outer_cache.resume = tauros2_resume; | ||
197 | } | 219 | } |
198 | #endif | 220 | #endif |
199 | 221 | ||
@@ -219,6 +241,8 @@ void __init tauros2_init(void) | |||
219 | outer_cache.inv_range = tauros2_inv_range; | 241 | outer_cache.inv_range = tauros2_inv_range; |
220 | outer_cache.clean_range = tauros2_clean_range; | 242 | outer_cache.clean_range = tauros2_clean_range; |
221 | outer_cache.flush_range = tauros2_flush_range; | 243 | outer_cache.flush_range = tauros2_flush_range; |
244 | outer_cache.disable = tauros2_disable; | ||
245 | outer_cache.resume = tauros2_resume; | ||
222 | } | 246 | } |
223 | #endif | 247 | #endif |
224 | 248 | ||