summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-28 19:23:22 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-28 20:32:38 +0100
commit744ea2ff431a2b19e3fc2074525ce5953ad56609 (patch)
tree863fa3fd2add87c1bfa3b1a03a9a2449514c5dbf
parent9e258652c47b0225730a19775304a33649f5c0a2 (diff)
downloadrockbox-744ea2ff431a2b19e3fc2074525ce5953ad56609.tar.gz
rockbox-744ea2ff431a2b19e3fc2074525ce5953ad56609.zip
x1000: Allow SPL and bootloader to pass arguments to next stage
Change-Id: I61591d704c14acf06cd192a6e9355f0a9c25d0d8
-rw-r--r--firmware/target/mips/ingenic_x1000/crt0.S13
1 files changed, 13 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/crt0.S b/firmware/target/mips/ingenic_x1000/crt0.S
index 86129a35a1..ad2719474b 100644
--- a/firmware/target/mips/ingenic_x1000/crt0.S
+++ b/firmware/target/mips/ingenic_x1000/crt0.S
@@ -55,6 +55,12 @@ _header:
55#endif 55#endif
56 56
57_realstart: 57_realstart:
58 /* Save bootloader arguments. */
59 move s0, a0
60 move s1, a1
61 move s2, a2
62 move s3, a3
63
58 /* Copy IRAM from BSS to low memory. */ 64 /* Copy IRAM from BSS to low memory. */
59 la a0, _iramcopy 65 la a0, _iramcopy
60 la a1, _iramstart 66 la a1, _iramstart
@@ -109,6 +115,13 @@ _realstart:
109 /* Jump to C code */ 115 /* Jump to C code */
110 jal system_early_init 116 jal system_early_init
111 nop 117 nop
118
119 /* Restore bootloader arguments, jump to main. */
120 move a0, s0
121 move a1, s1
122 move a2, s2
123 move a3, s3
124
112 j main 125 j main
113 move ra, zero /* init backtrace root */ 126 move ra, zero /* init backtrace root */
114 127