From 0e1a90ea1da0c1737363e9412781f734f39048d4 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Tue, 6 Jul 2021 21:02:37 +0100 Subject: x1000: SPL refactoring This streamlines the boot code a bit and reduces target specific boilerplate. The clock init hack used by the bootloader has been "standardized" and works for the main Rockbox binary now, so you can boot rockbox.bin over USB without special hacks. Change-Id: I7c1fac37df5a45873583ce6818eaedb9f71a782b --- bootloader/fiiom3k.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'bootloader/fiiom3k.c') diff --git a/bootloader/fiiom3k.c b/bootloader/fiiom3k.c index 3d42ba7314..42b3260e07 100644 --- a/bootloader/fiiom3k.c +++ b/bootloader/fiiom3k.c @@ -37,7 +37,7 @@ #include "loader_strerror.h" #include "version.h" #include "installer-fiiom3k.h" -#include "spl-x1000.h" +#include "boot-x1000.h" #include "x1000/cpm.h" /* Load address where the binary needs to be placed */ @@ -331,17 +331,8 @@ void main(void) { bool recovery_mode = false; - /* This hack is needed because when USB booting, we cannot initialize - * clocks in the SPL -- it may break the mask ROM's USB code. So if the - * SPL has not already initialized the clocks, we need to do that now. - * - * Also use this as a sign that we should enter the recovery menu since - * this is probably the expected result if the user is USB booting... - */ - if(jz_readf(CPM_MPCR, ENABLE)) { - spl_handle_pre_boot(0); + if(get_boot_flag(BOOT_FLAG_USB_BOOT)) recovery_mode = true; - } system_init(); core_allocator_init(); -- cgit v1.2.3