From 429e9bb343c2c76dcf4aeaa3f4533f1dde09fb3a Mon Sep 17 00:00:00 2001 From: Anish Trivedi Date: Wed, 23 Jun 2010 16:49:08 -0500 Subject: ENGR00124652 UBOOT: MX53 env fails to load when booting from 2nd slot Added dynamic check for which sd slot used for boot Signed-off-by: Anish Trivedi --- board/freescale/mx53_evk/mx53_evk.c | 9 +++++++++ include/configs/mx53_evk.h | 3 +++ 2 files changed, 12 insertions(+) diff --git a/board/freescale/mx53_evk/mx53_evk.c b/board/freescale/mx53_evk/mx53_evk.c index f9731bf..8cfd2da 100644 --- a/board/freescale/mx53_evk/mx53_evk.c +++ b/board/freescale/mx53_evk/mx53_evk.c @@ -600,6 +600,15 @@ struct fsl_esdhc_cfg esdhc_cfg[2] = { {MMC_SDHC3_BASE_ADDR, 1, 1}, }; +#ifdef CONFIG_DYNAMIC_MMC_DEVNO +int get_mmc_env_devno() +{ + uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); + return (soc_sbmr & 0x00300000) ? 1 : 0; +} +#endif + + int esdhc_gpio_init(bd_t *bis) { s32 status = 0; diff --git a/include/configs/mx53_evk.h b/include/configs/mx53_evk.h index e139840..730f104 100644 --- a/include/configs/mx53_evk.h +++ b/include/configs/mx53_evk.h @@ -199,6 +199,9 @@ #define CONFIG_CMD_FAT 1 #define CONFIG_CMD_EXT2 1 + /* detect whether ESDHC1 or ESDHC3 is boot device */ + #define CONFIG_DYNAMIC_MMC_DEVNO + #define CONFIG_BOOT_PARTITION_ACCESS #endif -- cgit v1.1