All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] env: Update env_addr for mmc environment driver
@ 2019-11-19  9:49 Pankit Garg
  2019-11-20  0:28 ` Joe Hershberger
  2019-11-20  5:58 ` Priyanka Jain
  0 siblings, 2 replies; 4+ messages in thread
From: Pankit Garg @ 2019-11-19  9:49 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
---
 env/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/env/mmc.c b/env/mmc.c
index 9f1878def1..832e11cde6 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -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);
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] env: Update env_addr for mmc environment driver
  2019-11-19  9:49 [U-Boot] [PATCH] env: Update env_addr for mmc environment driver Pankit Garg
@ 2019-11-20  0:28 ` Joe Hershberger
  2019-11-20  5:58 ` Priyanka Jain
  1 sibling, 0 replies; 4+ messages in thread
From: Joe Hershberger @ 2019-11-20  0:28 UTC (permalink / raw)
  To: u-boot

On Tue, Nov 19, 2019 at 5:44 AM Pankit Garg <pankit.garg@nxp.com> wrote:
>
> Signed-off-by: Pankit Garg <pankit.garg@nxp.com>

Acked-by: Joe Hershberger <joe.hershberger@ni.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] env: Update env_addr for mmc environment driver
  2019-11-19  9:49 [U-Boot] [PATCH] env: Update env_addr for mmc environment driver Pankit Garg
  2019-11-20  0:28 ` Joe Hershberger
@ 2019-11-20  5:58 ` Priyanka Jain
  1 sibling, 0 replies; 4+ messages in thread
From: Priyanka Jain @ 2019-11-20  5:58 UTC (permalink / raw)
  To: u-boot



>-----Original Message-----
>From: U-Boot <u-boot-bounces@lists.denx.de> On Behalf Of Pankit Garg
>Sent: Tuesday, November 19, 2019 3:20 PM
>To: u-boot at lists.denx.de
>Cc: Pankit Garg <pankit.garg@nxp.com>
>Subject: [U-Boot] [PATCH] env: Update env_addr for mmc environment driver
>
Please add description
>Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
>---
> env/mmc.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/env/mmc.c b/env/mmc.c
>index 9f1878def1..832e11cde6 100644
>--- a/env/mmc.c
>+++ b/env/mmc.c
>@@ -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);
>--
>2.17.1
>
-priyankajain

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH] env: Update env addr for mmc environment driver
@ 2019-03-15 10:18 Pankit Garg
  0 siblings, 0 replies; 4+ messages in thread
From: Pankit Garg @ 2019-03-15 10:18 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Pankit Garg <pankit.garg@nxp.com>
---
 env/mmc.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/env/mmc.c b/env/mmc.c
index c3cf35d..f5d16cf 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -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:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-11-20  5:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19  9:49 [U-Boot] [PATCH] env: Update env_addr for mmc environment driver Pankit Garg
2019-11-20  0:28 ` Joe Hershberger
2019-11-20  5:58 ` Priyanka Jain
  -- strict thread matches above, loose matches on Subject: below --
2019-03-15 10:18 [U-Boot] [PATCH] env: Update env addr " Pankit Garg

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.