diff options
author | Chen Guoyin <guoyin.chen@nxp.com> | 2016-12-22 16:40:42 +0800 |
---|---|---|
committer | fang hui <hui.fang@nxp.com> | 2017-01-19 14:47:27 +0800 |
commit | eeff4e073c6408bbfdac1a1fb7e4a35b4e1bf85e (patch) | |
tree | 79e3b75ee2f045f6265a731a995a540a9a9b98ef | |
parent | 7b27918dd0bdb819724c35fc2fe42500e1dc1e2b (diff) | |
download | u-boot-imx-eeff4e073c6408bbfdac1a1fb7e4a35b4e1bf85e.zip u-boot-imx-eeff4e073c6408bbfdac1a1fb7e4a35b4e1bf85e.tar.gz u-boot-imx-eeff4e073c6408bbfdac1a1fb7e4a35b4e1bf85e.tar.bz2 |
MA-9193 Add all SD/EMMC slot check for the return from get_boot_device
Use mmc_get_env_devno to get the right slot for emmc/sdcard
Change-Id: I13cffe2b00e32e2b571f307da4ffcebd26e894cd
Signed-off-by: Chen Guoyin <guoyin.chen@nxp.com>
-rwxr-xr-x | board/technexion/pico-imx7d/pico-imx7d.c | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/board/technexion/pico-imx7d/pico-imx7d.c b/board/technexion/pico-imx7d/pico-imx7d.c index 64f2a81..1b8b314 100755 --- a/board/technexion/pico-imx7d/pico-imx7d.c +++ b/board/technexion/pico-imx7d/pico-imx7d.c @@ -686,21 +686,27 @@ int board_ehci_hcd_init(int port) void board_fastboot_setup(void) { +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) + static char boot_dev_part[32]; + u32 dev_no; +#endif switch (get_boot_device()) { #if defined(CONFIG_FASTBOOT_STORAGE_MMC) case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc0"); - if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc0"); - break; case SD2_BOOT: + case SD3_BOOT: + case SD4_BOOT: + case MMC1_BOOT: case MMC2_BOOT: + case MMC3_BOOT: + case MMC4_BOOT: + dev_no = mmc_get_env_devno(); + sprintf(boot_dev_part,"mmc%d",dev_no); if (!getenv("fastboot_dev")) - setenv("fastboot_dev", "mmc1"); + setenv("fastboot_dev", boot_dev_part); + sprintf(boot_dev_part, "boota mmc%d", dev_no); if (!getenv("bootcmd")) - setenv("bootcmd", "boota mmc1"); + setenv("bootcmd", boot_dev_part); break; #endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ #if defined(CONFIG_FASTBOOT_STORAGE_NAND) @@ -731,19 +737,27 @@ int is_recovery_key_pressing(void) void board_recovery_setup(void) { +#if defined(CONFIG_FASTBOOT_STORAGE_MMC) + static char boot_dev_part[32]; + u32 dev_no; +#endif + int bootdev = get_boot_device(); switch (bootdev) { #if defined(CONFIG_FASTBOOT_STORAGE_MMC) case SD1_BOOT: - case MMC1_BOOT: - if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc0 recovery"); - break; case SD2_BOOT: + case SD3_BOOT: + case SD4_BOOT: + case MMC1_BOOT: case MMC2_BOOT: + case MMC3_BOOT: + case MMC4_BOOT: + dev_no = mmc_get_env_devno(); + sprintf(boot_dev_part,"boota mmc%d recovery",dev_no); if (!getenv("bootcmd_android_recovery")) - setenv("bootcmd_android_recovery", "boota mmc1 recovery"); + setenv("bootcmd_android_recovery", boot_dev_part); break; #endif /*CONFIG_FASTBOOT_STORAGE_MMC*/ #if defined(CONFIG_FASTBOOT_STORAGE_NAND) |