diff mbox series

[v5,01/10] env: nowhere: set default enviroment

Message ID 20200128105115.21604-2-j-keerthy@ti.com
State New
Headers show
Series Add support for loading main_r5fss0_core0 | expand

Commit Message

J, KEERTHY Jan. 28, 2020, 10:51 a.m. UTC
In case only CONFIG_ENV_IS_NOWHERE without any of the memory
based configs like CONFIG_ENV_IS_IN_MMC the env_set function
fails as the gd->flags & GD_FLG_ENV_READY check fails.

Set default enviroment so that set_env calls succeed when only
ENV_IS_NOWHERE set.

Signed-off-by: Keerthy <j-keerthy at ti.com>
---
 env/nowhere.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Tom Rini Jan. 29, 2020, 3:57 p.m. UTC | #1
On Tue, Jan 28, 2020 at 04:21:06PM +0530, Keerthy wrote:

> In case only CONFIG_ENV_IS_NOWHERE without any of the memory
> based configs like CONFIG_ENV_IS_IN_MMC the env_set function
> fails as the gd->flags & GD_FLG_ENV_READY check fails.
> 
> Set default enviroment so that set_env calls succeed when only
> ENV_IS_NOWHERE set.
> 
> Signed-off-by: Keerthy <j-keerthy at ti.com>

Reviewed-by: Tom Rini <trini at konsulko.com>
diff mbox series

Patch

diff --git a/env/nowhere.c b/env/nowhere.c
index f5b0a17652..70c3b3e011 100644
--- a/env/nowhere.c
+++ b/env/nowhere.c
@@ -23,6 +23,7 @@  static int env_nowhere_init(void)
 {
 	gd->env_addr	= (ulong)&default_environment[0];
 	gd->env_valid	= ENV_INVALID;
+	env_set_default(NULL, 0);
 
 	return 0;
 }