soc: nxp: MCXNx4x: enable booting from QSPI flash

The ROM bootloader has the option to boot from external QSPI flash on
the FlexSPI instead of internal flash.  Adds
CONFIG_NXP_FLEXSPI_BOOT_HEADER to include the FlexSPI boot ROM header
in the image.

Signed-off-by: Derek Snell <derek.snell@nxp.com>
This commit is contained in:
Derek Snell 2025-05-28 11:35:57 -04:00 committed by Benjamin Cabé
commit 7c77d0ea48
5 changed files with 50 additions and 4 deletions

View file

@ -1,5 +1,5 @@
#
# Copyright 2024 NXP
# Copyright 2024-2025 NXP
#
# SPDX-License-Identifier: Apache-2.0
#
@ -8,6 +8,20 @@
# Flexcomm SDK driver
zephyr_compile_definitions_ifdef(CONFIG_NXP_LP_FLEXCOMM LPFLEXCOMM_INIT_NOT_USED_IN_DRIVER=1)
zephyr_linker_sources_ifdef(CONFIG_NXP_FLEXSPI_BOOT_HEADER
ROM_START SORT_KEY 0 boot_header.ld)
if(CONFIG_NXP_FLEXSPI_BOOT_HEADER)
zephyr_linker_section_configure(
SECTION .rom_start
INPUT ".flexspi_fcb"
OFFSET ${CONFIG_FLEXSPI_CONFIG_BLOCK_OFFSET}
KEEP
PRIO 10
)
zephyr_compile_definitions(XIP_EXTERNAL_FLASH)
endif()
zephyr_sources(soc.c)
if(CONFIG_FLASH_MCUX_FLEXSPI_XIP OR CONFIG_FLASH_MCUX_FLEXSPI_NOR)

View file

@ -1,4 +1,4 @@
# Copyright 2024 NXP
# Copyright 2024-2025 NXP
# SPDX-License-Identifier: Apache-2.0
config SOC_SERIES_MCXN
@ -77,6 +77,27 @@ config SECOND_CORE_MCUX_ACCESS_LEVEL
enabled.
endif
config NXP_FLEXSPI_BOOT_HEADER
bool "Boot header"
default y if FLASH_MCUX_FLEXSPI_XIP && !BOOTLOADER_MCUBOOT
help
Enable data structures required by the boot ROM to boot the
application from an external flash device.
if NXP_FLEXSPI_BOOT_HEADER
config FLEXSPI_CONFIG_BLOCK_OFFSET
hex "FlexSPI config block offset"
default 0x400
help
FlexSPI configuration block consists of parameters regarding specific
flash devices including read command sequence, quad mode enablement
sequence (optional), etc. The boot ROM expects FlexSPI configuration
parameter to be presented in serial nor flash.
endif # NXP_FLEXSPI_BOOT_HEADER
rsource "../../common/Kconfig.flexspi_xip"
endif # SOC_SERIES_MCXN

View file

@ -1,4 +1,4 @@
# Copyright 2024 NXP
# Copyright 2024-2025 NXP
# SPDX-License-Identifier: Apache-2.0
if SOC_SERIES_MCXN
@ -14,6 +14,7 @@ config NUM_IRQS
config ROM_START_OFFSET
default 0x400 if BOOTLOADER_MCUBOOT
default 0x1000 if !BOOTLOADER_MCUBOOT && FLASH_MCUX_FLEXSPI_XIP
config MCUX_LPTMR_TIMER
default n if (DT_HAS_NXP_OS_TIMER_ENABLED || DT_HAS_ARM_ARMV8M_SYSTICK_ENABLED)

View file

@ -0,0 +1,10 @@
/*
* Copyright 2025 NXP
*
* SPDX-License-Identifier: Apache-2.0
*/
#if defined(CONFIG_NXP_FLEXSPI_BOOT_HEADER)
. = CONFIG_FLEXSPI_CONFIG_BLOCK_OFFSET;
KEEP(*(.flexspi_fcb))
#endif

View file

@ -210,7 +210,7 @@ manifest:
groups:
- hal
- name: hal_nxp
revision: d0e49d63ac74208e183ed47ebb4bf8d490ab63fb
revision: 73d478f7afff753c9cf60248e0c0fff4ac572ee0
path: modules/hal/nxp
groups:
- hal