mirror of
https://git.codelinaro.org/clo/qsdk/oss/boot/u-boot-2016.git
synced 2026-03-12 12:08:56 +01:00
cmd_sf: let "sf update" erase last sector as a whole
make "sf update" work with unaligned `len' parameter, by deleting the
whole last sector before writing, so to allow for:
sf update ${load_addr_r} 0 ${filesize}
Signed-off-by: Gerlando Falauto <gerlando.falauto@keymile.com>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Cc: Holger Brunck <holger.brunck@keymile.com>
Acked-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
This commit is contained in:
parent
5928b9a865
commit
3488850629
1 changed files with 2 additions and 1 deletions
|
|
@ -160,7 +160,8 @@ static const char *spi_flash_update_block(struct spi_flash *flash, u32 offset,
|
|||
*skipped += len;
|
||||
return NULL;
|
||||
}
|
||||
if (spi_flash_erase(flash, offset, len))
|
||||
/* Erase the entire sector */
|
||||
if (spi_flash_erase(flash, offset, flash->sector_size))
|
||||
return "erase";
|
||||
if (spi_flash_write(flash, offset, len, buf))
|
||||
return "write";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue