Skip to content
Commit 622b5d35 authored by Marek Vasut's avatar Marek Vasut Committed by Jagan Teki
Browse files

cmd: sf: Handle unaligned 'update' start offset



Currently the 'sf update' command fails in case the 'start' offset is
not aligned to SPI NOR erase block size. Add the missing alignment
calculation. In case the start offset is in the middle of erase block,
round start address down to the nearest aligned one, compare only the
updated data between what is in the SPI NOR and what is being written,
copy new data at offset of the compare buffer, and write back the entire
erase block.

This is useful e.g. on i.MX6Q where the u-boot-with-spl.imx is at
offset 0x400 in the SPI NOR, while the SPI NOR may have erase block
size e.g. 0x1000 bytes.

Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Reviewed-by: default avatarJagan Teki <jagan@amarulasolutions.com>
parent e28d3ead
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment