summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/app.lds4
-rw-r--r--firmware/crt0.S19
2 files changed, 23 insertions, 0 deletions
diff --git a/firmware/app.lds b/firmware/app.lds
index 83a09a81d0..bacc645044 100644
--- a/firmware/app.lds
+++ b/firmware/app.lds
@@ -117,6 +117,10 @@ SECTIONS
.data :
{
*(.data)
+ . = ALIGN(0x4);
+ _datacopy = .; /* dummy here, only for ROM based */
+ _datastart = .;
+ _dataend = .;
} > DRAM
.rodata :
diff --git a/firmware/crt0.S b/firmware/crt0.S
index 99aab83867..088ea0aff4 100644
--- a/firmware/crt0.S
+++ b/firmware/crt0.S
@@ -112,6 +112,19 @@ copy_l:
bf copy_l
nop
+ /* copy the .data section, for rombased execution */
+ mov.l datacopy_k,r0
+ mov.l data_k,r1
+ mov.l dataend_k,r2
+copy_l2:
+ mov.l @r0,r3
+ mov.l r3,@r1
+ add #4,r0
+ add #4,r1
+ cmp/ge r2,r1
+ bf copy_l2
+ nop
+
/* Munge the main thread stack */
mov.l stack_k,r2
mov.l deadbeef_k,r0
@@ -150,6 +163,12 @@ iram_k:
.long _iramstart
iramend_k:
.long _iramend
+datacopy_k:
+ .long _datacopy
+data_k:
+ .long _datastart
+dataend_k:
+ .long _dataend
main_k:
.long _main
vbr_k: