Skip to content

Commit

Permalink
soc: imx: imx95: enable cache management for M7
Browse files Browse the repository at this point in the history
Enable cache management for the M7-based i.MX95 soc.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
  • Loading branch information
LaurentiuM1234 authored and aescolar committed Sep 27, 2024
1 parent d8663bf commit 848907c
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions soc/nxp/imx/imx9/imx95/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ config SOC_MIMX9596_M7
select CPU_HAS_DCACHE
select CPU_HAS_ARM_MPU
select ARM_MPU
select SOC_LATE_INIT_HOOK
select HAS_MCUX

config SOC_MIMX9596_A55
Expand Down
3 changes: 3 additions & 0 deletions soc/nxp/imx/imx9/imx95/Kconfig.defconfig.mimx95.m7
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ config SYS_CLOCK_HW_CYCLES_PER_SEC
int
default 800000000

config CACHE_MANAGEMENT
default y

endif # SOC_MIMX9596_M7
3 changes: 3 additions & 0 deletions soc/nxp/imx/imx9/imx95/m7/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@

zephyr_include_directories(.)

zephyr_library()
zephyr_library_sources(soc.c)

set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
15 changes: 15 additions & 0 deletions soc/nxp/imx/imx9/imx95/m7/soc.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* Copyright 2024 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/cache.h>

void soc_late_init_hook(void)
{
#ifdef CONFIG_CACHE_MANAGEMENT
sys_cache_data_enable();
sys_cache_instr_enable();
#endif /* CONFIG_CACHE_MANAGEMENT */
}

0 comments on commit 848907c

Please sign in to comment.