summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2017-02-01 11:26:53 +0100
committerTom Rini <trini@konsulko.com>2017-04-08 09:26:44 -0400
commit687d2073741bf9518247cb3ffb289f428fba2413 (patch)
tree6135ddaba8e7cd2aeeb1b197aaa50c841f7d0aa5 /common
parent01abae4d04868dede60947867699bf096a1831ff (diff)
env_mmc: Allow SPL to use any MMC device to load/save the environment
SPL has been restricted to use only dev 0 based on the assumption that only one MMC device is registered. This is not always the case and many platforms now register several devices as expected by the spl mmc boot code For those platform SPL_ENV_SUPPORT is broken if dev is forced to 0. A word of warning: this commit may break SPL_ENV_SUPPORT on platforms that do not register the same MMC controllers in SPL and in u-boot (mostly iMX6 based platforms). Fortunately none of those activate SPL_ENV_SUPPORT in their default configuration. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'common')
-rw-r--r--common/env_mmc.c15
1 files changed, 0 insertions, 15 deletions
diff --git a/common/env_mmc.c b/common/env_mmc.c
index 16f6a175141..a5d14d448c8 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -82,10 +82,6 @@ static int mmc_set_env_part(struct mmc *mmc)
int dev = mmc_get_env_dev();
int ret = 0;
-#ifdef CONFIG_SPL_BUILD
- dev = 0;
-#endif
-
env_mmc_orig_hwpart = mmc_get_blk_desc(mmc)->hwpart;
ret = blk_select_hwpart_devnum(IF_TYPE_MMC, dev, part);
if (ret)
@@ -116,9 +112,6 @@ static void fini_mmc_for_env(struct mmc *mmc)
#ifdef CONFIG_SYS_MMC_ENV_PART
int dev = mmc_get_env_dev();
-#ifdef CONFIG_SPL_BUILD
- dev = 0;
-#endif
blk_select_hwpart_devnum(IF_TYPE_MMC, dev, env_mmc_orig_hwpart);
#endif
}
@@ -223,10 +216,6 @@ void env_relocate_spec(void)
ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env1, 1);
ALLOC_CACHE_ALIGN_BUFFER(env_t, tmp_env2, 1);
-#ifdef CONFIG_SPL_BUILD
- dev = 0;
-#endif
-
mmc = find_mmc_device(dev);
errmsg = init_mmc_for_env(mmc);
@@ -306,10 +295,6 @@ void env_relocate_spec(void)
int dev = mmc_get_env_dev();
const char *errmsg;
-#ifdef CONFIG_SPL_BUILD
- dev = 0;
-#endif
-
mmc = find_mmc_device(dev);
errmsg = init_mmc_for_env(mmc);