Skip to content

Commit 057eb6d

Browse files
lucien-nxpjhedberg
authored andcommitted
soc: nxp: mcx: add mcxe24x series soc
- create 'mcxe' as family and 'mcxe24x' as series - add pinctrl_soc.h - add soc.c/.h to do system initialization - Support flash boot if CONFIG_MCXE_FLASH_CONFIG==1 Signed-off-by: Lucien Zhao <[email protected]>
1 parent a044862 commit 057eb6d

File tree

15 files changed

+280
-1
lines changed

15 files changed

+280
-1
lines changed

modules/hal_nxp/mcux/Kconfig.mcux

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ config HAS_MCUX
88
bool
99
depends on SOC_FAMILY_KINETIS || SOC_FAMILY_NXP_IMX || SOC_FAMILY_LPC || \
1010
SOC_FAMILY_NXP_S32 || SOC_FAMILY_NXP_IMXRT || SOC_FAMILY_NXP_RW || \
11-
SOC_FAMILY_MCXN || SOC_FAMILY_MCXA || SOC_FAMILY_MCXW || SOC_FAMILY_MCXC
11+
SOC_FAMILY_MCXN || SOC_FAMILY_MCXA || SOC_FAMILY_MCXW || SOC_FAMILY_MCXC || \
12+
SOC_FAMILY_MCXE
1213

1314
if HAS_MCUX
1415

soc/nxp/mcx/mcxe/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
add_subdirectory(${SOC_SERIES})

soc/nxp/mcx/mcxe/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_FAMILY_MCXE
5+
6+
rsource "*/Kconfig"
7+
8+
endif #SOC_FAMILY_MCXE

soc/nxp/mcx/mcxe/Kconfig.defconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_FAMILY_MCXE
5+
6+
rsource "*/Kconfig.defconfig"
7+
8+
endif # SOC_FAMILY_MCXE

soc/nxp/mcx/mcxe/Kconfig.soc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_FAMILY_MCXE
5+
bool
6+
7+
config SOC_FAMILY
8+
default "mcxe" if SOC_FAMILY_MCXE
9+
10+
rsource "*/Kconfig.soc"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
zephyr_sources_ifdef(CONFIG_MCXE_FLASH_CONFIG flash_configuration.c)
5+
6+
zephyr_include_directories(.)
7+
8+
zephyr_sources(soc.c)
9+
10+
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "")
11+
12+
zephyr_linker_sources_ifdef(CONFIG_MCXE_FLASH_CONFIG
13+
ROM_START
14+
SORT_KEY 0x400
15+
flash_config.ld
16+
)
17+
18+
# CMSIS SystemInit will disable watchdog unless instructed not to.
19+
# Add a compiler definition here to leave watchdog untouched
20+
# if this Kconfig is set
21+
zephyr_compile_definitions_ifdef(CONFIG_WDOG_ENABLE_AT_BOOT DISABLE_WDOG=0)

soc/nxp/mcx/mcxe/mcxe24x/Kconfig

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_MCXE24X
5+
select ARM
6+
select CPU_CORTEX_M4
7+
select CPU_CORTEX_M_HAS_DWT
8+
select CPU_HAS_FPU
9+
select HAS_MCUX
10+
select CLOCK_CONTROL
11+
select SOC_RESET_HOOK
12+
13+
if SOC_SERIES_MCXE24X
14+
15+
config MCXE_FLASH_CONFIG
16+
bool "MCXE flash configuration field"
17+
default y if XIP && !BOOTLOADER_MCUBOOT
18+
help
19+
Include the 16-byte flash configuration field that stores default
20+
protection settings (loaded on reset) and security information that
21+
allows the MCU to restrict access to the FTFC module.
22+
23+
config WDOG_ENABLE_AT_BOOT
24+
bool "Keep watchdog timer enabled at boot"
25+
help
26+
Leave SOC watchdog timer enabled at boot. The specific timeout
27+
and clock configuration of the watchdog at boot is SOC dependent.
28+
Note: if the watchdog timer is enabled at boot, the user will
29+
need to configure the watchdog using z_arm_watchdog_init, as
30+
the SOC requires watchdog configuration before initial expiration
31+
32+
# Enable watchdog configuration function if watchdog is left enabled at boot
33+
config WDOG_INIT
34+
bool
35+
default WDOG_ENABLE_AT_BOOT
36+
37+
endif # SOC_SERIES_MCXE24X
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SOC_SERIES_MCXE24X
5+
6+
config CORTEX_M_SYSTICK
7+
default n if MCUX_LPTMR_TIMER
8+
9+
config SYS_CLOCK_HW_CYCLES_PER_SEC
10+
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) if CORTEX_M_SYSTICK
11+
default $(dt_node_int_prop_int,/soc/lptmr@40040000,clock-frequency) if MCUX_LPTMR_TIMER
12+
13+
config NUM_IRQS
14+
default 146
15+
16+
config CPU_HAS_CUSTOM_FIXED_SOC_MPU_REGIONS
17+
default y
18+
19+
config GPIO
20+
default y
21+
22+
endif # SOC_SERIES_MCXE24X
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2025 NXP
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SOC_SERIES_MCXE24X
5+
bool
6+
select SOC_FAMILY_MCXE
7+
8+
config SOC_SERIES
9+
default "mcxe24x" if SOC_SERIES_MCXE24X
10+
11+
config SOC_MCXE245
12+
bool
13+
select SOC_SERIES_MCXE24X
14+
15+
config SOC_MCXE246
16+
bool
17+
select SOC_SERIES_MCXE24X
18+
19+
config SOC_MCXE247
20+
bool
21+
select SOC_SERIES_MCXE24X
22+
23+
config SOC
24+
default "mcxe245" if SOC_MCXE245
25+
default "mcxe246" if SOC_MCXE246
26+
default "mcxe247" if SOC_MCXE247
27+
28+
config SOC_PART_NUMBER_MCXE245VLF
29+
bool
30+
31+
config SOC_PART_NUMBER_MCXE245VLH
32+
bool
33+
34+
config SOC_PART_NUMBER_MCXE245VLL
35+
bool
36+
37+
config SOC_PART_NUMBER_MCXE246VLH
38+
bool
39+
40+
config SOC_PART_NUMBER_MCXE246VLL
41+
bool
42+
43+
config SOC_PART_NUMBER_MCXE246VLQ
44+
bool
45+
46+
config SOC_PART_NUMBER_MCXE247VLL
47+
bool
48+
49+
config SOC_PART_NUMBER_MCXE247VLQ
50+
bool
51+
52+
config SOC_PART_NUMBER
53+
default "MCXE245VLF" if SOC_PART_NUMBER_MCXE245VLF
54+
default "MCXE245VLH" if SOC_PART_NUMBER_MCXE245VLH
55+
default "MCXE245VLL" if SOC_PART_NUMBER_MCXE245VLL
56+
default "MCXE246VLH" if SOC_PART_NUMBER_MCXE246VLH
57+
default "MCXE246VLL" if SOC_PART_NUMBER_MCXE246VLL
58+
default "MCXE246VLQ" if SOC_PART_NUMBER_MCXE246VLQ
59+
default "MCXE247VLL" if SOC_PART_NUMBER_MCXE247VLL
60+
default "MCXE247VLQ" if SOC_PART_NUMBER_MCXE247VLQ
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Copyright 2025 NXP
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
. = 0x400;
8+
KEEP(*(.kinetis_flash_config))
9+
KEEP(*(".kinetis_flash_config.*"))

0 commit comments

Comments
 (0)