[U-Boot] [PATCH] Revert "env: add spi_flash_read_env function"

Heiko Schocher hs at denx.de
Fri Mar 15 04:34:24 UTC 2019


Hello Horatiu,

Am 14.03.2019 um 13:53 schrieb Horatiu Vultur:
> Hi Heiko,
> 
> I managed to reproduce the issue that you described.

Fine, thanks for testing!

> Don't you think it is a little bit too harsh to remove the commit
> completely?

I am unsure here ...

> I am not sure but how many cases are where UBoot doesn't store anything
> in flash? And then lets the linux to update the flash.

I think that can happen very often. In my case for example we boot
SPL/U-Boot with usb loader, than an initsystem with kernel/dtb/ramdisk
and start swupdate for installing all sources (including setup
the Environment with fw_setenv)...

> Or is wouldn't better to update fw_setenv to set the entire flash to
> 0x0 when it detects that the CRC error? The same way how the saveenv it
> is doing in UBoot?

Indeed, just reproduced this on my board. Saving the Environment
with saveenv fills with 0x0 and saving with fw_setenv fills with
0xff.

This is no problem, until your optimization, and I think, we cannot
change this here without breaking a lot of boards, running fine.

I am here also on Stefanos side always to read the hole Environment
space, because we cannot be sure, with what the empty space is filled
up.

Back to your intention for this patch, stated in the commit message:
"""
     This is an optimization for large environments that contain few bytes
     environment variables. In this case it doesn't need to read the entire
     environment and only few pages.
"""

Hmm... why you use a big Environment, if you only have "few bytes" of
variables ?

Simply set CONFIG_ENV_SIZE to a smaller value than your CONFIG_ENV_SECT_SIZE

Is this not possible for you ?

bye,
Heiko
-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-52   Fax: +49-8142-66989-80   Email: hs at denx.de


More information about the U-Boot mailing list