soc: arm: nxp_s32: s32k1: use HAL to init code cache

Use the HAL cache driver to initialize the Code Cache.

Signed-off-by: Manuel Argüelles <manuel.arguelles@nxp.com>
This commit is contained in:
Manuel Argüelles 2023-12-05 19:35:12 +07:00 committed by Fabio Baltieri
commit 0ee6632967
2 changed files with 6 additions and 12 deletions

View file

@ -15,6 +15,10 @@
#include <cmsis_core.h>
#include <OsIf.h>
#if defined(CONFIG_HAS_MCUX_CACHE)
#include <fsl_cache.h>
#endif
#if defined(CONFIG_WDOG_INIT)
#define WDOG_UPDATE_KEY 0xD928C520U
@ -64,17 +68,7 @@ static int soc_init(void)
#endif /* !CONFIG_ARM_MPU */
#if defined(CONFIG_HAS_MCUX_CACHE) && defined(CONFIG_NXP_S32_ENABLE_CODE_CACHE)
/* Invalidate all ways */
IP_LMEM->PCCCR |= LMEM_PCCCR_INVW1_MASK | LMEM_PCCCR_INVW0_MASK;
IP_LMEM->PCCCR |= LMEM_PCCCR_GO_MASK;
/* Wait until the command completes */
while (IP_LMEM->PCCCR & LMEM_PCCCR_GO_MASK) {
;
}
/* Enable cache */
IP_LMEM->PCCCR |= (LMEM_PCCCR_ENCACHE_MASK);
L1CACHE_EnableCodeCache();
barrier_isync_fence_full();
#endif

View file

@ -193,7 +193,7 @@ manifest:
groups:
- hal
- name: hal_nxp
revision: d0c424e1c6ef0acac3099a07280a46a24951a47a
revision: 1b2f3608ab0d5f2cf2a4c2973ae9f6353fb43e72
path: modules/hal/nxp
groups:
- hal