Skip to content

soc: nxp: imrt: clean section definitions in boot header #85634

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
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions include/zephyr/linker/sections.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you changed the whitespace practice used in the rest of this file from tabs to spaces.


#define _STM32_SDRAM1_SECTION_NAME .stm32_sdram1
#define _STM32_SDRAM2_SECTION_NAME .stm32_sdram2
Expand Down
51 changes: 1 addition & 50 deletions soc/nxp/imxrt/CMakeLists.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is being used in CMAKE_LINKER_GENERATOR

Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
16 changes: 8 additions & 8 deletions soc/nxp/imxrt/boot_header.ld
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Loading