-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soc: fvp_aemv8r_aarch32: enable caches at init
Enable at SoC boot time when enabled through Kconfig. Cache management API is not used since it could be built without its support enabled. Signed-off-by: Manuel Argüelles <[email protected]>
- Loading branch information
Showing
3 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright 2023 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/kernel.h> | ||
#include <zephyr/arch/arm/aarch32/cortex_a_r/cmsis.h> | ||
|
||
void z_arm_platform_init(void) | ||
{ | ||
if (IS_ENABLED(CONFIG_ICACHE)) { | ||
if (!(__get_SCTLR() & SCTLR_I_Msk)) { | ||
L1C_InvalidateICacheAll(); | ||
__set_SCTLR(__get_SCTLR() | SCTLR_I_Msk); | ||
__ISB(); | ||
} | ||
} | ||
|
||
if (IS_ENABLED(CONFIG_DCACHE)) { | ||
if (!(__get_SCTLR() & SCTLR_C_Msk)) { | ||
L1C_InvalidateDCacheAll(); | ||
__set_SCTLR(__get_SCTLR() | SCTLR_C_Msk); | ||
__DSB(); | ||
} | ||
} | ||
} |