env: mmc: Add support for redundant env in both eMMC boot partitions
authorMarek Vasut <marex@denx.de>
Sun, 17 Oct 2021 17:23:36 +0000 (19:23 +0200)
committerTom Rini <trini@konsulko.com>
Mon, 25 Oct 2021 18:33:13 +0000 (14:33 -0400)
commitd11d1becbd6ab67c4cc0c19bda2886b28c1fdc02
tree3497f7f60e9295745c916315e402c947974410e8
parentc6855195e4b4dd07d1ae04d9d98ed999f65b7dc3
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 <marex@denx.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Jaehoon Chung <jh80.chung@samsung.com>
Cc: Peng Fan <peng.fan@nxp.com>
Cc: Stefano Babic <sbabic@denx.de>
env/Kconfig
env/mmc.c