From c1ec1ec89962ded5ae4acefc33c6a445f5b4c3f5 Mon Sep 17 00:00:00 2001 From: Andrew Ryabinin Date: Thu, 25 Oct 2012 13:50:42 +0400 Subject: 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 --- firmware/target/arm/rk27xx/system-rk27xx.c | 4 ++++ 1 file changed, 4 insertions(+) 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) void commit_discard_idcache(void) { + DEVID &= ~(1<<31); /* disable cache */ + /* invalidate cache way 0 */ cache_invalidate_way(0); /* invalidate cache way 1 */ cache_invalidate_way(1); + + DEVID |= (1<<31); /* enable cache */ } void commit_discard_dcache (void) __attribute__((alias("commit_discard_idcache"))); -- cgit v1.2.3