Convert the following chips to use struct eraseblock
AMIC_A29002B
AMIC_A29002T
EN_29F002B
EN_29F002T
MBM29F004BC
MBM29F004TC
MBM29F400BC
MBM29F400TC
MX_25L3205
MX_25L6405
MX_29F002B
MX_29F002T
Add block erasers for m29f400bt and mx29f002.
Change programmer delays from 2 seconds to 10us in mx29f002 and am29f040b.
Corresponding to flashrom svn r819.
Signed-off-by: Sean Nelson <audiohacked@gmail.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
diff --git a/mx29f002.c b/mx29f002.c
index 7838c3d..411e539 100644
--- a/mx29f002.c
+++ b/mx29f002.c
@@ -43,6 +43,39 @@
return 0;
}
+int erase_sector_29f002(struct flashchip *flash, unsigned int address, unsigned int blocklen)
+{
+ chipaddr bios = flash->virtual_memory;
+
+ chip_writeb(0xAA, bios + 0x555);
+ chip_writeb(0x55, bios + 0x2AA);
+ chip_writeb(0x80, bios + 0x555);
+ chip_writeb(0xAA, bios + 0x555);
+ chip_writeb(0x55, bios + 0x2AA);
+ chip_writeb(0x30, bios + address);
+
+ programmer_delay(10);
+
+ /* wait for Toggle bit ready */
+ toggle_ready_jedec(bios + address);
+
+ if (check_erased_range(flash, address, blocklen)) {
+ fprintf(stderr, "ERASE FAILED!\n");
+ return -1;
+ }
+ return 0;
+}
+
+int erase_chip_29f002(struct flashchip *flash, unsigned int addr, unsigned int blocklen)
+{
+ if ((addr != 0) || (blocklen != flash->total_size * 1024)) {
+ fprintf(stderr, "%s called with incorrect arguments\n",
+ __func__);
+ return -1;
+ }
+ return erase_29f002(flash);
+}
+
/* FIXME: Use erase_chip_jedec?
* erase_29f002 uses shorter addresses, sends F0 (exit ID mode) and
* and has a bigger delay before polling the toggle bit */