aboutsummaryrefslogtreecommitdiff
path: root/src/host/imxrt-boot-header.x
diff options
context:
space:
mode:
authorsummivox <summivox@gmail.com>2023-08-20 23:13:59 -0700
committerIan McIntyre <ianpmcintyre@gmail.com>2023-09-08 19:18:34 -0400
commitc6d3bcfb11800c58339037be58fa9935f816f1bb (patch)
tree4e8b0d6cdae543e0443f4a8d4cf969f4def7a1f3 /src/host/imxrt-boot-header.x
parente1fddd5b3b678c43ee59835d7b57bbc063a22d28 (diff)
Add optional DCD section in linker script
Users can define their device configuration data (DCD), and place the data in the .dcd section. If the .dcd section has content, the entry in the IVT points at the user's DCD. This plays well with imxrt-dcd.
Diffstat (limited to 'src/host/imxrt-boot-header.x')
-rw-r--r--src/host/imxrt-boot-header.x7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/host/imxrt-boot-header.x b/src/host/imxrt-boot-header.x
index 296eff5..ed9d789 100644
--- a/src/host/imxrt-boot-header.x
+++ b/src/host/imxrt-boot-header.x
@@ -53,7 +53,7 @@ SECTIONS
LONG(0x402000D1); /* Header, magic number */
LONG(__sivector_table); /* Address of the vectors table */
LONG(0x00000000); /* RESERVED */
- LONG(0x00000000); /* Device Configuration Data (unused) */
+ LONG(__dcd); /* Device Configuration Data */
LONG(__boot_data); /* Address to boot data */
LONG(__ivt); /* Self reference */
LONG(0x00000000); /* Command Sequence File (unused) */
@@ -67,6 +67,11 @@ SECTIONS
LONG(__image_size); /* Length of image */
LONG(0x00000000); /* Plugin flag (unused) */
LONG(0xDEADBEEF); /* Dummy to align boot data to 16 bytes */
+ . = ALIGN(4);
+ __dcd_start = .;
+ KEEP(*(.dcd)); /* Device Configuration Data */
+ __dcd_end = .;
+ __dcd = ((__dcd_end - __dcd_start) > 0) ? __dcd_start : 0;
*(.Reset); /* Jam the imxrt-rt reset handler into flash. */
*(.__pre_init); /* Also jam the pre-init function, since we need it to run before instructions are placed. */
. = ORIGIN(FLASH) + 0x2000; /* Reserve the remaining 8K as a convenience for a non-XIP boot. */