mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2025-12-26 14:18:20 +00:00
bsps/aarch64: Flush cache before disabling MMU
To ensure data consistency, the cache much be flushed before disabling the MMU. When the MMU is disabled, all accesses are treated as non-cachced and thus will bypass the cache.
This commit is contained in:
committed by
Joel Sherrill
parent
7629760e49
commit
b44e26baa7
@@ -420,7 +420,13 @@ aarch64_mmu_disable( void )
|
||||
{
|
||||
uint64_t sctlr;
|
||||
|
||||
/* Enable MMU and cache */
|
||||
/*
|
||||
* Flush data cache before disabling the MMU. While the MMU is disabled, all
|
||||
* accesses are treated as uncached device memory.
|
||||
*/
|
||||
rtems_cache_flush_entire_data();
|
||||
|
||||
/* Disable MMU */
|
||||
sctlr = _AArch64_Read_sctlr_el1();
|
||||
sctlr &= ~(AARCH64_SCTLR_EL1_M);
|
||||
_AArch64_Write_sctlr_el1( sctlr );
|
||||
|
||||
Reference in New Issue
Block a user