From: Jerry Van Baren <gerald.vanbaren@ge.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] incremental environment updating
Date: Mon, 13 Apr 2009 08:53:15 -0400 [thread overview]
Message-ID: <49E335BB.4050609@ge.com> (raw)
In-Reply-To: <20090413122657.8C6FD83420E8@gemini.denx.de>
Wolfgang Denk wrote:
> Dear Jerry Van Baren,
>
> In message <49E32C3C.8090404@ge.com> you wrote:
>> Since flash can change 1s to 0s, but cannot change them back, you could
>> redefine the env storage to be
>> <next><crc><env><NUL>[undefined]
>> (note the added <next> at the start). By definition, the valid env's
>> <next> == 0xFFFFFFFF. To write a new env, simply write the offset of
>> [undefined] into the <next> location and then write a new env lump.
>
> I see problems with this:
>
> - it's incompatible with the current format, i. e. detection of
> existing old formats needs a special case which is something I
> always consider ugly.
True, although that is an issue only for upgrades to boards that have an
existing env and that you want to use the new env method on. I would
expect the special casing would not be excessively ugly and may not be
necessary, depending on how important backward compatibility (board
upgrading) is.
> - it works only on NOR flash, not on any media that can be accessed
> only in blocks
Not true: the offset merely needs to be aligned to the next block in
that case:
<next><crc><env><NUL>FFFFFFFFFFFF <next><crc><env><NUL>[undefined]
^^^^ offset of ------------------> ^^^^ 0xFFFFFFFF
All flash that I can recall seeing allows at least a limited number of
rewrites to a block (the limited number getting smaller on successive
generations), so two writes to the env start block (once to write the
new env, a second time to rewrite the 0xFFFFFFFF to point to the
superceeding env). If the flash didn't support two writes, that would
be a show-stopper. Due to how people use flash, I don't think the
number will ever go to one write (IIRC, 4 is typical of current
generation NAND).
> - handling of redundant environment becomes a lot more complicated
I don't think so: it would be handled the same way as the primary env in
a separate sector as is done currently. If you step through all of the
primary env lumps and the last one has an invalid CRC, you fall back to
the backup env and repeat the search.
> BTW: what was the exact problem we were trying to solve? Saving the
> time it takes to erase one flash sector?
>
> If we have to pay for this with introducing a new, incompatible
> environment format, and probably having to handle NOR flash and other
> storage media differently, I doubt if this is worth the effort.
That could very well be true.
> Best regards,
>
> Wolfgang Denk
Ditto,
gvb
next prev parent reply other threads:[~2009-04-13 12:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-13 10:09 [U-Boot] incremental environment updating Mike Frysinger
2009-04-13 10:15 ` Wolfgang Denk
2009-04-13 10:34 ` Mike Frysinger
2009-04-13 12:12 ` Jerry Van Baren
2009-04-13 12:26 ` Wolfgang Denk
2009-04-13 12:53 ` Jerry Van Baren [this message]
2009-04-13 13:06 ` Wolfgang Denk
2009-04-13 13:57 ` Jerry Van Baren
2009-04-13 12:34 ` Mike Frysinger
2009-04-13 13:04 ` Wolfgang Denk
2009-04-13 13:11 ` Jerry Van Baren
2009-04-13 13:30 ` Mike Frysinger
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=49E335BB.4050609@ge.com \
--to=gerald.vanbaren@ge.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.