diff options
Diffstat (limited to 'board/freescale/mx51_3stack')
-rw-r--r-- | board/freescale/mx51_3stack/lowlevel_init.S | 1 | ||||
-rw-r--r-- | board/freescale/mx51_3stack/mx51_3stack.c | 31 |
2 files changed, 19 insertions, 13 deletions
diff --git a/board/freescale/mx51_3stack/lowlevel_init.S b/board/freescale/mx51_3stack/lowlevel_init.S index 1710b88..42130fd 100644 --- a/board/freescale/mx51_3stack/lowlevel_init.S +++ b/board/freescale/mx51_3stack/lowlevel_init.S @@ -84,7 +84,6 @@ ldr r1, =0x001901A3 str r1, [r0, #0x48] - str r1, [r0, #0x40] .endm /* init_m4if */ /* To support 133MHz DDR */ diff --git a/board/freescale/mx51_3stack/mx51_3stack.c b/board/freescale/mx51_3stack/mx51_3stack.c index 067e653..72df29c 100644 --- a/board/freescale/mx51_3stack/mx51_3stack.c +++ b/board/freescale/mx51_3stack/mx51_3stack.c @@ -609,23 +609,20 @@ inline int waiting_for_func_key_pressing(void) inline int switch_to_recovery_mode(void) { + char *env = NULL; + char *boot_args = NULL; + char *boot_cmd = NULL; + printf("Boot mode switched to recovery mode!\n"); switch (get_boot_device()) { case MMC_BOOT: - /* Set env to recovery mode */ - setenv("bootargs_android", \ - CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC); - setenv("bootcmd_android", \ - CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC); - setenv("bootcmd", "run bootcmd_android"); + boot_args = CONFIG_ANDROID_RECOVERY_BOOTARGS_MMC; + boot_cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_MMC; break; case NAND_BOOT: - setenv("bootargs_android", \ - CONFIG_ANDROID_RECOVERY_BOOTARGS_NAND); - setenv("bootcmd_android", \ - CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND); - setenv("bootcmd", "run bootcmd_android"); + boot_args = CONFIG_ANDROID_RECOVERY_BOOTARGS_NAND; + boot_cmd = CONFIG_ANDROID_RECOVERY_BOOTCMD_NAND; break; case SPI_NOR_BOOT: printf("Recovery mode not supported in SPI NOR boot\n"); @@ -638,6 +635,16 @@ inline int switch_to_recovery_mode(void) break; } + env = getenv("bootargs_android_recovery"); + /* Set env to recovery mode */ + if (!env) + setenv("bootargs_android_recovery", boot_args); + env = getenv("bootcmd_android_recovery"); + if (!env) + setenv("bootcmd_android_recovery", boot_cmd); + setenv("bootcmd", "run bootcmd_android_recovery"); + + return 0; } @@ -783,7 +790,7 @@ int board_late_init(void) switch_to_recovery_mode(); else { if (check_recovery_cmd_file()) { - puts("Recovery command file founded!\n"); + puts("Recovery command file detected!\n"); switch_to_recovery_mode(); } } |