summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
Diffstat (limited to 'env')
-rw-r--r--env/Kconfig7
-rw-r--r--env/Makefile1
-rw-r--r--env/common.c2
-rw-r--r--env/env.c2
4 files changed, 10 insertions, 2 deletions
diff --git a/env/Kconfig b/env/Kconfig
index 73332ceeb0..ac2ef067b3 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -21,6 +21,13 @@ config ENV_IS_NOWHERE
stored. U-Boot will therefore always start up with a default
environment.
+config ENV_DEFAULT_NOWHERE
+ depends on !ENV_IS_NOWHERE
+ bool "Environment is not stored if no matched location"
+ help
+ Define this when multiple ENV locations are defined and use nowhere as
+ default when no storage medium is matched.
+
config ENV_IS_IN_EEPROM
bool "Environment in EEPROM"
depends on !CHAIN_OF_TRUST
diff --git a/env/Makefile b/env/Makefile
index 7ce8231d9a..e804ace5c0 100644
--- a/env/Makefile
+++ b/env/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += sf.o
obj-$(CONFIG_ENV_IS_IN_REMOTE) += remote.o
obj-$(CONFIG_ENV_IS_IN_UBI) += ubi.o
obj-$(CONFIG_ENV_IS_NOWHERE) += nowhere.o
+obj-$(CONFIG_ENV_DEFAULT_NOWHERE) += nowhere.o
endif
ifdef CONFIG_SPL_BUILD
diff --git a/env/common.c b/env/common.c
index f21ff70096..760b55b9b0 100644
--- a/env/common.c
+++ b/env/common.c
@@ -230,7 +230,7 @@ void env_relocate(void)
env_htab.change_ok += gd->reloc_off;
#endif
if (gd->env_valid == ENV_INVALID) {
-#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_SPL_BUILD)
+#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_ENV_DEFAULT_NOWHERE) || defined(CONFIG_SPL_BUILD)
/* Environment not changable */
set_default_env(NULL);
#else
diff --git a/env/env.c b/env/env.c
index a2a65bde5e..9de26888e7 100644
--- a/env/env.c
+++ b/env/env.c
@@ -60,7 +60,7 @@ static enum env_location env_locations[] = {
#ifdef CONFIG_ENV_IS_IN_UBI
ENVL_UBI,
#endif
-#ifdef CONFIG_ENV_IS_NOWHERE
+#if defined(CONFIG_ENV_IS_NOWHERE) || defined(CONFIG_ENV_DEFAULT_NOWHERE)
ENVL_NOWHERE,
#endif
};