Skip to contentSkip to conversation

env: Update env addr for mmc environment driver

PATCH Superseded Pankit Garg 1 participant 1 message Mar 15, 2019

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env: Update env addr for mmc environment driver

---
 env/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)
env/mmc.c +5 -0
index c3cf35d..f5d16cf 100644
@@ -313,6 +313,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);
 
@@ -333,6 +334,10 @@ static int env_mmc_load(void)
 		goto fini;
 	}
 
+	ep = (env_t *)buf;
+	if (crc32(0, ep->data, ENV_SIZE) == ep->crc)
+		gd->env_addr    = (ulong)&(ep->data);
+
 	ret = env_import(buf, 1);
 
 fini:
Signature · 1 line
1.9.1