boards: nxp: rt1170_evk: Add XMCD bootheader

Currently, only DCD bootheader was supported to configure the SDRAM.

On IMX RT1170, XMCD can be used as an alternative boot header to DCD.
XMCD is more advanced than DCD and enhances SDRAM access speed.
This is benefit for SDRAM access application.

Signed-off-by: Trung Hieu Le <trunghieu.le@nxp.com>
This commit is contained in:
Trung Hieu Le 2024-04-25 12:05:52 +02:00 committed by Alberto Escolar
commit 3cb5e4ed54
4 changed files with 33 additions and 6 deletions

View file

@ -28,16 +28,16 @@ if(CONFIG_NXP_IMXRT_BOOT_HEADER)
zephyr_library_sources(${RT1170_BOARD_DIR}/xip/${RT1170_BOARD_NAME}_flexspi_nor_config.c) zephyr_library_sources(${RT1170_BOARD_DIR}/xip/${RT1170_BOARD_NAME}_flexspi_nor_config.c)
zephyr_library_include_directories(${RT1170_BOARD_DIR}/xip) zephyr_library_include_directories(${RT1170_BOARD_DIR}/xip)
endif() endif()
if(CONFIG_DEVICE_CONFIGURATION_DATA) if(CONFIG_EXTERNAL_MEM_CONFIG_DATA)
# Include device configuration data block for RT1170 EVK from NXP's HAL. # Include external memory configuration data block for RT1170 EVK from NXP's HAL.
# This configuration block may need modification if another SDRAM chip # This configuration block may need modification if another SDRAM chip
# is used on your custom board. # is used on your custom board.
zephyr_compile_definitions(XIP_BOOT_HEADER_DCD_ENABLE=1) zephyr_compile_definitions(XIP_BOOT_HEADER_XMCD_ENABLE=1)
zephyr_library_sources(${RT1170_BOARD_DIR}/dcd.c) zephyr_library_sources(${RT1170_BOARD_DIR}/xmcd/xmcd.c)
else() else()
if(CONFIG_SRAM_BASE_ADDRESS EQUAL 0x80000000) if(CONFIG_SRAM_BASE_ADDRESS EQUAL 0x80000000)
message(WARNING "You are using SDRAM as RAM but no device " message(WARNING "You are using SDRAM as RAM but no external memory"
"configuration data (DCD) is included. This configuration may not boot") "configuration data (XMCD) is included. This configuration may not boot")
endif() endif()
endif() endif()
endif() endif()

View file

@ -13,6 +13,9 @@ if(CONFIG_SOC_SERIES_IMXRT10XX OR CONFIG_SOC_SERIES_IMXRT11XX)
if(CONFIG_DEVICE_CONFIGURATION_DATA) if(CONFIG_DEVICE_CONFIGURATION_DATA)
set(boot_hdr_dcd_data_section ".boot_hdr.dcd_data") set(boot_hdr_dcd_data_section ".boot_hdr.dcd_data")
endif() endif()
if(CONFIG_EXTERNAL_MEM_CONFIG_DATA)
set(boot_hdr_xmcd_data_section ".boot_hdr.xmcd_data")
endif()
zephyr_sources(mpu_regions.c) zephyr_sources(mpu_regions.c)
zephyr_linker_section_configure( zephyr_linker_section_configure(
SECTION .rom_start SECTION .rom_start
@ -26,6 +29,7 @@ if(CONFIG_SOC_SERIES_IMXRT10XX OR CONFIG_SOC_SERIES_IMXRT11XX)
INPUT ".boot_hdr.ivt" INPUT ".boot_hdr.ivt"
".boot_hdr.data" ".boot_hdr.data"
${boot_hdr_dcd_data_section} ${boot_hdr_dcd_data_section}
${boot_hdr_xmcd_data_section}
OFFSET ${CONFIG_IMAGE_VECTOR_TABLE_OFFSET} OFFSET ${CONFIG_IMAGE_VECTOR_TABLE_OFFSET}
KEEP KEEP
PRIO 11 PRIO 11

View file

@ -114,6 +114,25 @@ config DEVICE_CONFIGURATION_DATA
initialized at boot time. initialized at boot time.
config EXTERNAL_MEM_CONFIG_DATA
bool "External Memory Configuration Data"
depends on !DEVICE_CONFIGURATION_DATA
help
External memory configuration data (XMDC) provides an alternative
configuration sequences which allows to intilialize the external memory
at the boot time. This sequence allows to configure
external memories (such as SDRAM) with more advanced option.
This is a new alternative boot header compared to DCD, and DCD must be disabled
in order to select this option.
config EXTERNAL_MEM_CONFIG_OFFSET
hex "External memory configuration offset"
depends on EXTERNAL_MEM_CONFIG_DATA
default 0x1040 if BOOT_FLEXSPI_NOR || BOOT_SEMC_NOR
help
As specified by the boot ROM, the External Memory configuration data must be
placed in a specific address location to be pointed by the boot ROM.
endif # NXP_IMXRT_BOOT_HEADER endif # NXP_IMXRT_BOOT_HEADER
config NXP_IMX_EXTERNAL_SDRAM config NXP_IMX_EXTERNAL_SDRAM

View file

@ -18,4 +18,8 @@ KEEP(*(.boot_hdr.data))
#ifdef CONFIG_DEVICE_CONFIGURATION_DATA #ifdef CONFIG_DEVICE_CONFIGURATION_DATA
KEEP(*(.boot_hdr.dcd_data)) KEEP(*(.boot_hdr.dcd_data))
#endif /* CONFIG_DEVICE_CONFIGURATION_DATA */ #endif /* CONFIG_DEVICE_CONFIGURATION_DATA */
#ifdef CONFIG_EXTERNAL_MEM_CONFIG_DATA
. = CONFIG_EXTERNAL_MEM_CONFIG_OFFSET;
KEEP(*(.boot_hdr.xmcd_data))
#endif
#endif /* CONFIG_SOC_SERIES_IMXRT10XX || CONFIG_SOC_SERIES_IMXRT11XX */ #endif /* CONFIG_SOC_SERIES_IMXRT10XX || CONFIG_SOC_SERIES_IMXRT11XX */