[U-Boot] [PATCH] fw_env: add NAND support
Guennadi Liakhovetski
lg at denx.de
Wed Sep 3 13:19:28 CEST 2008
On Tue, 2 Sep 2008, Wolfgang Denk wrote:
> Note that this is a serious impairment compared to the old version.
>
> The whole logic of writing the envrionment (and especially so when
> redundancy is used) is based on separate logic steps that are per-
> formed strictly sequentially, and only when the previous one was
> successfully completed. This essential to maintain consistent data.
> For the redundant case that means:
>
> 1) write the environment data to flash.
> *After* this has completed, make the data valid by
> 2) writing the CRC checksum.
> *After* this has completed, make this copy of the environment valid by
> 3) writing the valid flag to this copy.
> *After* this has completed, make the other copy of the environment obsolete by
> 4) writing the obsolete flag to the other copy.
I am afraid, I cannot confirm this in the current version. In it first CRC
and flag is written with one write, then the data, then optionally any
residual data. Which seems like not providing any additional robustness.
Would you like me to replicate this behaviour, in which case we could just
as well write the whole buffer at once as I did up to now, or change it
to follow your scheme above? In the latter case I am not sure if this will
work with all kernel versions with all mtd drivers and all NOR flashes.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
More information about the U-Boot
mailing list