aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index 5ff5c4a16943..b86197286f24 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1536,8 +1536,20 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
1536 UDELAY(map, chip, adr, 1); 1536 UDELAY(map, chip, adr, 1);
1537 } 1537 }
1538 1538
1539 /* reset on all failures. */ 1539 /*
1540 map_write( map, CMD(0xF0), chip->start ); 1540 * Recovery from write-buffer programming failures requires
1541 * the write-to-buffer-reset sequence. Since the last part
1542 * of the sequence also works as a normal reset, we can run
1543 * the same commands regardless of why we are here.
1544 * See e.g.
1545 * http://www.spansion.com/Support/Application%20Notes/MirrorBit_Write_Buffer_Prog_Page_Buffer_Read_AN.pdf
1546 */
1547 cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi,
1548 cfi->device_type, NULL);
1549 cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi,
1550 cfi->device_type, NULL);
1551 cfi_send_gen_cmd(0xF0, cfi->addr_unlock1, chip->start, map, cfi,
1552 cfi->device_type, NULL);
1541 xip_enable(map, chip, adr); 1553 xip_enable(map, chip, adr);
1542 /* FIXME - should have reset delay before continuing */ 1554 /* FIXME - should have reset delay before continuing */
1543 1555