Skip to contentSkip to conversation

common/env: Point default envirenoment for GD

PATCH Superseded Prabhakar Kushwaha 2 participants 2 messages Oct 1, 2013 – Oct 24, 2013

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 3/6 common/env: Point default envirenoment for GD

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.

---
Based upon git://git.denx.de/u-boot-mpc85xx.git branch next

 common/env_common.c |    3 +++
 1 file changed, 3 insertions(+)
common/env_common.c +3 -0
index 1ac3377..84843e1 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 3/6 common/env: Point default envirenoment for GD

Quoted 17 lines · Prabhakar Kushwaha

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.

---
Based upon git://git.denx.de/u-boot-mpc85xx.git branch next

 common/env_common.c |    3 +++
 1 file changed, 3 insertions(+)
common/env_common.c +0 -0
index 1ac3377..84843e1 100644

common/env_common.c int env_import(const char *buf, int check) · line 167

Quoted 6 lines
common/env_common.c +3 -0
@@ -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