Patchwork [U-Boot,3/6,v2] common/env: Point default envirenoment for GD

login
register
mail settings
Submitter Prabhakar Kushwaha
Date Oct. 25, 2013, 4:38 a.m.
Message ID <1382675933-24815-1-git-send-email-prabhakar@freescale.com>
Download mbox | patch
Permalink /patch/286076/
State Changes Requested
Delegated to: York Sun
Headers show

Comments

Prabhakar Kushwaha - Oct. 25, 2013, 4:38 a.m.
GD(Global Data) structure has pointer to envirenoment variable array.
but, it is not being assigned for SPL framwork.

So update GD pointer with env variable array.

Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
---
 Based upon  git://git.denx.de/u-boot-mpc85xx.git branch next
 
 Changes for v2: Incorporated York's comments
	- fix compile warning

 common/env_common.c |    3 +++
 1 file changed, 3 insertions(+)
Scott Wood - Nov. 6, 2013, 1:31 a.m.
On Fri, 2013-10-25 at 10:08 +0530, Prabhakar Kushwaha wrote:
> GD(Global Data) structure has pointer to envirenoment variable array.
> but, it is not being assigned for SPL framwork.
> 
> So update GD pointer with env variable array.
> 
> Signed-off-by: Prabhakar Kushwaha <prabhakar@freescale.com>
> ---
>  Based upon  git://git.denx.de/u-boot-mpc85xx.git branch next
>  
>  Changes for v2: Incorporated York's comments
> 	- fix compile warning
> 
>  common/env_common.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/env_common.c b/common/env_common.c
> index c0bfc2f..ce95c1a 100644
> --- a/common/env_common.c
> +++ b/common/env_common.c
> @@ -162,6 +162,9 @@ int env_import(const char *buf, int check)
>  	if (himport_r(&env_htab, (char *)ep->data, ENV_SIZE, '\0', 0,
>  			0, NULL)) {
>  		gd->flags |= GD_FLG_ENV_READY;
> +#ifdef CONFIG_SPL_BUILD
> +		gd->env_addr = (u32)ep->data;
> +#endif

s/u32/unsigned long/

Is this a problem with all environment-using SPLs, or is this covering
up for something we're doing wrong in a particular target?

-Scott

Patch

diff --git a/common/env_common.c b/common/env_common.c
index c0bfc2f..ce95c1a 100644
--- a/common/env_common.c
+++ b/common/env_common.c
@@ -162,6 +162,9 @@  int env_import(const char *buf, int check)
 	if (himport_r(&env_htab, (char *)ep->data, ENV_SIZE, '\0', 0,
 			0, NULL)) {
 		gd->flags |= GD_FLG_ENV_READY;
+#ifdef CONFIG_SPL_BUILD
+		gd->env_addr = (u32)ep->data;
+#endif
 		return 1;
 	}