
From: Anthony Loiseau anthony.loiseau@allcircuits.com
Hello,
Here is 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 extends a previous similar behavior which was NOR-specific, useful when a same RootFS is executed with several flash chips, see e282c422e0b.
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 warnings added). My feeling is that this patch is small enough to feel confident it will work on master as it worked on my old tree.
Opened to any reviews or requests, best rergards, Anthony Loiseau
v1: initial buggy submission (broken thread) stephan toradex email no more valid v2: fix cover letter use another email for Stefan cc Rasmus (author of the changed lines)
Cc: Joe Hershberger joe.hershberger@ni.com cc: Stefan Agner stefan@agner.ch cc: Rasmus Villemoes rasmus.villemoes@prevas.dk Signed-off-by: Anthony Loiseau anthony.loiseau@allcircuits.com
Anthony Loiseau (1): fw_env: autodetect NAND erase size and env sectors
tools/env/README | 3 +++ tools/env/fw_env.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-)