diff options
author | Terry Lv <r65388@freescale.com> | 2009-11-12 14:25:13 +0800 |
---|---|---|
committer | Terry Lv <r65388@freescale.com> | 2009-11-12 14:25:13 +0800 |
commit | a5c3bc03d12c2ed6b2627ea99f20d05b184d00d6 (patch) | |
tree | 1cc7847230b51e7b7aac795be48e5eb8a52a16bd /board/freescale/mx51_3stack | |
parent | 20710100e480543d36b76845c52cdec382f2b43a (diff) | |
download | u-boot-imx-a5c3bc03d12c2ed6b2627ea99f20d05b184d00d6.zip u-boot-imx-a5c3bc03d12c2ed6b2627ea99f20d05b184d00d6.tar.gz u-boot-imx-a5c3bc03d12c2ed6b2627ea99f20d05b184d00d6.tar.bz2 |
ENGR00118362: Correct recovery NAND cmd
This patch will fix three issues:
1. Add boot device detection.
2. Use right nand command in anroid for recovery mode.
3. Recovery mode code clean.
Signed-off-by: Terry Lv <r65388@freescale.com>
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(); } } |