]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
Xilinx: ARM: SPI: fix spansion erase for single and dual devices
authorJagan <jaganna@xilinx.com>
Wed, 6 Jun 2012 06:05:41 +0000 (11:35 +0530)
committerJohn Linn <john.linn@xilinx.com>
Wed, 6 Jun 2012 18:32:48 +0000 (11:32 -0700)
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>
drivers/mtd/spi/spansion.c

index b4cdc9016389ad1b5bfc8b45e6bbd014c186ea9e..c9e10df96b48524b497eb8dd245f7063b2e2ce64 100755 (executable)
@@ -344,7 +344,10 @@ int spansion_erase(struct spi_flash *flash, u32 offset, size_t len)
 
        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) {