diff options
author | Sean Nelson <audiohacked@gmail.com> | 2009-12-23 17:05:59 +0000 |
---|---|---|
committer | Sean Nelson <audiohacked@gmail.com> | 2009-12-23 17:05:59 +0000 |
commit | 6b11ad2f19b2ab6d1fca8822e0a37a6ebcaac325 (patch) | |
tree | 98d3e3a122064430879d129ec0cd7a231379caaa /mx29f002.c | |
parent | bbfeb70fb9c4c91eaa17db8349917f5dacb04d14 (diff) | |
download | ast2050-flashrom-6b11ad2f19b2ab6d1fca8822e0a37a6ebcaac325.zip ast2050-flashrom-6b11ad2f19b2ab6d1fca8822e0a37a6ebcaac325.tar.gz |
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>
Diffstat (limited to 'mx29f002.c')
-rw-r--r-- | mx29f002.c | 33 |
1 files changed, 33 insertions, 0 deletions
@@ -43,6 +43,39 @@ int probe_29f002(struct flashchip *flash) 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 */ |