summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-28 19:25:34 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-28 20:58:26 +0100
commitd09fb6bb6b92782ba763219ca19d3125159ec848 (patch)
treece367eafa778d22a82a450ff952b516cfdd449c1
parent744ea2ff431a2b19e3fc2074525ce5953ad56609 (diff)
downloadrockbox-d09fb6bb6b.tar.gz
rockbox-d09fb6bb6b.zip
x1000: Pass CPM scratch register to the bootloader
Change-Id: Iaef4606dc6f3cb9904d87ee92db69fb9ef48bcb0
-rw-r--r--firmware/target/mips/ingenic_x1000/spl-x1000.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/firmware/target/mips/ingenic_x1000/spl-x1000.c b/firmware/target/mips/ingenic_x1000/spl-x1000.c
index b9ee6cc1c1..08f88f506c 100644
--- a/firmware/target/mips/ingenic_x1000/spl-x1000.c
+++ b/firmware/target/mips/ingenic_x1000/spl-x1000.c
@@ -317,6 +317,9 @@ void spl_main(void)
REG_CPM_PSWC2ST = 0x18;
REG_CPM_PSWC3ST = 0x08;
+ /* Save this, it's needed on some targets */
+ uint32_t saved_cpm_scratch = REG_CPM_SCRATCH;
+
/* set up boot flags */
init_boot_flags();
@@ -361,8 +364,8 @@ void spl_main(void)
spl_storage_close();
/* jump to the entry point */
- typedef void(*entry_fn)(void);
+ typedef void(*entry_fn)(uint32_t);
entry_fn fn = (entry_fn)BOOT_EXEC_ADDR;
commit_discard_idcache();
- fn();
+ fn(saved_cpm_scratch);
}