From: Tom Rini Date: Thu, 14 Mar 2019 11:36:35 -0400 Subject: [U-Boot] Revert "env: add spi_flash_read_env function" In-Reply-To: <20190313111545.1812261-1-hs@denx.de> References: <20190313111545.1812261-1-hs@denx.de> Message-ID: <20190314153635.GS8732@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Mar 13, 2019 at 12:15:45PM +0100, Heiko Schocher wrote: > This reverts commit 9a9d66f5eff0f443de4c2c6ca3e27771ed14b1b4. > > 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 at 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 > Acked-by: Stefano Babic Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: not available URL: