aboutsummaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorPankit Garg <pankit.garg@nxp.com>2019-11-19 09:49:31 +0000
committerJoe Hershberger <joe.hershberger@ni.com>2020-03-09 18:11:24 -0500
commit0536b440a8f1618f666f2f0e1663d549b4833c24 (patch)
tree9b9223d4ba49719292fabf0b4c85757c82be53a7 /env
parente2ffeaa16250ec6372412c0f268449803c321db6 (diff)
downloadu-boot-0536b440a8f1618f666f2f0e1663d549b4833c24.zip
u-boot-0536b440a8f1618f666f2f0e1663d549b4833c24.tar.gz
u-boot-0536b440a8f1618f666f2f0e1663d549b4833c24.tar.bz2
env: Update env_addr for mmc environment driver
Make sure the gd struct is up-to-date. Signed-off-by: Pankit Garg <pankit.garg@nxp.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'env')
-rw-r--r--env/mmc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/env/mmc.c b/env/mmc.c
index b24c35c..251ad07 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -353,6 +353,7 @@ static int env_mmc_load(void)
int ret;
int dev = mmc_get_env_dev();
const char *errmsg;
+ env_t *ep = NULL;
mmc = find_mmc_device(dev);
@@ -374,6 +375,10 @@ static int env_mmc_load(void)
}
ret = env_import(buf, 1);
+ if (!ret) {
+ ep = (env_t *)buf;
+ gd->env_addr = (ulong)&ep->data;
+ }
fini:
fini_mmc_for_env(mmc);