From 54c1af861c4808019f449cfe5cbec73ef9218a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20R=C3=B8nningstad?= Date: Thu, 28 Nov 2019 17:02:37 +0100 Subject: [PATCH] arm: linker.ld: Port NXP_IMX_RT_BOOT_HEADER to zephyr_linker_sources() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the .boot_hdr.* sections via its own linker script snippet. Signed-off-by: Øyvind Rønningstad --- include/arch/arm/cortex_m/scripts/linker.ld | 10 ---------- include/arch/arm/cortex_r/scripts/linker.ld | 10 ---------- soc/arm/nxp_imx/rt/CMakeLists.txt | 3 +++ soc/arm/nxp_imx/rt/boot_header.ld | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 soc/arm/nxp_imx/rt/boot_header.ld diff --git a/include/arch/arm/cortex_m/scripts/linker.ld b/include/arch/arm/cortex_m/scripts/linker.ld index 2b00d7cd3e8..5d1891acced 100644 --- a/include/arch/arm/cortex_m/scripts/linker.ld +++ b/include/arch/arm/cortex_m/scripts/linker.ld @@ -144,16 +144,6 @@ SECTIONS KEEP(*(".dbghdr.*")) #endif -#ifdef CONFIG_NXP_IMX_RT_BOOT_HEADER - KEEP(*(.boot_hdr.conf)) - . = CONFIG_IMAGE_VECTOR_TABLE_OFFSET; - KEEP(*(.boot_hdr.ivt)) - KEEP(*(.boot_hdr.data)) -#ifdef CONFIG_DEVICE_CONFIGURATION_DATA - KEEP(*(.boot_hdr.dcd_data)) -#endif -#endif - . = CONFIG_TEXT_SECTION_OFFSET; /* Located in generated directory. This file is populated by the diff --git a/include/arch/arm/cortex_r/scripts/linker.ld b/include/arch/arm/cortex_r/scripts/linker.ld index a6f602415ea..7fec36c4a2b 100644 --- a/include/arch/arm/cortex_r/scripts/linker.ld +++ b/include/arch/arm/cortex_r/scripts/linker.ld @@ -141,16 +141,6 @@ SECTIONS KEEP(*(".dbghdr.*")) #endif -#ifdef CONFIG_NXP_IMX_RT_BOOT_HEADER - KEEP(*(.boot_hdr.conf)) - . = CONFIG_IMAGE_VECTOR_TABLE_OFFSET; - KEEP(*(.boot_hdr.ivt)) - KEEP(*(.boot_hdr.data)) -#ifdef CONFIG_DEVICE_CONFIGURATION_DATA - KEEP(*(.boot_hdr.dcd_data)) -#endif -#endif - . = CONFIG_TEXT_SECTION_OFFSET; /* Located in generated directory. This file is populated by the diff --git a/soc/arm/nxp_imx/rt/CMakeLists.txt b/soc/arm/nxp_imx/rt/CMakeLists.txt index 09d3c2b6c33..b709c3a72f8 100644 --- a/soc/arm/nxp_imx/rt/CMakeLists.txt +++ b/soc/arm/nxp_imx/rt/CMakeLists.txt @@ -7,3 +7,6 @@ zephyr_sources( soc.c ) + +zephyr_linker_sources_ifdef(CONFIG_NXP_IMX_RT_BOOT_HEADER + TEXT_START SORT_KEY 0 boot_header.ld) diff --git a/soc/arm/nxp_imx/rt/boot_header.ld b/soc/arm/nxp_imx/rt/boot_header.ld new file mode 100644 index 00000000000..6172dc1a4c8 --- /dev/null +++ b/soc/arm/nxp_imx/rt/boot_header.ld @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2019 NXP + * Copyright (c) 2019 Nordic Semiconductor ASA + * + * SPDX-License-Identifier: Apache-2.0 + */ + +KEEP(*(.boot_hdr.conf)) +. = CONFIG_IMAGE_VECTOR_TABLE_OFFSET; +KEEP(*(.boot_hdr.ivt)) +KEEP(*(.boot_hdr.data)) +#ifdef CONFIG_DEVICE_CONFIGURATION_DATA + KEEP(*(.boot_hdr.dcd_data)) +#endif