aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/chips
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/chips')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0001.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0001.c b/drivers/mtd/chips/cfi_cmdset_0001.c
index a9eb1c516247..1707f98c322c 100644
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -1504,9 +1504,12 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
1504 int ret, wbufsize, word_gap, words; 1504 int ret, wbufsize, word_gap, words;
1505 const struct kvec *vec; 1505 const struct kvec *vec;
1506 unsigned long vec_seek; 1506 unsigned long vec_seek;
1507 unsigned long initial_adr;
1508 int initial_len = len;
1507 1509
1508 wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize; 1510 wbufsize = cfi_interleave(cfi) << cfi->cfiq->MaxBufWriteSize;
1509 adr += chip->start; 1511 adr += chip->start;
1512 initial_adr = adr;
1510 cmd_adr = adr & ~(wbufsize-1); 1513 cmd_adr = adr & ~(wbufsize-1);
1511 1514
1512 /* Let's determine this according to the interleave only once */ 1515 /* Let's determine this according to the interleave only once */
@@ -1519,7 +1522,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
1519 return ret; 1522 return ret;
1520 } 1523 }
1521 1524
1522 XIP_INVAL_CACHED_RANGE(map, adr, len); 1525 XIP_INVAL_CACHED_RANGE(map, initial_adr, initial_len);
1523 ENABLE_VPP(map); 1526 ENABLE_VPP(map);
1524 xip_disable(map, chip, cmd_adr); 1527 xip_disable(map, chip, cmd_adr);
1525 1528
@@ -1610,7 +1613,7 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
1610 chip->state = FL_WRITING; 1613 chip->state = FL_WRITING;
1611 1614
1612 ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr, 1615 ret = INVAL_CACHE_AND_WAIT(map, chip, cmd_adr,
1613 adr, len, 1616 initial_adr, initial_len,
1614 chip->buffer_write_time); 1617 chip->buffer_write_time);
1615 if (ret) { 1618 if (ret) {
1616 map_write(map, CMD(0x70), cmd_adr); 1619 map_write(map, CMD(0x70), cmd_adr);