Skip to contentSkip to conversation

env: Update env_addr for mmc environment driver

PATCH New Pankit Garg 2 participants 2 messages Mar 18, 2019 – Apr 22, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 env: Update env_addr for mmc environment driver

---
Changes for v2:
- Remove CRC calculation as it is already part of env_import
- Update env_addr after env_import

 env/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)
env/mmc.c +5 -0
index c3cf35d..d329bea 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);
 
@@ -334,6 +335,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);
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/1 env: Update env_addr for mmc environment driver

Quoted 22 lines · Pankit Garg

---
Changes for v2:
- Remove CRC calculation as it is already part of env_import
- Update env_addr after env_import

 env/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)
env/mmc.c +1 -0
index c3cf35d..d329bea 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);
 

env/mmc.c static int env_mmc_load(void) · line 344

Quoted 10 lines
env/mmc.c +4 -0
@@ -334,6 +335,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);

Do we need to update the redundant env location section of code with this too?

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190422/4d292756/attachment.sig>