[U-Boot] env_sf: Fix recovery default

Tom Rini trini at konsulko.com
Tue Apr 7 19:58:44 CEST 2015


On Tue, Mar 24, 2015 at 08:59:00AM +0100, Mario Schuknecht wrote:

> The u-boot environment is redundantly stored in a NOR flash on our boards.
> Redundant means that there are two places to store the environment. But only
> one of the two is active. I discovered that on one board the u-boot (env_sf)
> uses the environment from the second place and the Kernel (fw_printenv) uses
> the environment from the first place.
> To decide which is the active environment there is a byte inside the
> environment. 1 means active and 0 means obsolete. But on that board both
> environments had have a 1. This can happen if a power loss or reset occurs
> during writing the environment. In this situation the u-boot (env_sf)
> implementation uses the second environment as default. But the Kernel
> (fw_printenv) implementation uses the first environment as default.
> 
> This commit corrects the default in the u-boot env_sf implementation when a
> problem was detected. Now the recovery default is the same like in all other
> environment implementations. E.g. fw_printenv and env_flash. This ensures that
> u-boot and Kernel use the same environment.
> 
> Signed-off-by: Mario Schuknecht <mario.schuknecht at dresearch-fe.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150407/89c3a96f/attachment.sig>


More information about the U-Boot mailing list