summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2022-06-13 22:57:33 -0400
committerTom Rini <trini@konsulko.com>2022-06-28 17:11:48 -0400
commit5d7dea14007bc41b8984a7881bf1686d7030f644 (patch)
treed76198cbf506256b278cd77778b6353cb8019387 /env
parent5c3f6a320678d64c9fa0c42755488822a033b567 (diff)
downloadu-boot-5d7dea14007bc41b8984a7881bf1686d7030f644.tar.gz
u-boot-5d7dea14007bc41b8984a7881bf1686d7030f644.tar.bz2
u-boot-5d7dea14007bc41b8984a7881bf1686d7030f644.zip
Convert CONFIG_ENV_RANGE to Kconfig
This converts the following to Kconfig: CONFIG_ENV_RANGE Now that this is in Kconfig we can enforce a minimum size and so remove the check in C code to ensure range is larger than size. Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'env')
-rw-r--r--env/Kconfig18
-rw-r--r--env/nand.c8
2 files changed, 10 insertions, 16 deletions
diff --git a/env/Kconfig b/env/Kconfig
index 0aed7aea46..238e4c70cf 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -264,14 +264,6 @@ config ENV_IS_IN_NAND
during a "saveenv" operation. CONFIG_ENV_OFFSET_REDUND must be
aligned to an erase block boundary.
- - CONFIG_ENV_RANGE (optional):
-
- Specifies the length of the region in which the environment
- can be written. This should be a multiple of the NAND device's
- block size. Specifying a range with more erase blocks than
- are needed to hold CONFIG_ENV_SIZE allows bad blocks within
- the range to be avoided.
-
- CONFIG_ENV_OFFSET_OOB (optional):
Enables support for dynamically retrieving the offset of the
@@ -280,6 +272,16 @@ config ENV_IS_IN_NAND
Currently, CONFIG_ENV_OFFSET_REDUND is not supported when
using CONFIG_ENV_OFFSET_OOB.
+config ENV_RANGE
+ hex "Length of the region in which the environment can be written"
+ depends on ENV_IS_IN_NAND
+ range ENV_SIZE 0x7fffffff
+ default ENV_SIZE
+ help
+ This should be a multiple of the NAND device's block size.
+ Specifying a range with more erase blocks than are needed to hold
+ CONFIG_ENV_SIZE allows bad blocks within the range to be avoided.
+
config ENV_IS_IN_NVRAM
bool "Environment in a non-volatile RAM"
depends on !CHAIN_OF_TRUST
diff --git a/env/nand.c b/env/nand.c
index 21aa367d5b..df300b1317 100644
--- a/env/nand.c
+++ b/env/nand.c
@@ -33,10 +33,6 @@
#error CONFIG_ENV_OFFSET_REDUND must have CONFIG_CMD_SAVEENV & CONFIG_CMD_NAND
#endif
-#ifndef CONFIG_ENV_RANGE
-#define CONFIG_ENV_RANGE CONFIG_ENV_SIZE
-#endif
-
#if defined(ENV_IS_EMBEDDED)
static env_t *env_ptr = &environment;
#elif defined(CONFIG_NAND_ENV_DST)
@@ -201,10 +197,6 @@ static int env_nand_save(void)
#endif
};
-
- if (CONFIG_ENV_RANGE < CONFIG_ENV_SIZE)
- return 1;
-
ret = env_export(env_new);
if (ret)
return ret;