soc: arm: nxp: ensure code cache is enabled at boot for RT11xx

Ensure code cache is enabled at boot for RT11xx. CMSIS SystemInit should
enable the code cache, but if CONFIG_INIT_ARCH_HW_AT_BOOT=y and
CONFIG_CACHE_MANAGEMENT=y, then the cache will be disabled after
SystemInit is called. Since calling SCB_EnableICache will not
change hardware settings if the ICACHE is already enabled, just
call it unconditionally during init.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
This commit is contained in:
Daniel DeGrasse 2023-05-03 14:36:34 -05:00 committed by Carles Cufí
parent 6c732185af
commit b686f206b9

View file

@ -659,6 +659,11 @@ static int imxrt_init(void)
#ifndef CONFIG_IMXRT1XXX_CODE_CACHE
/* SystemInit enables code cache, disable it here */
SCB_DisableICache();
#else
/* z_arm_init_arch_hw_at_boot() disables code cache if CONFIG_ARCH_CACHE is enabled,
* enable it here.
*/
SCB_EnableICache();
#endif
if (IS_ENABLED(CONFIG_IMXRT1XXX_DATA_CACHE)) {