summaryrefslogtreecommitdiff
path: root/bootloader/x1000
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-19 19:38:29 +0000
committerAidan MacDonald <amachronic@protonmail.com>2022-03-24 23:40:07 +0000
commit9bbe08f3ec4c7546fdb5f5599755f6101294dc19 (patch)
tree2a63e63776bf5ae964cae5591cf19b800cf21ad1 /bootloader/x1000
parentc3562b6df639d6d7c85cdb83d1983e37ed9f889d (diff)
downloadrockbox-9bbe08f3ec4c7546fdb5f5599755f6101294dc19.tar.gz
rockbox-9bbe08f3ec4c7546fdb5f5599755f6101294dc19.zip
x1000: bootloader: add whole-chip flash dump option
I don't expect this will be all that useful, but why not... Change-Id: Ieb486bb719c5cc61e0f3e95f9fb603a1c30c6528
Diffstat (limited to 'bootloader/x1000')
-rw-r--r--bootloader/x1000/recovery.c1
-rw-r--r--bootloader/x1000/utils.c8
-rw-r--r--bootloader/x1000/x1000bootloader.h1
3 files changed, 10 insertions, 0 deletions
diff --git a/bootloader/x1000/recovery.c b/bootloader/x1000/recovery.c
index 369244209e..d70c3b9305 100644
--- a/bootloader/x1000/recovery.c
+++ b/bootloader/x1000/recovery.c
@@ -71,6 +71,7 @@ static const struct menuitem debug_menu_items[] = {
71#ifdef OF_RECOVERY_ADDR 71#ifdef OF_RECOVERY_ADDR
72 {MENUITEM_ACTION, "Dump OF recovery", &dump_of_recovery}, 72 {MENUITEM_ACTION, "Dump OF recovery", &dump_of_recovery},
73#endif 73#endif
74 {MENUITEM_ACTION, "Dump entire flash", &dump_entire_flash},
74 {MENUITEM_ACTION, "Main menu", &to_main_menu}, 75 {MENUITEM_ACTION, "Main menu", &to_main_menu},
75}; 76};
76 77
diff --git a/bootloader/x1000/utils.c b/bootloader/x1000/utils.c
index 1b56bdf50a..837160a113 100644
--- a/bootloader/x1000/utils.c
+++ b/bootloader/x1000/utils.c
@@ -250,3 +250,11 @@ void dump_of_recovery(void)
250 dump_flash_file("/of_recovery.img", OF_RECOVERY_ADDR, OF_RECOVERY_LENGTH); 250 dump_flash_file("/of_recovery.img", OF_RECOVERY_ADDR, OF_RECOVERY_LENGTH);
251#endif 251#endif
252} 252}
253
254void dump_entire_flash(void)
255{
256#if defined(FIIO_M3K) || defined(SHANLING_Q1) || defined(EROS_QN)
257 /* TODO: this should read the real chip size instead of hardcoding it */
258 dump_flash_file("/flash.img", 0, 2048 * 64 * 1024);
259#endif
260}
diff --git a/bootloader/x1000/x1000bootloader.h b/bootloader/x1000/x1000bootloader.h
index a7c9927f1b..f6231bbd54 100644
--- a/bootloader/x1000/x1000bootloader.h
+++ b/bootloader/x1000/x1000bootloader.h
@@ -171,6 +171,7 @@ int dump_flash(int fd, uint32_t addr, uint32_t length);
171int dump_flash_file(const char* file, uint32_t addr, uint32_t length); 171int dump_flash_file(const char* file, uint32_t addr, uint32_t length);
172void dump_of_player(void); 172void dump_of_player(void);
173void dump_of_recovery(void); 173void dump_of_recovery(void);
174void dump_entire_flash(void);
174 175
175void recovery_menu(void) __attribute__((noreturn)); 176void recovery_menu(void) __attribute__((noreturn));
176 177