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

login
register
mail settings
Submitter Prabhakar Kushwaha
Date Oct. 1, 2013, 8:27 a.m.
Message ID <1380616056-11196-1-git-send-email-prabhakar@freescale.com>
Download mbox | patch
Permalink /patch/279369/
State Superseded
Delegated to: York Sun
Headers show

Comments

Prabhakar Kushwaha - Oct. 1, 2013, 8:27 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

 common/env_common.c |    3 +++
 1 file changed, 3 insertions(+)
York Sun - Oct. 24, 2013, 6:02 p.m.
On 10/01/2013 01:27 AM, 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
> 
>  common/env_common.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/env_common.c b/common/env_common.c
> index 1ac3377..84843e1 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 = ep->data;
> +#endif


You are assigning a pointer to a interger. This introduces compiling warning

env_common.c:166:16: warning: assignment makes integer from pointer
without a cast [enabled by default]

Please fix.

York

Patch

diff --git a/common/env_common.c b/common/env_common.c
index 1ac3377..84843e1 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 = ep->data;
+#endif
 		return 1;
 	}