summaryrefslogtreecommitdiff
path: root/bootloader
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader')
-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