Skip to content
Snippets Groups Projects
Commit fcffb680 authored by Mike Frysinger's avatar Mike Frysinger Committed by Wolfgang Denk
Browse files

sf: fix stmicro offset setup while erasing

parent d394a779
No related branches found
No related tags found
No related merge requests found
...@@ -281,7 +281,8 @@ int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len) ...@@ -281,7 +281,8 @@ int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
ret = 0; ret = 0;
for (actual = 0; actual < len; actual++) { for (actual = 0; actual < len; actual++) {
cmd[1] = (offset / sector_size) + actual; cmd[1] = offset >> 16;
offset += sector_size;
ret = spi_flash_cmd(flash->spi, CMD_M25PXX_WREN, NULL, 0); ret = spi_flash_cmd(flash->spi, CMD_M25PXX_WREN, NULL, 0);
if (ret < 0) { if (ret < 0) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment