From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92C5DC433EF for ; Fri, 15 Oct 2021 16:42:22 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A463360C51 for ; Fri, 15 Oct 2021 16:42:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A463360C51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B308183866; Fri, 15 Oct 2021 18:42:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="TWcSGpme"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0EADE83872; Fri, 15 Oct 2021 18:42:16 +0200 (CEST) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D9F8683656 for ; Fri, 15 Oct 2021 18:42:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x834.google.com with SMTP id g17so1065550qtk.8 for ; Fri, 15 Oct 2021 09:42:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ECEkhyfjw2U+3y2Fzgx7NcUPaCUnvVB0KTr3e63nGEI=; b=TWcSGpmeE9UURa4Rp3BQ277fOoEDZNB56twwj2+AmmOIT4YzlwMCGhw5Vgyzz2vs9M gCvaZmumkLi4uVKNEgDGZFz3Yl/Un6pCfDFIBMtsuLJaINKEaYA4qD3tKFIUrlsln2Pn 1O0bAbg8Jxv03EHTZL9I+s3tNBCyNBOlEEHj0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ECEkhyfjw2U+3y2Fzgx7NcUPaCUnvVB0KTr3e63nGEI=; b=CH7tdIVDf1Tc6eNFR4kIS8axeKvhCYjqwZa88GwieUOM1DFni5QHRDL9Ydba54MtOz BlkriTG8xnbcCsUh8fOWBbOG29Xz1QZ/AdXpmGW6EszjIwmuGb5G2Q/w+zg4soRJQOmN 3xNxWW8Tr864UXSXIBcVRadhsaOT1wFRxLza7XHbTU0XEMcC9JjG9XEMiSo7XTppBiAq 7/AmK9d684/0rIrNHzKFaQ+6E9rwFM5/8+J7pWTt4dwokpP5/ltSrHDDbTQc9c8so7Uo 9CwC0BwK5U+ae9KR4GP71dxHmgZGP7Xnf5Lz9cV+TudXvrPGcaPQPciUMp/eLjD1p4CK 64Uw== X-Gm-Message-State: AOAM532B+pwyEpctyXGqVmL3YL7QaEAHqsFwJR5ODy8pDkekJTcrvFbF iRBtVqk15eVVBoQhJu/ivb+PzW/8UDw= X-Google-Smtp-Source: ABdhPJwwPiBsABaTP8ui6R0BmRCeu6Cxr3hB1TMYO937iKA5OB971E2gar6iLQeZCUFySDjHPwkEmw== X-Received: by 2002:ac8:7319:: with SMTP id x25mr14600210qto.147.1634316129726; Fri, 15 Oct 2021 09:42:09 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-f8b0-5c25-4d47-ecdb.res6.spectrum.com. [2603:6081:7b01:cbda:f8b0:5c25:4d47:ecdb]) by smtp.gmail.com with ESMTPSA id c15sm2798967qkg.60.2021.10.15.09.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 09:42:09 -0700 (PDT) Date: Fri, 15 Oct 2021 12:42:07 -0400 From: Tom Rini To: Marek Vasut Cc: u-boot@lists.denx.de, Fabio Estevam , Jaehoon Chung , Peng Fan , Stefano Babic Subject: Re: [PATCH 2/2] env: mmc: Add support for redundant env in both eMMC boot partitions Message-ID: <20211015164207.GZ7964@bill-the-cat> References: <20211006162954.63596-1-marex@denx.de> <20211006162954.63596-2-marex@denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RxBYAwKLDxPbmc5c" Content-Disposition: inline In-Reply-To: <20211006162954.63596-2-marex@denx.de> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --RxBYAwKLDxPbmc5c Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 06, 2021 at 06:29:54PM +0200, Marek Vasut wrote: > Currently the MMC environment driver supports storing redundant environme= nt > only in one eMMC partition at different offsets. This is sub-optimal, sin= ce > 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. >=20 > 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 offs= et > from start of eMMC boot partition where the environment should be located. >=20 > Signed-off-by: Marek Vasut > Cc: Fabio Estevam > Cc: Jaehoon Chung > Cc: Peng Fan > Cc: Stefano Babic > --- > env/mmc.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- > 1 file changed, 42 insertions(+), 5 deletions(-) >=20 > 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 @@ > =20 > DECLARE_GLOBAL_DATA_PTR; > =20 > +/* > + * 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 =3D=3D 1) && \ > + (CONFIG_ENV_OFFSET =3D=3D 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. --=20 Tom --RxBYAwKLDxPbmc5c Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFpr1wACgkQFHw5/5Y0 tyxK8Qv/TqM38XF7gK2uXjTMWsYkYHWYvV1ns93vfWUEClcdNZJmwBIrviF0Dnp0 2IoYWuZZ4571muTN330qMw3tu25yqKHHlw0H25HyXPKhyChBUN9enPJTvHzHwGAl FlIo8TXArzofyhzeWhj79cxpDjBB7FnyPhAJYGN7H7wlQIOEnCmEqWtslV6NkQFP R/u1ZbNySwT61Tpize/1PPX/VDuLXJgGjmWs/JBRCIWxKXt2cm4Lo7oRC31usG7X pLcXgmaM8wRsF22iIawoC7Um8TSYAPGyNi6ol0lD2lb/MR/cV+3/1p/I/87KaQyR Zk+vMVzfwYCVemPE/5/Njo3Z5anCor/Lvxh+muTtN6McAbqvXcKUWSMCXe9cbxtw wBVqVp0o1Jwgfx2WWrYM2YzhpDjhYC1dwIKB5BxOrlX9XIiC531G237t7TTKdUKF AMRBWpWmzfhK5BVoCRRd6133YvHeWFYB0iYk4xX8VmEFxcB8ddS+4t0HAIlgBVGK tfzIqmDc =nCSs -----END PGP SIGNATURE----- --RxBYAwKLDxPbmc5c--