soc: arm: use sys_cache* for enabling the caches in nxp_s32

Use sys_cache* for enabling the caches in nxp_s32. This automatically
considers CONFIG_CACHE_MANAGEMENT and will activate the
cases only if this is active.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
This commit is contained in:
Benedikt Schmidt 2023-12-18 10:36:03 +01:00 committed by Carles Cufí
commit 49d3244798

View file

@ -7,6 +7,7 @@
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/init.h>
#include <zephyr/cache.h>
#include <cmsis_core.h>
#include <OsIf.h>
@ -50,13 +51,8 @@ const struct ivt ivt_header __attribute__((section(".ivt_header"))) = {
static int soc_init(void)
{
SCB_EnableICache();
if (IS_ENABLED(CONFIG_DCACHE)) {
if (!(SCB->CCR & SCB_CCR_DC_Msk)) {
SCB_EnableDCache();
}
}
sys_cache_instr_enable();
sys_cache_data_enable();
OsIf_Init(NULL);