summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/spl-x1000.h
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2021-04-15 03:00:04 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-04-17 20:24:07 +0000
commit01d1eb425874813864d12d72c93e6e74ab92ac1f (patch)
treee4bc6171342e1ef4160b2e32653f5668f9be3d69 /firmware/target/mips/ingenic_x1000/spl-x1000.h
parente123c5d2f27e9efbef8b4264f1576e4e10ba7b82 (diff)
downloadrockbox-01d1eb425874813864d12d72c93e6e74ab92ac1f.tar.gz
rockbox-01d1eb425874813864d12d72c93e6e74ab92ac1f.zip
FiiO M3K/X1000: Do system clock initialization in the SPL
Initializing the clocks in the SPL brings Rockbox in line with how the FiiO M3K's original SPL works. It's likely other X1000 devices do this too. There was a logic error in the previous setup: the code falsely assumed that DDR memory would always be running from MPLL, but it would be switched to APLL by the bootloader. Rockbox would then try to re-init APLL, albeit with the same parameters. Maybe this was the cause of the boot hang on some units. Change-Id: I64064585e491bbdf1e95fe9428c91a9314f2a917
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/spl-x1000.h')
-rw-r--r--firmware/target/mips/ingenic_x1000/spl-x1000.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/firmware/target/mips/ingenic_x1000/spl-x1000.h b/firmware/target/mips/ingenic_x1000/spl-x1000.h
index 44601438f3..d2255a8d05 100644
--- a/firmware/target/mips/ingenic_x1000/spl-x1000.h
+++ b/firmware/target/mips/ingenic_x1000/spl-x1000.h
@@ -39,11 +39,17 @@ struct spl_boot_option {
39extern const struct spl_boot_option spl_boot_options[]; 39extern const struct spl_boot_option spl_boot_options[];
40 40
41/* Called on a fatal error */ 41/* Called on a fatal error */
42void spl_error(void) __attribute__((noreturn)); 42extern void spl_error(void) __attribute__((noreturn));
43 43
44/* When SPL boots with SPL_BOOTOPTION_CHOOSE, this function is invoked 44/* When SPL boots with SPL_BOOTOPTION_CHOOSE, this function is invoked
45 * to let the target figure out the boot option based on buttons the 45 * to let the target figure out the boot option based on buttons the
46 * user is pressing */ 46 * user is pressing */
47extern int spl_get_boot_option(void); 47extern int spl_get_boot_option(void);
48 48
49/* Do any setup/initialization needed for the given boot option, this
50 * will be called right before flushing caches + jumping to the image.
51 * Typical use is to set up system clocks, etc.
52 */
53extern void spl_handle_pre_boot(int bootopt);
54
49#endif /* __SPL_X1000_H__ */ 55#endif /* __SPL_X1000_H__ */