[PATCH] cmd: sf: Handle unaligned 'update' start offset

Jagan Teki jagan at amarulasolutions.com
Sun Oct 23 07:30:57 CEST 2022


On Wed, Sep 28, 2022 at 10:15 PM Marek Vasut <marex at denx.de> wrote:
>
> 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: Marek Vasut <marex at denx.de>
> ---

Reviewed-by: Jagan Teki <jagan at amarulasolutions.com>


More information about the U-Boot mailing list