The spansion_erase only worked for >64KiB sector size as the
erase command was forgotten when the x2 support was previously
added. The address width is now used as the other commands were
doing such that it works.
Signed-off-by: Jagan <jaganna@xilinx.com>
ret = 0;
for (actual = 0; actual < len; actual += sector_size) {
- cmd[1] = (offset + actual) >> 16;
+ unsigned page_addr;
+
+ page_addr = (offset + actual) / spsn->params->page_size;
+ span_addr2cmd(spsn, page_addr, 0, cmd);
ret = spi_flash_cmd(flash->spi, CMD_S25FLXX_WREN, NULL, 0);
if (ret < 0) {