Skip to content

Commit 7152dc1

Browse files
decsnyhenrikbrixandersen
authored andcommitted
soc: nxp: mcxw: Switch to soc_reset_hook
Base enablement of MCXW merged while z_arm_platform_init was being deprecated, resulting situation is now that no platform init is happening, fix by converting to use soc_reset_hook. Also fix a comment that said the core was being set to 40 MHz, when it is actually being set up to 96 MHz. Signed-off-by: Declan Snyder <[email protected]>
1 parent f7e9c3b commit 7152dc1

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

soc/nxp/mcx/mcxw/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ config SOC_SERIES_MCXW
1212
select CPU_HAS_ARM_MPU
1313
select ARMV8_M_DSP
1414
select HAS_MCUX
15-
select PLATFORM_SPECIFIC_INIT
15+
select SOC_RESET_HOOK
16+
select SOC_EARLY_INIT_HOOK
1617
select CLOCK_CONTROL

soc/nxp/mcx/mcxw/mcxw71_platform_init.S

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
#include <zephyr/linker/sections.h>
1717

1818
_ASM_FILE_PROLOGUE
19-
#ifdef CONFIG_PLATFORM_SPECIFIC_INIT
2019

20+
GTEXT(soc_reset_hook)
21+
SECTION_SUBSEC_FUNC(TEXT,_reset_section,soc_reset_hook)
2122

22-
GTEXT(z_arm_platform_init)
23-
SECTION_SUBSEC_FUNC(TEXT,_reset_section,z_arm_platform_init)
24-
25-
.z_arm_platform_init:
23+
.soc_reset_hook:
2624
ldr r0, =0x14000000
2725
ldr r1, =.ram_init_ctcm01
2826
bics r1, #0x10000000
@@ -55,5 +53,3 @@ SECTION_SUBSEC_FUNC(TEXT,_reset_section,z_arm_platform_init)
5553
bcc .loop5
5654
.ram_init_done:
5755
b SystemInit
58-
59-
#endif /* CONFIG_PLATFORM_SPECIFIC_INIT */

soc/nxp/mcx/mcxw/soc.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,23 +144,19 @@ static void vbat_init(void)
144144
base->STATUSA |= VBAT_STATUSA_POR_DET_MASK;
145145
};
146146

147-
static int nxp_mcxw71_init(void)
147+
void soc_early_init_hook(void)
148148
{
149149
unsigned int oldLevel; /* old interrupt lock level */
150150

151151
/* disable interrupts */
152152
oldLevel = irq_lock();
153153

154-
/* Initialize system clock to 40 MHz */
154+
/* Initialize system clock to 96 MHz */
155155
clock_init();
156156

157157
/* Smart power switch initialization */
158158
vbat_init();
159159

160160
/* restore interrupt state */
161161
irq_unlock(oldLevel);
162-
163-
return 0;
164162
}
165-
166-
SYS_INIT(nxp_mcxw71_init, PRE_KERNEL_1, 0);

0 commit comments

Comments
 (0)