diff options
author | Zhang Jiejing <jiejing.zhang@freescale.com> | 2012-02-23 15:08:52 +0800 |
---|---|---|
committer | Lily Zhang <r58066@freescale.com> | 2012-02-27 13:01:11 +0800 |
commit | 951586a9fb6d6f30106e70978500c564dd573f9d (patch) | |
tree | 98e77749c45a3a0f774327c260534530846e6dca /board/freescale | |
parent | 7d6fd7e5ba4d5cd35caa75112289d9cec0804007 (diff) | |
download | u-boot-imx-951586a9fb6d6f30106e70978500c564dd573f9d.zip u-boot-imx-951586a9fb6d6f30106e70978500c564dd573f9d.tar.gz u-boot-imx-951586a9fb6d6f30106e70978500c564dd573f9d.tar.bz2 |
ENGR00175091 MX6Q_SABRESD: android: add recovery check
define a new macro to show which mmc bus was main storage
in recovery check, only check the main storage /cache
partition.
Signed-off-by: Zhang Jiejing <jiejing.zhang@freescale.com>
Diffstat (limited to 'board/freescale')
-rw-r--r-- | board/freescale/mx6q_sabresd/mx6q_sabresd.c | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/board/freescale/mx6q_sabresd/mx6q_sabresd.c b/board/freescale/mx6q_sabresd/mx6q_sabresd.c index e2a080e..08957d7 100644 --- a/board/freescale/mx6q_sabresd/mx6q_sabresd.c +++ b/board/freescale/mx6q_sabresd/mx6q_sabresd.c @@ -811,49 +811,47 @@ int check_recovery_cmd_file(void) case SPI_NOR_BOOT: case I2C_BOOT: { - for (i = 0; i < 3; i++) { - block_dev_desc_t *dev_desc = NULL; - struct mmc *mmc = find_mmc_device(i); - - dev_desc = get_dev("mmc", i); - - if (NULL == dev_desc) { - printf("** Block device MMC %d not supported\n", i); - continue; - } - - mmc_init(mmc); - - if (get_partition_info(dev_desc, - CONFIG_ANDROID_CACHE_PARTITION_MMC, - &info)) { - printf("** Bad partition %d **\n", - CONFIG_ANDROID_CACHE_PARTITION_MMC); - continue; - } - - part_length = ext2fs_set_blk_dev(dev_desc, - CONFIG_ANDROID_CACHE_PARTITION_MMC); - if (part_length == 0) { - printf("** Bad partition - mmc %d:%d **\n", i, - CONFIG_ANDROID_CACHE_PARTITION_MMC); - ext2fs_close(); - continue; - } - - if (!ext2fs_mount(part_length)) { - printf("** Bad ext2 partition or " - "disk - mmc %d:%d **\n", - i, CONFIG_ANDROID_CACHE_PARTITION_MMC); - ext2fs_close(); - continue; - } - - filelen = ext2fs_open(CONFIG_ANDROID_RECOVERY_CMD_FILE); + block_dev_desc_t *dev_desc = NULL; + struct mmc *mmc = find_mmc_device(CONFIG_ANDROID_MAIN_MMC_BUS); + dev_desc = get_dev("mmc", CONFIG_ANDROID_MAIN_MMC_BUS); + + if (NULL == dev_desc) { + printf("** Block device MMC %d not supported\n", i); + break; + } + + mmc_init(mmc); + + if (get_partition_info(dev_desc, + CONFIG_ANDROID_CACHE_PARTITION_MMC, + &info)) { + printf("** Bad partition %d **\n", + CONFIG_ANDROID_CACHE_PARTITION_MMC); + break; + } + + part_length = ext2fs_set_blk_dev(dev_desc, + CONFIG_ANDROID_CACHE_PARTITION_MMC); + if (part_length == 0) { + printf("** Bad partition - mmc %d:%d **\n", i, + CONFIG_ANDROID_CACHE_PARTITION_MMC); ext2fs_close(); break; } + + if (!ext2fs_mount(part_length)) { + printf("** Bad ext2 partition or " + "disk - mmc %d:%d **\n", + i, CONFIG_ANDROID_CACHE_PARTITION_MMC); + ext2fs_close(); + break; + } + + filelen = ext2fs_open(CONFIG_ANDROID_RECOVERY_CMD_FILE); + + ext2fs_close(); + break; } break; case NAND_BOOT: |