summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/arm/rk27xx/system-rk27xx.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/firmware/target/arm/rk27xx/system-rk27xx.c b/firmware/target/arm/rk27xx/system-rk27xx.c
index 1459770b94..e73edf1add 100644
--- a/firmware/target/arm/rk27xx/system-rk27xx.c
+++ b/firmware/target/arm/rk27xx/system-rk27xx.c
@@ -169,13 +169,31 @@ void cpucache_commit_discard(void)
169 CACHEOP = 0x02; 169 CACHEOP = 0x02;
170 170
171 /* wait for invalidate process to complete */ 171 /* wait for invalidate process to complete */
172 while (CACHEOP & 0x01); 172 while (CACHEOP & 0x03);
173 173
174 /* invalidate cache way 1 */ 174 /* invalidate cache way 1 */
175 CACHEOP = 0x80000002; 175 CACHEOP = 0x80000002;
176 176
177 /* wait for invalidate process to complete */ 177 /* wait for invalidate process to complete */
178 while (CACHEOP & 0x01); 178 while (CACHEOP & 0x03);
179} 179}
180 180
181void cpucache_invalidate(void) __attribute__((alias("cpucache_commit_discard"))); 181void cpucache_invalidate(void) __attribute__((alias("cpucache_commit_discard")));
182
183void commit_discard_dcache_range (const void *base, unsigned int size)
184{
185 int cnt = size + ((unsigned long)base & 0x1f);
186 unsigned long opcode = ((unsigned long)base & 0xffffffe0) | 0x01;
187
188 while (cnt > 0)
189 {
190 CACHEOP = opcode;
191
192 while (CACHEOP & 0x03);
193
194 cnt -= 32;
195 opcode += 32;
196 }
197}
198
199void clean_dcache_range(const void *base, unsigned int size) __attribute__((alias("commit_discard_dcache_range")));