-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Add frdm_mcxe31b board basic support #95560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lucien-nxp
wants to merge
7
commits into
zephyrproject-rtos:main
Choose a base branch
from
nxp-upstream:add_mcxe31x_baseline_support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,921
−5
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
68d5d2b
west.yml: update hal_nxp for mcxe31x pinctrl.h
lucien-nxp 245721e
drivers: clock_control: add nxp_mc_cgm clock driver
lucien-nxp 69d7d31
drivers: interrupt_controller: adapt for mcxe31x series
lucien-nxp 20c707c
driver: pinctrl: adapt for mcxe31x series
lucien-nxp 0ddb1ba
soc: nxp: mcx: add mcxe31 series soc
lucien-nxp 3f24112
dts: arm: nxp: add mcxe31x device tree
lucien-nxp 28ba883
boards: nxp: add frdm_mcxe31b board support
lucien-nxp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
add_subdirectory(${SOC_SERIES}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_FAMILY_MCXE | ||
|
||
rsource "*/Kconfig" | ||
|
||
endif #SOC_FAMILY_MCXE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_FAMILY_MCXE | ||
|
||
rsource "*/Kconfig.defconfig" | ||
nordicjm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
endif # SOC_FAMILY_MCXE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_FAMILY_MCXE | ||
bool | ||
|
||
config SOC_FAMILY | ||
default "mcxe" if SOC_FAMILY_MCXE | ||
|
||
rsource "*/Kconfig.soc" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
zephyr_sources(soc.c) | ||
zephyr_sources(sram_config.c) | ||
zephyr_include_directories(.) | ||
|
||
zephyr_library_sources_ifdef(CONFIG_SOC_RESET_HOOK mcxe31x_soc_initialization.S) | ||
|
||
zephyr_linker_sources_ifdef(CONFIG_BOARD_NXP_MCXE31X_BOOT_HEADER | ||
ROM_START SORT_KEY 0 boot_header.ld) | ||
|
||
zephyr_linker_sources(SECTIONS itcm.ld) | ||
zephyr_code_relocate(FILES sram_config.c LOCATION ${CONFIG_SRAM_CONFIG_RELOCATE_MEM}_TEXT) | ||
|
||
set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm/cortex_m/scripts/linker.ld CACHE INTERNAL "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_SERIES_MCXE31X | ||
select CPU_CORTEX_M7 | ||
select CPU_CORTEX_M_HAS_DWT | ||
select CPU_HAS_FPU | ||
select CPU_HAS_ARM_MPU | ||
select ARM | ||
select CLOCK_CONTROL | ||
select HAS_MCUX | ||
select CPU_HAS_ICACHE | ||
select CPU_HAS_DCACHE | ||
select SOC_RESET_HOOK | ||
select SOC_EARLY_INIT_HOOK | ||
select CODE_DATA_RELOCATION | ||
|
||
if SOC_SERIES_MCXE31X | ||
|
||
if CODE_DATA_RELOCATION | ||
nordicjm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
config SRAM_CONFIG_RELOCATE_MEM | ||
string | ||
default "ITCM" | ||
help | ||
Select memory to relocate sram_config.c code | ||
|
||
endif # CODE_DATA_RELOCATION | ||
|
||
if BOARD_NXP_MCXE31X_BOOT_HEADER | ||
|
||
config BOOT_HEADER_OFFSET | ||
hex "Flash config data offset" | ||
default 0x0 | ||
help | ||
The flash config offset provides the boot ROM with the on-board | ||
flash type and parameters. The boot ROM requires a fixed flash config | ||
offset for FlexSPI device. | ||
|
||
config IMAGE_VECTOR_TABLE_OFFSET | ||
hex "Image vector table offset" | ||
default 0x1000 | ||
help | ||
The Image Vector Table (IVT) provides the boot ROM with pointers to | ||
the application entry point and device configuration data. The boot | ||
ROM requires a fixed IVT offset for each type of boot device. | ||
|
||
endif # BOARD_NXP_MCXE31X_BOOT_HEADER | ||
|
||
endif # SOC_SERIES_MCXE31X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
if SOC_SERIES_MCXE31X | ||
|
||
config NUM_IRQS | ||
default 240 | ||
|
||
config SYS_CLOCK_HW_CYCLES_PER_SEC | ||
default $(dt_node_int_prop_int,/cpus/cpu@0,clock-frequency) if CORTEX_M_SYSTICK | ||
|
||
config CORTEX_M_SYSTICK | ||
default n if (MCUX_LPTMR_TIMER || MCUX_OS_TIMER) | ||
|
||
config ROM_START_OFFSET | ||
default 0x1000 | ||
|
||
endif # SOC_SERIES_MCXE31X |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Copyright 2025 NXP | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
config SOC_SERIES_MCXE31X | ||
bool | ||
select SOC_FAMILY_MCXE | ||
|
||
config SOC_SERIES | ||
default "mcxe31x" if SOC_SERIES_MCXE31X | ||
|
||
config SOC_MCXE315 | ||
bool | ||
select SOC_SERIES_MCXE31X | ||
|
||
config SOC_MCXE316 | ||
bool | ||
select SOC_SERIES_MCXE31X | ||
|
||
config SOC_MCXE317 | ||
bool | ||
select SOC_SERIES_MCXE31X | ||
|
||
config SOC_MCXE31B | ||
bool | ||
select SOC_SERIES_MCXE31X | ||
|
||
config SOC | ||
default "mcxe315" if SOC_MCXE315 | ||
default "mcxe316" if SOC_MCXE316 | ||
default "mcxe317" if SOC_MCXE317 | ||
default "mcxe31b" if SOC_MCXE31B | ||
|
||
config SOC_PART_NUMBER_MCXE315MLF | ||
bool | ||
select SOC_MCXE315 | ||
|
||
config SOC_PART_NUMBER_MCXE315MPA | ||
bool | ||
select SOC_MCXE315 | ||
|
||
config SOC_PART_NUMBER_MCXE316MLF | ||
bool | ||
select SOC_MCXE316 | ||
|
||
config SOC_PART_NUMBER_MCXE316MPA | ||
bool | ||
select SOC_MCXE316 | ||
|
||
config SOC_PART_NUMBER_MCXE317MPA | ||
bool | ||
select SOC_MCXE317 | ||
|
||
config SOC_PART_NUMBER_MCXE317MPB | ||
bool | ||
select SOC_MCXE317 | ||
|
||
config SOC_PART_NUMBER_MCXE31BMPB | ||
bool | ||
select SOC_MCXE31B | ||
|
||
config SOC_PART_NUMBER | ||
default "MCXE315MLF" if SOC_PART_NUMBER_MCXE315MLF | ||
default "MCXE315MPA" if SOC_PART_NUMBER_MCXE315MPA | ||
default "MCXE316MLF" if SOC_PART_NUMBER_MCXE316MLF | ||
default "MCXE316MPA" if SOC_PART_NUMBER_MCXE316MPA | ||
default "MCXE317MPA" if SOC_PART_NUMBER_MCXE317MPA | ||
default "MCXE317MPB" if SOC_PART_NUMBER_MCXE317MPB | ||
default "MCXE31BMPB" if SOC_PART_NUMBER_MCXE31BMPB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/* | ||
* Copyright 2025 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
. += CONFIG_BOOT_HEADER_OFFSET - (. - __rom_start_address); | ||
KEEP(*(.boot_header)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright 2025 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
SECTION_PROLOGUE(.itcm_text,,) | ||
{ | ||
. = ALIGN(4); | ||
_itcm_text_start = .; | ||
KEEP(*(.itcm_text)) | ||
_itcm_text_end = .; | ||
} GROUP_LINK_IN(ITCM) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/* | ||
* Copyright 2025 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <zephyr/devicetree.h> | ||
#include <zephyr/toolchain.h> | ||
#include <zephyr/linker/sections.h> | ||
|
||
#define MC_RGM_BASE DT_REG_ADDR(DT_NODELABEL(mc_rgm)) | ||
#define MC_RGM_DES 0x0 | ||
#define MC_RGM_FES 0x8 | ||
|
||
_ASM_FILE_PROLOGUE | ||
|
||
GTEXT(soc_reset_hook) | ||
|
||
SECTION_FUNC(TEXT, soc_reset_hook) | ||
|
||
/* | ||
* On destructive reset, SRAM and TCM memories must be initialized to a known value using a | ||
* 64-bit master before 32-bit masters can read or write to them. Note that SRAM retains | ||
* content during functional reset through a hardware mechanism, therefore accesses do not | ||
* cause any content corruption errors. | ||
* | ||
* This is implemented directly in ASM, to ensure no stack access is performed. | ||
*/ | ||
|
||
/* If we come from a destructive reset, then ignore functional reset flags */ | ||
ldr r1, =MC_RGM_BASE | ||
ldr r2, [r1, MC_RGM_DES] | ||
cmp r2, 0x0 | ||
bne ECC_INIT | ||
ldr r2, [r1, MC_RGM_FES] | ||
cmp r2, 0x0 | ||
bne ECC_END | ||
|
||
ECC_INIT: | ||
ldr r1, = DT_REG_ADDR(DT_CHOSEN(zephyr_sram)) | ||
ldr r2, = DT_REG_SIZE(DT_CHOSEN(zephyr_sram)) | ||
|
||
subs r2, #1 | ||
|
||
ble SRAM_LOOP_END | ||
|
||
movs r0, 0 | ||
movs r3, 0 | ||
|
||
SRAM_LOOP: | ||
stm r1!, {r0,r3} | ||
subs r2, 8 | ||
bge SRAM_LOOP | ||
|
||
SRAM_LOOP_END: | ||
|
||
#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_itcm), okay) | ||
|
||
ldr r1, = DT_REG_ADDR(DT_CHOSEN(zephyr_itcm)) | ||
ldr r2, = DT_REG_SIZE(DT_CHOSEN(zephyr_itcm)) | ||
|
||
subs r2, #1 | ||
|
||
ITCM_LOOP: | ||
stm r1!, {r0,r3} | ||
subs r2, 8 | ||
bge ITCM_LOOP | ||
#endif | ||
|
||
#if DT_NODE_HAS_STATUS(DT_CHOSEN(zephyr_dtcm), okay) | ||
|
||
ldr r1, = DT_REG_ADDR(DT_CHOSEN(zephyr_dtcm)) | ||
ldr r2, = DT_REG_SIZE(DT_CHOSEN(zephyr_dtcm)) | ||
|
||
subs r2, #1 | ||
|
||
DTCM_LOOP: | ||
stm r1!, {r0,r3} | ||
subs r2, 8 | ||
bge DTCM_LOOP | ||
#endif | ||
|
||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(itcm1), okay) | ||
|
||
ldr r1, = DT_REG_ADDR(DT_NODELABEL(itcm1)) | ||
ldr r2, = DT_REG_SIZE(DT_NODELABEL(itcm1)) | ||
|
||
subs r2, #1 | ||
|
||
ITCM1_LOOP: | ||
stm r1!, {r0,r3} | ||
subs r2, 8 | ||
bge ITCM1_LOOP | ||
#endif | ||
|
||
#if DT_NODE_HAS_STATUS(DT_NODELABEL(dtcm1), okay) | ||
|
||
ldr r1, = DT_REG_ADDR(DT_NODELABEL(dtcm1)) | ||
ldr r2, = DT_REG_SIZE(DT_NODELABEL(dtcm1)) | ||
|
||
subs r2, #1 | ||
|
||
DTCM1_LOOP: | ||
stm r1!, {r0,r3} | ||
subs r2, 8 | ||
bge DTCM1_LOOP | ||
#endif | ||
|
||
ECC_END: | ||
/* save lr value to r4 */ | ||
mov r4, lr | ||
/* Jump to SystemInit function*/ | ||
bl SystemInit | ||
mov lr, r4 | ||
bx lr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright 2025 NXP | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef ZEPHYR_SOC_NXP_MCXE31X_PINCTRL_SOC_H_ | ||
#define ZEPHYR_SOC_NXP_MCXE31X_PINCTRL_SOC_H_ | ||
|
||
#include <zephyr/drivers/pinctrl/pinctrl_nxp_siul2_common.h> | ||
#include <zephyr/dt-bindings/pinctrl/nxp-siul2-pinctrl.h> | ||
#include <zephyr/sys/util.h> | ||
|
||
#define NXP_SIUL2_PINMUX_INIT(group, value) \ | ||
.mscr = {.inst = NXP_SIUL2_PINMUX_GET_MSCR_SIUL2_IDX(value), \ | ||
.idx = NXP_SIUL2_PINMUX_GET_MSCR_IDX(value), \ | ||
.val = SIUL2_MSCR_SSS(NXP_SIUL2_PINMUX_GET_MSCR_SSS(value)) | \ | ||
SIUL2_MSCR_OBE(DT_PROP(group, output_enable)) | \ | ||
SIUL2_MSCR_IBE(DT_PROP(group, input_enable)) | \ | ||
SIUL2_MSCR_PUE(DT_PROP(group, bias_pull_up) || \ | ||
DT_PROP(group, bias_pull_down)) | \ | ||
SIUL2_MSCR_PUS(DT_PROP(group, bias_pull_up)) | \ | ||
SIUL2_MSCR_SRC(DT_ENUM_IDX(group, slew_rate)) | \ | ||
SIUL2_MSCR_DSE(DT_PROP(group, nxp_drive_strength)) | \ | ||
SIUL2_MSCR_INV(DT_PROP(group, nxp_invert))}, \ | ||
.imcr = { \ | ||
.inst = NXP_SIUL2_PINMUX_GET_IMCR_SIUL2_IDX(value), \ | ||
.idx = NXP_SIUL2_PINMUX_GET_IMCR_IDX(value), \ | ||
.val = SIUL2_IMCR_SSS(NXP_SIUL2_PINMUX_GET_IMCR_SSS(value)), \ | ||
} | ||
|
||
#endif /* ZEPHYR_SOC_NXP_MCXE31X_PINCTRL_SOC_H_ */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.