summaryrefslogtreecommitdiff
path: root/common/env_mmc.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2010-10-17 20:25:05 +0200
committerWolfgang Denk <wd@denx.de>2010-10-17 20:25:05 +0200
commitcacc342d5aa311673efdc05770cb53246dd41c9f (patch)
tree628ad99e5ea23c3f6ae6f728167056001bd16847 /common/env_mmc.c
parent5641f34f8b83b3dcb64ba5f6c0f83d2204c41387 (diff)
parent59e0d611ad0418245e9600b50bf1374a725c95b6 (diff)
downloadu-boot-imx-cacc342d5aa311673efdc05770cb53246dd41c9f.zip
u-boot-imx-cacc342d5aa311673efdc05770cb53246dd41c9f.tar.gz
u-boot-imx-cacc342d5aa311673efdc05770cb53246dd41c9f.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-arm
Diffstat (limited to 'common/env_mmc.c')
-rw-r--r--common/env_mmc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/common/env_mmc.c b/common/env_mmc.c
index dcab994..3d7fceb 100644
--- a/common/env_mmc.c
+++ b/common/env_mmc.c
@@ -140,18 +140,21 @@ inline int read_env(struct mmc *mmc, unsigned long size,
void env_relocate_spec(void)
{
#if !defined(ENV_IS_EMBEDDED)
+ char buf[CONFIG_ENV_SIZE];
+
struct mmc *mmc = find_mmc_device(CONFIG_SYS_MMC_ENV_DEV);
- if (init_mmc_for_env(mmc))
+ if (init_mmc_for_env(mmc)) {
+ use_default();
return;
+ }
- if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, env_ptr))
- return use_default();
-
- if (crc32(0, env_ptr->data, ENV_SIZE) != env_ptr->crc)
- return use_default();
+ if (read_env(mmc, CONFIG_ENV_SIZE, CONFIG_ENV_OFFSET, buf)) {
+ use_default();
+ return;
+ }
- gd->env_valid = 1;
+ env_import(buf, 1);
#endif
}