On 12/19/25 12:22 AM, Tom Rini wrote:
On Fri, Dec 19, 2025 at 12:09:28AM +0100, Marek Vasut wrote:
On 12/18/25 2:58 PM, Tom Rini wrote:
On Wed, Dec 17, 2025 at 11:58:15PM +0100, Marek Vasut wrote:
On 12/17/25 9:56 PM, Tom Rini wrote:
On Wed, Dec 17, 2025 at 09:12:33PM +0100, Marek Vasut wrote:
Add support for converting single-copy environment to redundant environment.
In case CRC checks on both redundant environment copies fail, try one more
CRC check on the primary environment copy and treat it as single environment.
If that check does pass, rewrite the single-copy environment into redundant
environment format, indicate the environment is valid, and import that as
usual primary copy of redundant environment. Follow up 'env save' will then
store two environment copies and the system will continue to operate as
regular redundant environment system.
Add test which validates this upgrade path. The test starts with spi.bin
which is pre-populated as single-copy environment and then upgrades that
environment to dual-copy environment.
Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Heinrich Schuchardt <[email protected]>
Cc: Jerome Forissier <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: [email protected]
For merging, a cover letter makes things so much easier, please add one
for v2. And, I think this needs a Kconfig option. I'm sure you added
this because someone has a valid use case but it's going to grow too
many platforms where that feature isn't likely desired. Thanks.
Do you actually observe growth ? Because this is calling existing functions,
so the growth has to be in units of bytes tops.
A good question, I was assuming so but checking xilinx_versal_virt (a
platform with redundant env) shows yes, it does:
01: Merge patch series "fit: print conf node compatibles + use property string
constants"
05: env: Add single to redundant environment upgrade path
aarch64: (for 1/1 boards) all +96.0 text +96.0
xilinx_versal_virt: all +96 text +96
u-boot: add: 0/0, grow: 1/0 bytes: 84/0 (84)
function old new
delta
env_check_redund 316 400
+84
Correct, and the growth is minimal and gated by ENV_REDUND already.
I think it would still be good not to confuse users with too many additional
Kconfig symbols, but if you insist, I will add one ?
Yes, please add one, it's 188 platforms that'll grow and I do think
migration from single to redundant env is a niche use case. Thanks.
Just for completeness, added in V2.