Skip to content

Commit 60defb4

Browse files
biwenlicfriedt
authored andcommitted
soc: imx: imx943: enable cache management for Cortex-M33 Core1 in NETCMIX
Enable cache management for Cortex-M33 Core1 of SoC i.MX943. Signed-off-by: Biwen Li <[email protected]>
1 parent 61095cd commit 60defb4

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

soc/nxp/imx/imx9/imx943/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ config SOC_MIMX94398_M33
1414
select CPU_HAS_FPU
1515
select CPU_HAS_ARM_MPU
1616
select CPU_HAS_ARM_SAU
17+
select CPU_HAS_ICACHE
1718
select CPU_HAS_DCACHE
1819
select ARM_MPU
1920
select ARMV8_M_DSP
2021
select HAS_MCUX
2122
select HAS_MCUX_XCACHE
2223
select INIT_ARCH_HW_AT_BOOT
24+
select SOC_EARLY_INIT_HOOK

soc/nxp/imx/imx9/imx943/Kconfig.defconfig.mimx94398.m33

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@ endchoice
2727
config ETH_NXP_IMX_MSGINTR
2828
default 2
2929

30+
config CACHE_MANAGEMENT
31+
default y
32+
3033
endif # SOC_MIMX94398_M33

soc/nxp/imx/imx9/imx943/m33/soc.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7+
#include <zephyr/cache.h>
78
#include <zephyr/device.h>
89
#include <zephyr/init.h>
910
#include <zephyr/kernel.h>
@@ -18,6 +19,14 @@
1819
#define POWER_DOMAIN_STATE_ON 0x00000000
1920
#define POWER_DOMAIN_STATE_OFF 0x40000000
2021

22+
void soc_early_init_hook(void)
23+
{
24+
#ifdef CONFIG_CACHE_MANAGEMENT
25+
sys_cache_data_enable();
26+
sys_cache_instr_enable();
27+
#endif
28+
}
29+
2130
#if defined(CONFIG_ETH_NXP_IMX_NETC) && (DT_CHILD_NUM_STATUS_OKAY(DT_NODELABEL(netc)) != 0)
2231
/* The function is to reuse code for 250MHz NETC system clock and MACs clocks initialization */
2332
static int soc_netc_clock_init(int clk_id)

0 commit comments

Comments
 (0)