[PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO

Rasmus Villemoes rasmus.villemoes at prevas.dk
Thu Sep 24 13:08:42 CEST 2020


On 24/09/2020 12.54, Wolfgang Denk wrote:
> Dear Rasmus,
> 
> In message <125344f4-2b69-1c7a-0f5a-6d27ab312487 at prevas.dk> you wrote:
>>>
>>> On our newer boards with the 4K erase size, saving the environment now
>>> takes 0.080 seconds instead of 0.53 seconds, which directly translates
>>> to that much faster boot time since our logic always causes the
>>> environment to be written during boot.
> 
> Is this your way of implementing scheduled obsolescence? 

I'll ignore that.

> Automatically writing the environment on every boot is always a
> really bad idea. Never ever do that.

Well, there's really no other place on this piece of hardware to
implement a boot counter/slot selection. Sure, we could use another part
of the spi flash and define our own storage format etc., but then we
might as well use the u-boot environment, which allows us to use
existing tools/APIs both on the U-Boot and linux side.

And yes, the number of erase cycles compared to how often this device is
booted was taken into account when this was decided.

Rasmus


More information about the U-Boot mailing list