From: Prabhakar Kushwaha Date: Mon, 31 Mar 2014 15:34:28 +0530 Subject: [U-Boot] [PATCH 5/10] common/env: Point default environment for GD Message-ID: <1396260268-2615-1-git-send-email-prabhakar@freescale.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de GD(Global Data) structure has pointer to environment variable array. but, it always point to default_environment assuming it is running from final location. So update GD pointer with env variable array during SPL boot. Signed-off-by: Prabhakar Kushwaha --- common/env_common.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/env_common.c b/common/env_common.c index c0bfc2f..043150a 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 = (unsigned long)ep->data; +#endif return 1; } -- 1.7.9.5