diff options
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/imxrt-boot-header.x | 7 | ||||
| -rw-r--r-- | src/host/imxrt-link.x | 3 |
2 files changed, 9 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. */ diff --git a/src/host/imxrt-link.x b/src/host/imxrt-link.x index d02a170..71b697e 100644 --- a/src/host/imxrt-link.x +++ b/src/host/imxrt-link.x @@ -191,6 +191,9 @@ ERROR(imxrt-rt): .got section detected in the input object files Dynamic relocations are not supported. If you are linking to C code compiled using the 'cc' crate then modify your build script to compile the C code _without_ the -fPIC flag. See the documentation of the `cc::Build.pic` method for details."); + +ASSERT((__dcd_end - __dcd_start) % 4 == 0, " +ERROR(imxrt-rt): .dcd (Device Configuration Data) size must be a multiple of 4 bytes."); /* Do not exceed this mark in the error messages above | */ /* ===--- End imxrt-link.x ---=== */ |
