From: Tom Rini <trini@konsulko.com>
To: Marek Vasut <marex@denx.de>
Cc: u-boot@lists.denx.de, Fabio Estevam <festevam@gmail.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Peng Fan <peng.fan@nxp.com>, Stefano Babic <sbabic@denx.de>
Subject: Re: [PATCH 2/2] env: mmc: Add support for redundant env in both eMMC boot partitions
Date: Fri, 15 Oct 2021 12:42:07 -0400 [thread overview]
Message-ID: <20211015164207.GZ7964@bill-the-cat> (raw)
In-Reply-To: <20211006162954.63596-2-marex@denx.de>
[-- Attachment #1: Type: text/plain, Size: 2037 bytes --]
On Wed, Oct 06, 2021 at 06:29:54PM +0200, Marek Vasut wrote:
> 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/mmc.c | 47 ++++++++++++++++++++++++++++++++++++++++++-----
> 1 file changed, 42 insertions(+), 5 deletions(-)
>
> diff --git a/env/mmc.c b/env/mmc.c
> index e111d8e5881..465b104559b 100644
> --- a/env/mmc.c
> +++ b/env/mmc.c
> @@ -26,6 +26,18 @@
>
> DECLARE_GLOBAL_DATA_PTR;
>
> +/*
> + * In case the environment is redundant, stored in eMMC hardware boot
> + * partition and the environment and redundant environment offsets are
> + * identical, store the environment and redundant environment in both
> + * eMMC boot partitions, one copy in each.
> + * */
> +#if (defined(CONFIG_SYS_REDUNDAND_ENVIRONMENT) && \
> + (CONFIG_SYS_MMC_ENV_PART == 1) && \
> + (CONFIG_ENV_OFFSET == CONFIG_ENV_OFFSET_REDUND))
> +#define ENV_MMC_HWPART_REDUND
> +#endif
This needs to be documented in more than just the header, it should be
in Kconfig at least. And if we could enable this directly via a Kconfig
option instead, that would be even better.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2021-10-15 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-06 16:29 [PATCH 1/2] env: mmc: Add missing eMMC bootpart restoration to env erase Marek Vasut
2021-10-06 16:29 ` [PATCH 2/2] env: mmc: Add support for redundant env in both eMMC boot partitions Marek Vasut
2021-10-15 16:42 ` Tom Rini [this message]
2021-10-26 13:34 ` [PATCH 1/2] env: mmc: Add missing eMMC bootpart restoration to env erase Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211015164207.GZ7964@bill-the-cat \
--to=trini@konsulko.com \
--cc=festevam@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=marex@denx.de \
--cc=peng.fan@nxp.com \
--cc=sbabic@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox