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:
parent
6aa242cdfb
commit
0ee6632967
2 changed files with 6 additions and 12 deletions
|
@ -15,6 +15,10 @@
|
||||||
#include <cmsis_core.h>
|
#include <cmsis_core.h>
|
||||||
#include <OsIf.h>
|
#include <OsIf.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_HAS_MCUX_CACHE)
|
||||||
|
#include <fsl_cache.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(CONFIG_WDOG_INIT)
|
#if defined(CONFIG_WDOG_INIT)
|
||||||
#define WDOG_UPDATE_KEY 0xD928C520U
|
#define WDOG_UPDATE_KEY 0xD928C520U
|
||||||
|
|
||||||
|
@ -64,17 +68,7 @@ static int soc_init(void)
|
||||||
#endif /* !CONFIG_ARM_MPU */
|
#endif /* !CONFIG_ARM_MPU */
|
||||||
|
|
||||||
#if defined(CONFIG_HAS_MCUX_CACHE) && defined(CONFIG_NXP_S32_ENABLE_CODE_CACHE)
|
#if defined(CONFIG_HAS_MCUX_CACHE) && defined(CONFIG_NXP_S32_ENABLE_CODE_CACHE)
|
||||||
/* Invalidate all ways */
|
L1CACHE_EnableCodeCache();
|
||||||
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);
|
|
||||||
barrier_isync_fence_full();
|
barrier_isync_fence_full();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
2
west.yml
2
west.yml
|
@ -193,7 +193,7 @@ manifest:
|
||||||
groups:
|
groups:
|
||||||
- hal
|
- hal
|
||||||
- name: hal_nxp
|
- name: hal_nxp
|
||||||
revision: d0c424e1c6ef0acac3099a07280a46a24951a47a
|
revision: 1b2f3608ab0d5f2cf2a4c2973ae9f6353fb43e72
|
||||||
path: modules/hal/nxp
|
path: modules/hal/nxp
|
||||||
groups:
|
groups:
|
||||||
- hal
|
- hal
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue