soc: imx93 m33: add tcm init

m33 must ensure the TCM is ECC clean by initializing all dtcm memories
Otherwise, it can only run it by loading m33 under uboot.
Based on this fixed, we can run M33 by mkimage into flash.bin.

Signed-off-by: Yongxu Wang <yongxu.wang@nxp.com>
This commit is contained in:
Yongxu Wang 2025-07-02 14:47:59 +05:30 committed by Anas Nashif
parent 0d175f3af5
commit 2be211e6af
3 changed files with 28 additions and 0 deletions

View File

@ -12,4 +12,5 @@ elseif(CONFIG_SOC_MIMX9352_M33)
zephyr_include_directories(m33)
zephyr_sources(m33/soc.c)
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
zephyr_library_sources_ifdef(CONFIG_SOC_RESET_HOOK m33/imx93_m33_startup.S)
endif()

View File

@ -22,6 +22,7 @@ config SOC_MIMX9352_M33
select HAS_MCUX_IOMUXC if PINCTRL
select HAS_MCUX_CACHE
select SOC_EARLY_INIT_HOOK
select SOC_RESET_HOOK
config MCUX_CORE_SUFFIX
default "_ca55" if SOC_MIMX9352_A55

View File

@ -0,0 +1,26 @@
/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/devicetree.h>
#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
_ASM_FILE_PROLOGUE
GTEXT(soc_reset_hook)
SECTION_FUNC(TEXT, soc_reset_hook)
mov r0, #0
ldr r1, = DT_REG_ADDR(DT_NODELABEL(dtcm))
ldr r2, = DT_REG_ADDR(DT_NODELABEL(dtcm)) + DT_REG_SIZE(DT_NODELABEL(dtcm))
DTCM_LOOP:
cmp r1, r2
itt lt
strlt r0, [r1], #4
blt DTCM_LOOP
bx lr