[U-Boot] [PATCH v5 12/30] env: Convert CONFIG_ENV_IS_IN... to a choice

Simon Glass sjg at chromium.org
Thu Aug 3 18:21:59 UTC 2017


At present we support multiple environment drivers but there is not way to
select between them at run time. Also settings related to the position and
size of the environment area are global (i.e. apply to all locations).

Until these limitations are removed we cannot really support more than one
environment location. Adjust the location to be a choice so that only one
can be selected. By default the environment is 'nowhere', meaning that the
environment exists only in memory and cannot be saved.

Also expand the help for the 'nowhere' option and move it to the top since
it is the default.

Signed-off-by: Simon Glass <sjg at chromium.org>
---

Changes in v5:
- Add new patch to convert CONFIG_ENV_IS_IN... to a choice

Changes in v4: None
Changes in v3: None
Changes in v2: None

 env/Kconfig | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/env/Kconfig b/env/Kconfig
index c8dd65f3a5..99d6095b31 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -1,5 +1,25 @@
 menu "Environment"
 
+choice
+	prompt "Select the location of the environment"
+	default ENV_IS_NOWHERE if !ARCH_SUNXI
+	default ENV_IS_IN_MMC if ARCH_SUNXI
+	help
+	  At present the environment can be stored in only one place. Use this
+	  option to select the location. This is either a device (where the
+	  environemnt information is simply written to a fixed location or
+	  partition on the device) or a filesystem (where the environment
+	  information is written to a file).
+
+config ENV_IS_NOWHERE
+	bool "Environment is not stored"
+	help
+	  Define this if you don't want to or can't have an environment stored
+	  on a storage medium. In this case the environemnt will still exist
+	  while U-Boot is running, but once U-Boot exits it will not be
+	  stored. U-Boot will therefore always start up with a default
+	  environment.
+
 config ENV_IS_IN_DATAFLASH
 	bool "Environment in dataflash"
 	depends on !CHAIN_OF_TRUST
@@ -161,7 +181,6 @@ config ENV_IS_IN_FLASH
 config ENV_IS_IN_MMC
 	bool "Environment in an MMC device"
 	depends on !CHAIN_OF_TRUST
-	default y if ARCH_SUNXI
 	help
 	  Define this if you have an MMC device which you want to use for the
 	  environment.
@@ -364,11 +383,7 @@ config ENV_IS_IN_UBI
 	  You will probably want to define these to avoid a really noisy system
 	  when storing the env in UBI.
 
-config ENV_IS_NOWHERE
-	bool "Environment is not stored"
-	help
-	  Define this if you don't want to or can't have an environment stored
-	  on a storage medium
+endchoice
 
 config ENV_FAT_INTERFACE
 	string "Name of the block device for the environment"
-- 
2.14.0.rc1.383.gd1ce394fe2-goog



More information about the U-Boot mailing list