[U-Boot] [RFC] skip area in flash/memory commands (cp, cmp, ...)

Wolfgang Denk wd at denx.de
Mon Apr 11 23:08:09 CEST 2011


Dear Andreas Pretzsch,

In message <1302551856.13241.146.camel at ws-apr.office.loc> you wrote:
>
> > > What do you think, worth the effort, acceptable in mainline or
> > > over-engineering ?
> > 
> > Over-engineering IMO.

I agree with Albert here.

> > There is a reason why a board defines its environment as embedded, and 
> > it is because it wants it applied when flashing a new U-Boot.
> 
> Or simply not to waste flash when having a few small sectors.

Right, that's exactly why this was invented.

> > But if you really want to keep the existing embedded environment when 
> > flashing a new U-Boot, then after you have loaded the new U-Boot in RAM 
> > as usual, all you need is to overwrite its environment with the one 
> > already in Flash with a single, standard, cp.b instruction. After that 
> > you can erase Flash and copy from RAM to Flash as usual.
> 
> ACK. The most obvious and simple approach for this scenario. And

No. It may be obvious, but there are far easier ways.

The most simple way is a sequence of tftp, protect off, erase, cp,
and finally saveenv.

As long as your flash layout does not change (and experience shows
that these are extremely rare cases) a simple "saveenv" is enough to
update your current environment in the freshly written U-Boot image.

For more fancy operations, you can use "env export".

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I don't see any direct evidence ...  but, then, my crystal ball is in
dire need of an ectoplasmic upgrade. :-)              -- Howard Smith


More information about the U-Boot mailing list