summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Ryabinin <ryabinin.a.a@gmail.com>2012-10-25 13:50:42 +0400
committerAndrew Ryabinin <ryabinin.a.a@gmail.com>2012-10-25 14:48:21 +0400
commitc1ec1ec89962ded5ae4acefc33c6a445f5b4c3f5 (patch)
treeebf6e26d67b29758a1dc5a4d0e0e2d03430db144
parent50d9fb95ebeeb3f9c9802ebe3e35a43d1a7273d4 (diff)
downloadrockbox-c1ec1ec89962ded5ae4acefc33c6a445f5b4c3f5.tar.gz
rockbox-c1ec1ec89962ded5ae4acefc33c6a445f5b4c3f5.zip
rk27xx: Disable cache while invalidating it.
It seems something wrong with cache handling in rk27xx. OF always disable cache before invalidating cache ways, therefore, now we do the same. Hopefully this will fix cache handling, but I couldn't contend that it's really so. Change-Id: I967c18211f0ddff689b6a17579fbe8685277f132
-rw-r--r--firmware/target/arm/rk27xx/system-rk27xx.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/firmware/target/arm/rk27xx/system-rk27xx.c b/firmware/target/arm/rk27xx/system-rk27xx.c
index 27373207bd..8e6773f816 100644
--- a/firmware/target/arm/rk27xx/system-rk27xx.c
+++ b/firmware/target/arm/rk27xx/system-rk27xx.c
@@ -218,11 +218,15 @@ static void __attribute__((noinline)) cache_invalidate_way(int way)
218 218
219void commit_discard_idcache(void) 219void commit_discard_idcache(void)
220{ 220{
221 DEVID &= ~(1<<31); /* disable cache */
222
221 /* invalidate cache way 0 */ 223 /* invalidate cache way 0 */
222 cache_invalidate_way(0); 224 cache_invalidate_way(0);
223 225
224 /* invalidate cache way 1 */ 226 /* invalidate cache way 1 */
225 cache_invalidate_way(1); 227 cache_invalidate_way(1);
228
229 DEVID |= (1<<31); /* enable cache */
226} 230}
227void commit_discard_dcache (void) __attribute__((alias("commit_discard_idcache"))); 231void commit_discard_dcache (void) __attribute__((alias("commit_discard_idcache")));
228 232