Skip to content

Commit 97200b0

Browse files
EmilioCBenkartben
authored andcommitted
soc: nxp: mcx: Add MCXW72
Add MCXW72 SOC, SOC Kconfigs, and Platform Init code Signed-off-by: Emilio Benavente <[email protected]>
1 parent 2092f82 commit 97200b0

File tree

7 files changed

+92
-1
lines changed

7 files changed

+92
-1
lines changed

soc/nxp/mcx/mcxw/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
zephyr_sources(soc.c mcxw71_platform_init.S)
5+
zephyr_sources(soc.c)
6+
zephyr_sources_ifdef(CONFIG_SOC_MCXW716C mcxw71_platform_init.S)
7+
zephyr_sources_ifdef(CONFIG_SOC_MCXW727C mcxw72_platform_init.S)
68

79
zephyr_sources_ifdef(CONFIG_NXP_NBU
810
../../common/nxp_nbu.c

soc/nxp/mcx/mcxw/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,11 @@ config SOC_SERIES_MCXW
1717
select CLOCK_CONTROL
1818

1919
rsource "../../common/Kconfig.nbu"
20+
21+
if SOC_MCXW727C
22+
23+
config MCUX_CORE_SUFFIX
24+
default "_cm33_core0" if SOC_MCXW727C_CPU0
25+
default "_cm33_core1" if SOC_MCXW727C_CPU1
26+
27+
endif # SOC_MCXW727C

soc/nxp/mcx/mcxw/Kconfig.defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
if SOC_SERIES_MCXW
55

66
config NUM_IRQS
7+
default 77 if SOC_MCXW727C
78
default 75
89

910
config SYS_CLOCK_HW_CYCLES_PER_SEC

soc/nxp/mcx/mcxw/Kconfig.soc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,28 @@ config SOC_MCXW716C
1212
bool
1313
select SOC_SERIES_MCXW
1414

15+
config SOC_MCXW727C
16+
bool
17+
select SOC_SERIES_MCXW
18+
19+
config SOC_MCXW727C_CPU0
20+
bool
21+
select SOC_MCXW727C
22+
23+
config SOC_MCXW727C_CPU1
24+
bool
25+
select SOC_MCXW727C
26+
1527
config SOC
1628
default "mcxw716c" if SOC_MCXW716C
29+
default "mcxw727c" if SOC_MCXW727C
1730

1831
config SOC_PART_NUMBER_MCXW716CMFTA
1932
bool
2033

34+
config SOC_PART_NUMBER_MCXW727CMFTA
35+
bool
36+
2137
config SOC_PART_NUMBER
2238
default "MCXW716CMFTA" if SOC_PART_NUMBER_MCXW716CMFTA
39+
default "MCXW727CMFTA" if SOC_PART_NUMBER_MCXW727CMFTA
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
/*
2+
* Copyright 2024 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/**
8+
* @file
9+
* @brief MCXW72 Platform-Specific Initialization
10+
*
11+
* When compared to MCXW71, the Ram Banks with ECC
12+
* are located in different addresses.
13+
*
14+
* MCXW72 SOC reset code that initializes RAM
15+
* to prevent ECC causing faults, and calls SystemInit
16+
*/
17+
18+
#include <zephyr/toolchain.h>
19+
#include <zephyr/linker/sections.h>
20+
21+
_ASM_FILE_PROLOGUE
22+
23+
GTEXT(soc_reset_hook)
24+
SECTION_SUBSEC_FUNC(TEXT,_reset_section,soc_reset_hook)
25+
26+
.soc_reset_hook:
27+
ldr r0, =0x14000000
28+
ldr r1, =.ram_init_ctcm01
29+
bics r1, #0x10000000
30+
cmp r0, r1
31+
bcc .ram_init_done
32+
.ram_init_ctcm01: /* Initialize ctcm01 */
33+
ldr r0, =0x14000000
34+
ldr r1, =0x14008000
35+
ldr r2, =0
36+
ldr r3, =0
37+
ldr r4, =0
38+
ldr r5, =0
39+
.loop01:
40+
stmia r0!, {r2 - r5}
41+
cmp r0, r1
42+
bcc.n .loop01
43+
.ram_init_stcm012: /* Initialize stcm012 */
44+
ldr r0, =0x30000000
45+
ldr r1, =0x30010000
46+
.loop012:
47+
stmia r0!, {r2 - r5}
48+
cmp r0, r1
49+
bcc.n .loop012
50+
.ram_init_stcm8:
51+
ldr r0, =0x30038000
52+
ldr r1, =0x3003a000
53+
.loop8: /* Initialize stcm5 */
54+
stmia r0!, {r2 - r5}
55+
cmp r0, r1
56+
bcc.n .loop8
57+
.ram_init_done:
58+
b SystemInit

soc/nxp/mcx/mcxw/soc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ static ALWAYS_INLINE void clock_init(void)
3939
};
4040
/* Enable OSC32K */
4141
CCM32K_Set32kOscConfig(CCM32K, kCCM32K_Enable32kHzCrystalOsc, &ccm32k_osc_config);
42+
4243
/* Disable ROSC Monitor, because switching the source would generate an expected error */
4344
CLOCK_SetRoscMonitorMode(kSCG_RoscMonitorDisable);
4445

soc/nxp/mcx/soc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ family:
2020
- name: mcxw
2121
socs:
2222
- name: mcxw716c
23+
- name: mcxw727c
24+
cpuclusters:
25+
- name: cpu0
26+
- name: cpu1
2327
runners:
2428
run_once:
2529
'--erase':

0 commit comments

Comments
 (0)