From d11d1becbd6ab67c4cc0c19bda2886b28c1fdc02 Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 17 Oct 2021 19:23:36 +0200 Subject: env: mmc: Add support for redundant env in both eMMC boot partitions Currently the MMC environment driver supports storing redundant environment only in one eMMC partition at different offsets. This is sub-optimal, since if this one boot partition is erased, both copies of environment are lost. Since the eMMC has two boot partitions, add support for storing one copy of environment in each of the two boot partitions. To enable this functionality, select CONFIG_SYS_REDUNDAND_ENVIRONMENT to indicate redundant environment should be used. Set CONFIG_SYS_MMC_ENV_PART to 1 to indicate environment should be stored in eMMC boot partition. Set CONFIG_ENV_OFFSET equal to CONFIG_ENV_OFFSET_REDUND, and both to the offset from start of eMMC boot partition where the environment should be located. Signed-off-by: Marek Vasut Cc: Fabio Estevam Cc: Jaehoon Chung Cc: Peng Fan Cc: Stefano Babic --- env/Kconfig | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'env/Kconfig') diff --git a/env/Kconfig b/env/Kconfig index f75f2b13536..06d72bad1dc 100644 --- a/env/Kconfig +++ b/env/Kconfig @@ -200,6 +200,11 @@ config ENV_IS_IN_MMC This value may also be positive or negative; this is handled in the same way as CONFIG_ENV_OFFSET. + In case CONFIG_SYS_MMC_ENV_PART is 1 (i.e. environment in eMMC boot + partition) then setting CONFIG_ENV_OFFSET_REDUND to the same value + as CONFIG_ENV_OFFSET makes use of the second eMMC boot partition for + the redundant environment copy. + This value is also in units of bytes, but must also be aligned to an MMC sector boundary. -- cgit v1.3.1