From: Rasmus Villemoes Date: Thu, 24 Sep 2020 13:08:42 +0200 Subject: [PATCH 2/2] env: add CONFIG_ENV_SECT_SIZE_AUTO In-Reply-To: <4015025.1600944876@gemini.denx.de> References: <20200506084701.8076-1-rasmus.villemoes@prevas.dk> <20200506084701.8076-3-rasmus.villemoes@prevas.dk> <125344f4-2b69-1c7a-0f5a-6d27ab312487@prevas.dk> <4015025.1600944876@gemini.denx.de> Message-ID: <9ca8a55c-4df4-785a-5eb7-9efaa9d633c2@prevas.dk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 24/09/2020 12.54, Wolfgang Denk wrote: > Dear Rasmus, > > In message <125344f4-2b69-1c7a-0f5a-6d27ab312487@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