armv7: iterate thru all levels when doing dcache ops

This makes dcache maintenance functions operate on all levels
of cache instead of just the current one.

Change-Id: I2708fc7ba6da6740dbdfd733d937e7c943012d62
Signed-off-by: David Hendricks <dhendrix@chromium.org>
Reviewed-on: http://review.coreboot.org/2945
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
This commit is contained in:
David Hendricks 2013-03-28 18:26:03 -07:00
parent 8234874fbc
commit 7b19f66902
1 changed files with 27 additions and 2 deletions

View File

@ -148,14 +148,39 @@ static void dcache_op_set_way(enum dcache_op op)
dsb(); dsb();
} }
static void dcache_foreach(enum dcache_op op)
{
uint32_t clidr;
int level;
clidr = read_clidr();
for (level = 0; level < 7; level++) {
unsigned int ctype = (clidr >> (level * 3)) & 0x7;
uint32_t csselr;
switch(ctype) {
case 0x2:
case 0x3:
case 0x4:
csselr = level << 1;
write_csselr(csselr);
dcache_op_set_way(op);
break;
default:
/* no cache, icache only, or reserved */
break;
}
}
}
void dcache_clean_invalidate_all(void) void dcache_clean_invalidate_all(void)
{ {
dcache_op_set_way(OP_DCCISW); dcache_foreach(OP_DCCISW);
} }
void dcache_invalidate_all(void) void dcache_invalidate_all(void)
{ {
dcache_op_set_way(OP_DCISW); dcache_foreach(OP_DCISW);
} }
static unsigned int line_bytes(void) static unsigned int line_bytes(void)