diff --git a/soc/nxp/imxrt/CMakeLists.txt b/soc/nxp/imxrt/CMakeLists.txt index 0755d95812a..ecdb894bfe3 100644 --- a/soc/nxp/imxrt/CMakeLists.txt +++ b/soc/nxp/imxrt/CMakeLists.txt @@ -38,6 +38,9 @@ if(CONFIG_SOC_SERIES_IMXRT10XX OR CONFIG_SOC_SERIES_IMXRT11XX) endif() if(CONFIG_SOC_SERIES_IMXRT118X) + if(CONFIG_EXTERNAL_MEM_CONFIG_DATA) + set(boot_hdr_xmcd_data_section ".boot_hdr.xmcd_data") + endif() zephyr_linker_section_configure( SECTION .rom_start INPUT ".boot_hdr.conf" @@ -45,6 +48,13 @@ if(CONFIG_SOC_SERIES_IMXRT118X) KEEP PRIO 10 ) + zephyr_linker_section_configure( + SECTION .rom_start + INPUT ${boot_hdr_xmcd_data_section} + OFFSET ${CONFIG_EXTERNAL_MEM_CONFIG_OFFSET} + KEEP + PRIO 10 + ) zephyr_linker_section_configure( SECTION .rom_start INPUT ".boot_hdr.container" diff --git a/soc/nxp/imxrt/Kconfig b/soc/nxp/imxrt/Kconfig index b707e7d8514..eb10a3a1a76 100644 --- a/soc/nxp/imxrt/Kconfig +++ b/soc/nxp/imxrt/Kconfig @@ -90,6 +90,7 @@ config EXTERNAL_MEM_CONFIG_DATA config EXTERNAL_MEM_CONFIG_OFFSET hex "External memory configuration offset" depends on EXTERNAL_MEM_CONFIG_DATA + default 0x800 if SOC_SERIES_IMXRT118X default 0x1040 if BOOT_FLEXSPI_NOR || BOOT_SEMC_NOR help As specified by the boot ROM, the External Memory configuration data must be @@ -105,6 +106,13 @@ config NXP_IMX_EXTERNAL_SDRAM an MPU region will be defined to disable cached access to the SDRAM memory space. +config NXP_IMX_EXTERNAL_HYPERRAM + bool "Allow access to external HYPERRAM region" + help + Enable access to external HYPERRAM region managed by the FLEXSPI. + This setting should be enabled when the application uses HYPERRAM, + or an MPU region will be defined to disable cached access to the + HYPERRAM memory space. config SECOND_CORE_MCUX bool "Dual core operation on the RT11xx series" depends on SOC_SERIES_IMXRT11XX diff --git a/soc/nxp/imxrt/boot_header.ld b/soc/nxp/imxrt/boot_header.ld index f91d1598356..618c760f017 100644 --- a/soc/nxp/imxrt/boot_header.ld +++ b/soc/nxp/imxrt/boot_header.ld @@ -17,6 +17,10 @@ KEEP(*(.boot_hdr.conf)) KEEP(*(.flash_conf)) #endif #if defined(CONFIG_SOC_SERIES_IMXRT118X) +#ifdef CONFIG_EXTERNAL_MEM_CONFIG_DATA + . = CONFIG_EXTERNAL_MEM_CONFIG_OFFSET; + KEEP(*(.boot_hdr.xmcd_data)) +#endif . = CONFIG_IMAGE_CONTAINER_OFFSET; KEEP(*(.boot_hdr.container)) #else diff --git a/soc/nxp/imxrt/imxrt118x/linker.ld b/soc/nxp/imxrt/imxrt118x/linker.ld index a7e5123804c..872f5740a0f 100644 --- a/soc/nxp/imxrt/imxrt118x/linker.ld +++ b/soc/nxp/imxrt/imxrt118x/linker.ld @@ -16,6 +16,10 @@ MEMORY SDRAM (wx) : ORIGIN = DT_REG_ADDR(DT_NODELABEL(sdram0)), LENGTH = DT_REG_SIZE(DT_NODELABEL(sdram0)) #endif +#if (DT_REG_SIZE(DT_NODELABEL(hyperram0)) > 0) && !IS_CHOSEN_SRAM(hyperram0) + hyperram0 (wx) : ORIGIN = DT_REG_ADDR(DT_NODELABEL(hyperram0)), LENGTH = DT_REG_SIZE(DT_NODELABEL(hyperram0)) +#endif + } #include