u-boot/env
Heiko Schocher 9ba5e5bc26 Revert "env: add spi_flash_read_env function"
This reverts commit 9a9d66f5ef.

because it breaks fw_setenv and U-Boot interworking, if
U-Boot environment is stored in a SPI-NOR.

Reproduce it with:
boot linux with empty Environment and store a variable
with fw_setenv into it, the Environment is now filled
with 0xff:

root@ckey5e:10:8e:~# hexdump -C /dev/mtd4
00000000  e9 e8 07 fa 01 62 6f 6f  74 63 6d 64 3d 72 75 6e  |.....bootcmd=run|
[...]
00000f30  7d 00 75 62 69 62 6f 6f  74 76 6f 6c 3d 32 00 00  |}.ubibootvol=2..|
00000f40  00 ff ff ff ff ff ff ff  ff ff ff ff ff ff ff ff  |................|

Boot now U-Boot prints:

Loading Environment from SPI Flash... SF: Detected s25fl128l with page size 256 Bytes, erase size 4 KiB, total 16 MiB
*** Warning - bad CRC, using default environment

Reason is the above commit, as it only reads until \0\0
is found, and assumes the rest of the Environment
space is filled with 0x00, which is not the case when
saving an Environment under linux with fw_setenv.

Signed-off-by: Heiko Schocher <hs@denx.de>
Acked-by: Stefano Babic <sbabic@denx.de>
2019-03-13 20:32:09 -04:00
..
attr.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
callback.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
common.c env: common: Return specific error code on bad CRC 2019-01-26 08:13:56 -05:00
eeprom.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
embedded.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
env.c env: Fix saving environment to "bad CRC" location 2019-01-26 08:13:56 -05:00
ext4.c env: common: accept flags on reset to default env 2018-07-19 16:17:58 -04:00
fat.c env: common: accept flags on reset to default env 2018-07-19 16:17:58 -04:00
flags.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
flash.c env: allow flash and nand env driver to compile together 2018-12-04 13:07:13 -08:00
Kconfig ARC: Move ENV_SIZE and ENV_OFFSET to Kconfig 2019-01-25 08:38:18 +03:00
Makefile env: Simplify Makefile using $(SPL_TPL_) 2018-07-21 12:24:31 -04:00
mmc.c env: common: accept flags on reset to default env 2018-07-19 16:17:58 -04:00
nand.c env: allow flash and nand env driver to compile together 2018-12-04 13:07:13 -08:00
nowhere.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
nvram.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
onenand.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
remote.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sata.c env: sata: Fix saveenv issue 2019-01-09 07:13:32 -05:00
sf.c Revert "env: add spi_flash_read_env function" 2019-03-13 20:32:09 -04:00
ubi.c env: ubi: Add missing ENV_NAME 2018-08-24 16:00:48 -04:00