summaryrefslogtreecommitdiff
path: root/env
diff options
context:
space:
mode:
Diffstat (limited to 'env')
-rw-r--r--env/Kconfig12
-rw-r--r--env/mmc.c5
2 files changed, 17 insertions, 0 deletions
diff --git a/env/Kconfig b/env/Kconfig
index 7342397e16..13e32104b4 100644
--- a/env/Kconfig
+++ b/env/Kconfig
@@ -662,6 +662,18 @@ config SYS_MMC_ENV_PART
partition 0 or the first boot partition, which is 1 or some other defined
partition.
+config USE_ENV_MMC_PARTITION
+ bool "use the mmc environment partition name"
+ depends on ENV_IS_IN_MMC
+
+config ENV_MMC_PARTITION
+ string "mmc environment partition name"
+ depends on USE_ENV_MMC_PARTITION
+ help
+ MMC partition name used to save environment variables.
+ If this variable is unset, u-boot will try to get the env partition name
+ from the device-tree's /config node.
+
config ENV_MMC_USE_DT
bool "Read partition name and offset in DT"
depends on ENV_IS_IN_MMC && OF_CONTROL
diff --git a/env/mmc.c b/env/mmc.c
index 7a5836ad66..cb14bbb58f 100644
--- a/env/mmc.c
+++ b/env/mmc.c
@@ -114,8 +114,13 @@ static inline s64 mmc_offset(struct mmc *mmc, int copy)
if (IS_ENABLED(CONFIG_SYS_MMC_ENV_PART))
hwpart = mmc_get_env_part(mmc);
+#if defined(CONFIG_ENV_MMC_PARTITION)
+ str = CONFIG_ENV_MMC_PARTITION;
+#else
/* look for the partition in mmc CONFIG_SYS_MMC_ENV_DEV */
str = ofnode_conf_read_str(dt_prop.partition);
+#endif
+
if (str) {
/* try to place the environment at end of the partition */
err = mmc_offset_try_partition(str, copy, &val);