diff --git a/include/zephyr/linker/sections.h b/include/zephyr/linker/sections.h index 36159427fa677..342e52ff08443 100644 --- a/include/zephyr/linker/sections.h +++ b/include/zephyr/linker/sections.h @@ -63,11 +63,13 @@ #define _OCM_BSS_SECTION_NAME .ocm_bss #endif -#define _IMX_BOOT_CONF_SECTION_NAME .boot_hdr.conf -#define _IMX_BOOT_DATA_SECTION_NAME .boot_hdr.data -#define _IMX_BOOT_IVT_SECTION_NAME .boot_hdr.ivt -#define _IMX_BOOT_DCD_SECTION_NAME .boot_hdr.dcd_data -#define _IMX_BOOT_CONTAINER_SECTION_NAME .boot_hdr.container +#define _IMX_BOOT_CONF_SECTION_NAME .boot_hdr.conf +#define _IMX_BOOT_DATA_SECTION_NAME .boot_hdr.data +#define _IMX_BOOT_IVT_SECTION_NAME .boot_hdr.ivt +#define _IMX_BOOT_DCD_SECTION_NAME .boot_hdr.dcd_data +#define _IMX_BOOT_CONTAINER_SECTION_NAME .boot_hdr.container +#define _IMX_BOOT_FLASH_CONF_SECTION_NAME .flash_conf +#define _IMX_BOOT_XMCD_SECTION_NAME .boot_hdr.xmcd_data #define _STM32_SDRAM1_SECTION_NAME .stm32_sdram1 #define _STM32_SDRAM2_SECTION_NAME .stm32_sdram2 diff --git a/soc/nxp/imxrt/CMakeLists.txt b/soc/nxp/imxrt/CMakeLists.txt index 82d23ee5b5a0d..6b73de6da9c98 100644 --- a/soc/nxp/imxrt/CMakeLists.txt +++ b/soc/nxp/imxrt/CMakeLists.txt @@ -10,59 +10,10 @@ zephyr_linker_sources_ifdef(CONFIG_NXP_IMXRT_BOOT_HEADER ROM_START SORT_KEY 0 boot_header.ld) if(CONFIG_SOC_SERIES_IMXRT10XX OR CONFIG_SOC_SERIES_IMXRT11XX) - if(CONFIG_DEVICE_CONFIGURATION_DATA) - set(boot_hdr_dcd_data_section ".boot_hdr.dcd_data") - endif() - if(CONFIG_EXTERNAL_MEM_CONFIG_DATA) - set(boot_hdr_xmcd_data_section ".boot_hdr.xmcd_data") - endif() zephyr_sources_ifdef(CONFIG_ARM_MPU mpu_regions.c) - zephyr_linker_section_configure( - SECTION .rom_start - INPUT ".boot_hdr.conf" - OFFSET ${CONFIG_FLEXSPI_CONFIG_BLOCK_OFFSET} - KEEP - PRIO 10 - ) - zephyr_linker_section_configure( - SECTION .rom_start - INPUT ".boot_hdr.ivt" - ".boot_hdr.data" - ${boot_hdr_dcd_data_section} - ${boot_hdr_xmcd_data_section} - OFFSET ${CONFIG_IMAGE_VECTOR_TABLE_OFFSET} - FIRST - KEEP - PRIO 11 - ) - zephyr_compile_definitions(XIP_EXTERNAL_FLASH) 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" - OFFSET ${CONFIG_FLEXSPI_CONFIG_BLOCK_OFFSET} - 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" - OFFSET ${CONFIG_IMAGE_CONTAINER_OFFSET} - KEEP - PRIO 11 - ) +if(CONFIG_SOC_SERIES_IMXRT10XX OR CONFIG_SOC_SERIES_IMXRT11XX OR CONFIG_SOC_SERIES_IMXRT118X) zephyr_compile_definitions(XIP_EXTERNAL_FLASH) endif() diff --git a/soc/nxp/imxrt/boot_header.ld b/soc/nxp/imxrt/boot_header.ld index b61487c481955..0a70bbe994410 100644 --- a/soc/nxp/imxrt/boot_header.ld +++ b/soc/nxp/imxrt/boot_header.ld @@ -15,29 +15,29 @@ __Vectors = __VECTOR_TABLE; . = CONFIG_FLEXSPI_CONFIG_BLOCK_OFFSET; #endif #if defined(CONFIG_SOC_SERIES_IMXRT11XX) || defined(CONFIG_SOC_SERIES_IMXRT10XX) || defined(CONFIG_SOC_SERIES_IMXRT118X) -KEEP(*(.boot_hdr.conf)) +KEEP(*(_IMX_BOOT_CONF_SECTION_NAME)) #endif #if defined(CONFIG_SOC_SERIES_IMXRT6XX) || defined(CONFIG_SOC_SERIES_IMXRT5XX) || defined(CONFIG_SOC_SERIES_IMXRT7XX) -KEEP(*(.flash_conf)) +KEEP(*(_IMX_BOOT_FLASH_CONF_SECTION_NAME)) #endif #if defined(CONFIG_SOC_SERIES_IMXRT118X) #ifdef CONFIG_EXTERNAL_MEM_CONFIG_DATA . = CONFIG_EXTERNAL_MEM_CONFIG_OFFSET; - KEEP(*(.boot_hdr.xmcd_data)) + KEEP(*(_IMX_BOOT_XMCD_SECTION_NAME)) #endif . = CONFIG_IMAGE_CONTAINER_OFFSET; -KEEP(*(.boot_hdr.container)) +KEEP(*(_IMX_BOOT_CONTAINER_SECTION_NAME)) #else . = CONFIG_IMAGE_VECTOR_TABLE_OFFSET; -KEEP(*(.boot_hdr.ivt)) +KEEP(*(_IMX_BOOT_IVT_SECTION_NAME)) #endif #if defined(CONFIG_SOC_SERIES_IMXRT11XX) || defined(CONFIG_SOC_SERIES_IMXRT10XX) -KEEP(*(.boot_hdr.data)) +KEEP(*(_IMX_BOOT_DATA_SECTION_NAME)) #ifdef CONFIG_DEVICE_CONFIGURATION_DATA - KEEP(*(.boot_hdr.dcd_data)) + KEEP(*(_IMX_BOOT_DCD_SECTION_NAME)) #endif /* CONFIG_DEVICE_CONFIGURATION_DATA */ #ifdef CONFIG_EXTERNAL_MEM_CONFIG_DATA . = CONFIG_EXTERNAL_MEM_CONFIG_OFFSET; - KEEP(*(.boot_hdr.xmcd_data)) + KEEP(*(_IMX_BOOT_XMCD_SECTION_NAME)) #endif #endif /* CONFIG_SOC_SERIES_IMXRT10XX || CONFIG_SOC_SERIES_IMXRT11XX */