summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-10-14 19:28:03 -0400
committerWolfgang Denk <wd@denx.de>2009-11-22 23:56:36 +0100
commitfcffb680e77fcb48598d4a9944dbe2d4503170e0 (patch)
tree06e8ed63ded665f3eaa5fb666345c0e75a6c610b
parentd394a7795027d96ca55799df40bd5c4a13dbeebe (diff)
downloadu-boot-imx-fcffb680e77fcb48598d4a9944dbe2d4503170e0.zip
u-boot-imx-fcffb680e77fcb48598d4a9944dbe2d4503170e0.tar.gz
u-boot-imx-fcffb680e77fcb48598d4a9944dbe2d4503170e0.tar.bz2
sf: fix stmicro offset setup while erasing
Reported-by: Peter Gombos <gombos@protecta.hu> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--drivers/mtd/spi/stmicro.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/spi/stmicro.c b/drivers/mtd/spi/stmicro.c
index 9b910c1..ae0d047 100644
--- a/drivers/mtd/spi/stmicro.c
+++ b/drivers/mtd/spi/stmicro.c
@@ -281,7 +281,8 @@ int stmicro_erase(struct spi_flash *flash, u32 offset, size_t len)
ret = 0;
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);
if (ret < 0) {