fw_env: auto-detect NAND characteristics

Anthony Loiseau anthony at loiseau.fr
Thu Dec 21 16:59:28 CET 2023


Hello,

Please find attached a patch proposal which modifies fw_env so NAND chip
erase size as well as environment sector counts are guessed at runtime
if they are both statically configured as zero.
This actually extend a previous similar behavior which was NOR-specific,
useful when a same RootFS is executed with several flash chips.

Be aware that I did not test this exact patch for real. I extracted it from
my older u-boot-flsc 2016 tree on which it works well, and built it using
a sandbox configuration, without running it. I only checked my gcc was happy
with those lines (no warning added). My feeling is that this patch is small
enough to be confident it will work on master as it worked on my old tree.


Opened to any review or request,
best rergards,
Anthony Loiseau



More information about the U-Boot mailing list