Skip to content

Commit

Permalink
soc: nxp: Fix MCXW71 initialization flow
Browse files Browse the repository at this point in the history
ECC Ram init was missing, which produces faults
when accessing the memory region.

Signed-off-by: Yassine El Aissaoui <yassine.elaissaoui@nxp.com>
  • Loading branch information
yeaissa committed Sep 26, 2024
1 parent 417a9e8 commit 3117b60
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion soc/nxp/mcx/mcxw/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ config SOC_SERIES_MCXW
select CPU_HAS_ARM_MPU
select ARMV8_M_DSP
select HAS_MCUX
select PLATFORM_SPECIFIC_INIT
select SOC_RESET_HOOK
select CLOCK_CONTROL
10 changes: 5 additions & 5 deletions soc/nxp/mcx/mcxw/mcxw71_platform_init.S
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
#include <zephyr/linker/sections.h>

_ASM_FILE_PROLOGUE
#ifdef CONFIG_PLATFORM_SPECIFIC_INIT
#ifdef CONFIG_SOC_RESET_HOOK


GTEXT(z_arm_platform_init)
SECTION_SUBSEC_FUNC(TEXT,_reset_section,z_arm_platform_init)
GTEXT(init_ecc_ram)
SECTION_SUBSEC_FUNC(TEXT,_reset_section,init_ecc_ram)

.z_arm_platform_init:
.init_ecc_ram:
ldr r0, =0x14000000
ldr r1, =.ram_init_ctcm01
bics r1, #0x10000000
Expand Down Expand Up @@ -56,4 +56,4 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,z_arm_platform_init)
.ram_init_done:
b SystemInit

#endif /* CONFIG_PLATFORM_SPECIFIC_INIT */
#endif /* CONFIG_SOC_RESET_HOOK */
5 changes: 5 additions & 0 deletions soc/nxp/mcx/mcxw/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <fsl_clock.h>

extern uint32_t SystemCoreClock;
extern void init_ecc_ram(void);

static ALWAYS_INLINE void clock_init(void)
{
Expand Down Expand Up @@ -163,4 +164,8 @@ static int nxp_mcxw71_init(void)
return 0;
}

void soc_reset_hook(void)
{
init_ecc_ram();
}
SYS_INIT(nxp_mcxw71_init, PRE_KERNEL_1, 0);

0 comments on commit 3117b60

Please sign in to comment.