summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-10-28 20:20:38 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-10-29 12:51:02 +0100
commita5b08d0af76801094194cfeab3af852c638e8f06 (patch)
treecf099f55772fddac24c973e144c3ae3d2bfb4079
parentd09fb6bb6b92782ba763219ca19d3125159ec848 (diff)
downloadrockbox-a5b08d0af76801094194cfeab3af852c638e8f06.tar.gz
rockbox-a5b08d0af76801094194cfeab3af852c638e8f06.zip
Shanling Q1: Support OF-initiated firmware updates
It's now possible to install OF updates on a rockboxed Shanling Q1. Previously these didn't work because the RB bootloader interrupted the update process. Updates will proceed as they normally do on a non-Rockboxed Q1, except at the end of the update you'll reboot to Rockbox instead of the OF. This is only a minor inconvienience and doesn't affect the update process. Change-Id: I0f8fc96f073c50c1512bf60e0927491be8178eb0
-rw-r--r--bootloader/x1000/main.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/bootloader/x1000/main.c b/bootloader/x1000/main.c
index b948b030f1..5fd3d7f7d4 100644
--- a/bootloader/x1000/main.c
+++ b/bootloader/x1000/main.c
@@ -43,8 +43,10 @@ static int read_btn(void)
43#endif 43#endif
44} 44}
45 45
46void main(void) 46void main(uint32_t saved_cpm_scratch)
47{ 47{
48 (void)saved_cpm_scratch;
49
48 system_init(); 50 system_init();
49 core_allocator_init(); 51 core_allocator_init();
50 kernel_init(); 52 kernel_init();
@@ -71,6 +73,16 @@ void main(void)
71 * present, blocking with an "insert SD card" prompt if appropriate. */ 73 * present, blocking with an "insert SD card" prompt if appropriate. */
72 disk_mount_all(); 74 disk_mount_all();
73 75
76#ifdef SHANLING_Q1
77 /* This is needed for OF updates. The OF extracts the update package
78 * to the SD card and reboots to the recovery kernel to complete the
79 * update. */
80 if ((saved_cpm_scratch & 0xffff) == 0x1a1a) {
81 cpm_scratch_set(saved_cpm_scratch & 0xffff0000);
82 boot_of_recovery();
83 }
84#endif
85
74 /* If USB booting, the user probably needs to enter recovery mode; 86 /* If USB booting, the user probably needs to enter recovery mode;
75 * let's not force them to hold down the recovery key. */ 87 * let's not force them to hold down the recovery key. */
76 bool recovery_mode = get_boot_flag(BOOT_FLAG_USB_BOOT); 88 bool recovery_mode = get_boot_flag(BOOT_FLAG_USB_BOOT);