diff --git a/firmware/target/arm/rk27xx/system-rk27xx.c b/firmware/target/arm/rk27xx/system-rk27xx.c index 8c75dee..234c6eb 100644 --- a/firmware/target/arm/rk27xx/system-rk27xx.c +++ b/firmware/target/arm/rk27xx/system-rk27xx.c @@ -200,19 +200,20 @@ void udelay(unsigned usecs) ); } -void commit_discard_idcache(void) +static void __attribute__((noinline)) cache_invalidate_way(int way) { - /* invalidate cache way 0 */ - CACHEOP = 0x02; + CACHEOP = ((way<<31)|0x2); /* wait for invalidate process to complete */ while (CACHEOP & 0x03); +} +void commit_discard_idcache(void) +{ + /* invalidate cache way 0 */ + cache_invalidate_way(0); /* invalidate cache way 1 */ - CACHEOP = 0x80000002; - - /* wait for invalidate process to complete */ - while (CACHEOP & 0x03); + cache_invalidate_way(1); } void commit_discard_dcache (void) __attribute__((alias("commit_discard_idcache")));