diff options
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/system-x1000.c')
-rw-r--r-- | firmware/target/mips/ingenic_x1000/system-x1000.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_x1000/system-x1000.c b/firmware/target/mips/ingenic_x1000/system-x1000.c index 779bb2055c..d43c8e67e4 100644 --- a/firmware/target/mips/ingenic_x1000/system-x1000.c +++ b/firmware/target/mips/ingenic_x1000/system-x1000.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "dma-x1000.h" | 27 | #include "dma-x1000.h" |
28 | #include "irq-x1000.h" | 28 | #include "irq-x1000.h" |
29 | #include "clk-x1000.h" | 29 | #include "clk-x1000.h" |
30 | #include "boot-x1000.h" | ||
30 | #include "x1000/cpm.h" | 31 | #include "x1000/cpm.h" |
31 | #include "x1000/ost.h" | 32 | #include "x1000/ost.h" |
32 | #include "x1000/tcu.h" | 33 | #include "x1000/tcu.h" |
@@ -59,6 +60,27 @@ static void system_init_irq(void) | |||
59 | write_c0_cause(M_CauseIV); | 60 | write_c0_cause(M_CauseIV); |
60 | } | 61 | } |
61 | 62 | ||
63 | /* First function called by crt0.S */ | ||
64 | void system_early_init(void) | ||
65 | { | ||
66 | #if defined(FIIO_M3K) && !defined(BOOTLOADER) | ||
67 | /* HACK for compatibility: CPM scratchpad has undefined contents at | ||
68 | * time of reset and old bootloader revisions don't initialize it. | ||
69 | * Therefore we can't rely on its contents on the FiiO M3K. This does | ||
70 | * kind of break the entire point of boot flags, but right now they | ||
71 | * are really only used by the bootloader so it's not a huge issue. | ||
72 | * This hack should keep everything working as usual. */ | ||
73 | if(jz_readf(CPM_MPCR, ON) == 0) { | ||
74 | init_boot_flags(); | ||
75 | set_boot_option(BOOT_OPTION_ROCKBOX); | ||
76 | set_boot_flag(BOOT_FLAG_CLK_INIT); | ||
77 | } | ||
78 | #endif | ||
79 | |||
80 | /* Finish up clock init */ | ||
81 | clk_init(); | ||
82 | } | ||
83 | |||
62 | /* First thing called from Rockbox main() */ | 84 | /* First thing called from Rockbox main() */ |
63 | void system_init(void) | 85 | void system_init(void) |
64 | { | 86 | { |