arm64: cache: fix arch_dcache_all()
Add data barrier before and after dcachle flush or clean, and restore to data cache level 0 after all ops. Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
This commit is contained in:
parent
12b9b5aacc
commit
4a87c08606
1 changed files with 9 additions and 0 deletions
|
@ -110,6 +110,9 @@ int arch_dcache_all(int op)
|
|||
if (op != K_CACHE_INVD && op != K_CACHE_WB && op != K_CACHE_WB_INVD)
|
||||
return -ENOTSUP;
|
||||
|
||||
/* Data barrier before start */
|
||||
dsb();
|
||||
|
||||
clidr_el1 = read_clidr_el1();
|
||||
|
||||
loc = (clidr_el1 >> CLIDR_EL1_LOC_SHIFT) & CLIDR_EL1_LOC_MASK;
|
||||
|
@ -157,5 +160,11 @@ int arch_dcache_all(int op)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore csselr_el1 to level 0 */
|
||||
write_csselr_el1(0);
|
||||
dsb();
|
||||
isb();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue