armv8: fsl-layerscape: add i/d-cache enable function to enable_caches

This function assume that the d-cache and MMU has been enabled earlier,
so it just created MMU table in main memory. But the assumption is not
always correct, for example, the early setup is done in EL3, while
enable_caches() is called when the PE has turned into another EL.

Define the function mmu_setup() for fsl-layerscape to cover the weak
one.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Reviewed-by: York Sun <york.sun@nxp.com>
This commit is contained in:
Hou Zhiqiang 2016-06-28 20:18:12 +08:00 committed by York Sun
parent 5ad5823d0c
commit 85cdf38e69
1 changed files with 10 additions and 4 deletions

View File

@ -164,15 +164,21 @@ int arch_cpu_init(void)
return 0;
}
void mmu_setup(void)
{
final_mmu_setup();
}
/*
* This function is called from lib/board.c.
* It recreates MMU table in main memory. MMU and d-cache are enabled earlier.
* There is no need to disable d-cache for this operation.
* This function is called from common/board_r.c.
* It recreates MMU table in main memory.
*/
void enable_caches(void)
{
final_mmu_setup();
mmu_setup();
__asm_invalidate_tlb_all();
icache_enable();
dcache_enable();
}
#endif