Skip to contentSkip to conversation

env: Update env_addr for mmc environment driver

PATCH New Pankit Garg 3 participants 3 messages Nov 19, 2019 – Nov 20, 2019

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 9f1878def1..832e11cde6 100644
@@ -362,6 +362,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);
 
@@ -383,6 +384,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
2.17.1
#2 lore raw

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

In reply to Pankit Garg
Quoted 9 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Pankit Garg
Sent: Tuesday, November 19, 2019 3:20 PM
To: u-boot at lists.denx.de
Cc: Pankit Garg <[email protected]>
Subject: [U-Boot] [PATCH] env: Update env_addr for mmc environment driver

Please add description

Quoted 27 lines

---
env/mmc.c | 5 +++++

1 file changed, 5 insertions(+)
env/mmc.c +5 -0
index 9f1878def1..832e11cde6 100644
@@ -362,6 +362,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);
 
@@ -383,6 +384,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:

Quoted 4 lines
	fini_mmc_for_env(mmc);

--
2.17.1

-priyankajain