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
This commit is contained in:
Andrew Ryabinin 2012-10-25 13:50:42 +04:00
parent 50d9fb95eb
commit c1ec1ec899

View file

@ -218,11 +218,15 @@ static void __attribute__((noinline)) cache_invalidate_way(int way)
void commit_discard_idcache(void) void commit_discard_idcache(void)
{ {
DEVID &= ~(1<<31); /* disable cache */
/* invalidate cache way 0 */ /* invalidate cache way 0 */
cache_invalidate_way(0); cache_invalidate_way(0);
/* invalidate cache way 1 */ /* invalidate cache way 1 */
cache_invalidate_way(1); cache_invalidate_way(1);
DEVID |= (1<<31); /* enable cache */
} }
void commit_discard_dcache (void) __attribute__((alias("commit_discard_idcache"))); void commit_discard_dcache (void) __attribute__((alias("commit_discard_idcache")));