diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-03-03 19:17:00 +0000 |
---|---|---|
committer | Aidan MacDonald <amachronic@protonmail.com> | 2022-03-06 23:22:49 +0000 |
commit | ca12478df64aaae9e6a79ba0079ed02bb860a601 (patch) | |
tree | 6f3b0857f3be6b27f5c168462eedd303b934af5e /firmware/target/mips/ingenic_x1000 | |
parent | 19d95d7b56aa8a6a3a7cdcd2ee80161de9598225 (diff) | |
download | rockbox-ca12478df64aaae9e6a79ba0079ed02bb860a601.tar.gz rockbox-ca12478df64aaae9e6a79ba0079ed02bb860a601.zip |
x1000: add simple binary header to declare the load address
The header format is basic, a variable length list of values
tagged by 4-byte strings. The main application to to allow a
loader to determine the load address of the binary at runtime
instead of using a hardcoded address. But the header contents
aren't fixed and it could be extended for other purposes too.
Change-Id: If51d85b4c2eb53c919a91b54985b157e8e5c20ef
Diffstat (limited to 'firmware/target/mips/ingenic_x1000')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/crt0.S | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/crt0.S b/firmware/target/mips/ingenic_x1000/crt0.S index 304f8d682f..47c3c4f964 100644 --- a/firmware/target/mips/ingenic_x1000/crt0.S +++ b/firmware/target/mips/ingenic_x1000/crt0.S | |||
@@ -25,6 +25,7 @@ | |||
25 | .text | 25 | .text |
26 | .extern main | 26 | .extern main |
27 | .extern system_early_init | 27 | .extern system_early_init |
28 | .extern _loadaddress | ||
28 | .global _start | 29 | .global _start |
29 | 30 | ||
30 | .set push | 31 | .set push |
@@ -35,6 +36,19 @@ | |||
35 | .section .init.text | 36 | .section .init.text |
36 | 37 | ||
37 | _start: | 38 | _start: |
39 | b _realstart | ||
40 | nop | ||
41 | |||
42 | /* Header entries are 4-byte string labels (not null terminated!) followed | ||
43 | * by 4-byte values. Header should begin in the first 128 bytes and should | ||
44 | * be no more than 256 bytes in length. */ | ||
45 | _header: | ||
46 | .ascii "BEGINHDR" /* beginning of header */ | ||
47 | .ascii "LOAD" | ||
48 | .word _loadaddress | ||
49 | .ascii "ENDH" /* end of header structure */ | ||
50 | |||
51 | _realstart: | ||
38 | /* Cache init */ | 52 | /* Cache init */ |
39 | li v0, 0x80000000 | 53 | li v0, 0x80000000 |
40 | ori v1, v0, 0x4000 | 54 | ori v1, v0, 0x4000 |