summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
Diffstat (limited to 'env')
-rw-r--r--env/env.c2
-rw-r--r--env/nowhere.c13
2 files changed, 14 insertions, 1 deletions
diff --git a/env/env.c b/env/env.c
index 2b8b9611cff..8671f13f8d9 100644
--- a/env/env.c
+++ b/env/env.c
@@ -138,7 +138,7 @@ int env_init(void)
ret = drv->init();
if (ret == -ENOENT) {
gd->env_addr = (ulong)&default_environment[0];
- gd->env_valid = 0;
+ gd->env_valid = ENV_VALID;
return 0;
} else if (ret) {
diff --git a/env/nowhere.c b/env/nowhere.c
index d60de494e6c..f654883c8ac 100644
--- a/env/nowhere.c
+++ b/env/nowhere.c
@@ -15,7 +15,20 @@
DECLARE_GLOBAL_DATA_PTR;
+/*
+ * Because we only ever have the default environment available we must mark
+ * it as invalid.
+ */
+static int env_nowhere_init(void)
+{
+ gd->env_addr = (ulong)&default_environment[0];
+ gd->env_valid = ENV_INVALID;
+
+ return 0;
+}
+
U_BOOT_ENV_LOCATION(nowhere) = {
.location = ENVL_NOWHERE,
+ .init = env_nowhere_init,
ENV_NAME("nowhere")
};