diff options
author | Marcin Bukat <marcin.bukat@gmail.com> | 2011-09-06 12:39:06 +0000 |
---|---|---|
committer | Marcin Bukat <marcin.bukat@gmail.com> | 2011-09-06 12:39:06 +0000 |
commit | 6d959a06253affe5cc1797f72f3c69d489aee8f9 (patch) | |
tree | 2515561d999b1f3e9db26e2fd4042a1031f914ca /firmware | |
parent | 4e6daf085692e4729aa1f70f27b1b04e704a864f (diff) | |
download | rockbox-6d959a06253affe5cc1797f72f3c69d489aee8f9.tar.gz rockbox-6d959a06253affe5cc1797f72f3c69d489aee8f9.zip |
rk27xx - implement cache handling functions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30451 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/target/arm/rk27xx/system-rk27xx.c | 22 |
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 | ||
181 | void cpucache_invalidate(void) __attribute__((alias("cpucache_commit_discard"))); | 181 | void cpucache_invalidate(void) __attribute__((alias("cpucache_commit_discard"))); |
182 | |||
183 | void 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 | |||
199 | void clean_dcache_range(const void *base, unsigned int size) __attribute__((alias("commit_discard_dcache_range"))); | ||