aboutsummaryrefslogtreecommitdiff
path: root/src/target.rs
diff options
context:
space:
mode:
authorNils Fitinghoff <nils.fitinghoff@kiteshield.com>2024-10-16 13:04:23 +0200
committerNils Fitinghoff <nils.fitinghoff@kiteshield.com>2024-10-17 17:40:20 +0200
commit9138706b8a5e4469f33a7a826c08e6446b642a3c (patch)
tree1a530c8d1f96cf2193666f9ae595f8f399366899 /src/target.rs
parentcb3af5ba736443adbf3dbf305f7a95aa23f3d26b (diff)
Support RT1180 family
The 1180 family uses a different boot header than previous families. The header is generated to support the default configuration where hash and signature errors are ignored. The XIP `__pre_init` strategy is still used, more for ease of getting something running than because of any known problems with the boot ROM's implementation of loading images to different memories. The boot ROM for the 1180 does not appear to allow the entry point to lie outside the (loaded or execute-in-place) image, so a new `.xip` section is added after the vector table to put the address inside the image while keeping VMA=LMA. This could cause problems for tools that manipulate binaries based on section names.
Diffstat (limited to 'src/target.rs')
-rw-r--r--src/target.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/target.rs b/src/target.rs
index 3a61584..765862d 100644
--- a/src/target.rs
+++ b/src/target.rs
@@ -41,6 +41,9 @@ global_asm! {r#"
__pre_init:
ldr r0, =__imxrt_family @ Need to know which chip family we're initializing.
+ ldr r1, =1180
+ cmp r0, r1 @ Is this an 1180?
+ beq flexram_1180
ldr r1, =1170
cmp r0, r1 @ Is this an 1170?
@@ -66,7 +69,14 @@ __pre_init:
ldr r1, [r0, #64] @ r1 = *(IMXRT_IOMUXC_GPR + 16)
orr r1, r1, #1<<2 @ r1 |= 1 << 2
str r1, [r0, #64] @ *(IMXRT_IOMUXC_GPR + 16) = r1
+ b copy_from_flash
+ flexram_1180:
+ ldr r0, =0x444F0060 @ M33_CONFIG
+ ldr r1, =__flexram_config
+ str r1, [r0, #0]
+
+ copy_from_flash:
# Conditionally copy text.
ldr r0, =__stext
ldr r2, =__sitext