aboutsummaryrefslogtreecommitdiff
path: root/src/host
diff options
context:
space:
mode:
authorIan McIntyre <me@mciantyre.dev>2026-10-26 10:52:57 -0400
committerIan McIntyre <me@mciantyre.dev>2026-11-07 10:20:33 -0500
commit1087e9bb7cd31e6fd88532ead08a927168e36de7 (patch)
treeea487e5dc1758f959e0ef9859e89b8196678e8ac /src/host
parentf0ef2b86cee6b44e801eb80ba301888a608fdd76 (diff)
Zero unallocated memory, too
If the CPU speculates into the RAM we haven't initialized, we can fault when the ECC controller reports bad data. Didn't have that problem when blasting all of RAM... We can use the linker to help us figure out the range of these unused regions. If we don't need to zero anything, the host emits 0 for the start and end, skipping the zeroing. I'm also zeroing the 32 byte reservation at the start of ITCM, along with any padding introduced before the vector table. With this in place, the rip_through_ram firmware does not report any exceptions.
Diffstat (limited to 'src/host')
-rw-r--r--src/host/imxrt-link.x14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/host/imxrt-link.x b/src/host/imxrt-link.x
index c04e3d4..48a792b 100644
--- a/src/host/imxrt-link.x
+++ b/src/host/imxrt-link.x
@@ -51,6 +51,13 @@ SECTIONS
_stack_start = __sstack;
} > REGION_STACK
+ .vector_table_pad (NOLOAD) : ALIGN(8)
+ {
+ __svector_table_pad = .;
+ . = ALIGN(1024);
+ __evector_table_pad = .;
+ } > REGION_VTABLE
+
.vector_table : ALIGN(1024)
{
FILL(0xff);
@@ -170,6 +177,9 @@ SECTIONS
ASSERT(__sstack % 8 == 0 && __estack % 8 == 0, "
BUG(imxrt-rt): .stack is not 8-byte aligned");
+ASSERT(__svector_table_pad % 8 == 0 && __evector_table_pad % 8 == 0, "
+BUG(imxrt-rt): .vector_table_pad is not 8-byte aligned");
+
ASSERT(__stext % 8 == 0 && __etext % 8 == 0, "
BUG(imxrt-rt): .text is not 8-byte aligned");
@@ -199,7 +209,9 @@ BUG(imxrt-rt): .heap is not 8-byte aligned");
/* # Position checks */
-/* ## .vector_table */
+ASSERT(__evector_table_pad == ADDR(.vector_table), "
+BUG(imxrt-rt): .vector_table_pad does not end at the vector table");
+
ASSERT(__reset_vector == ADDR(.vector_table) + 0x8, "
BUG(imxrt-rt): the reset vector is missing");