diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2008-10-29 22:13:20 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2008-10-29 22:13:20 +0000 |
commit | a69d1db50408053c3766d65c54fd266afd77a158 (patch) | |
tree | ed0948e85868504f9ea91536ef2bc5bd02a45ca3 /util/flashrom/spi.c | |
parent | c6bb6be6d27f95851cf6b7cbb67ddbd1ee5c8c5d (diff) | |
download | coreboot-a69d1db50408053c3766d65c54fd266afd77a158.tar.xz |
Flashrom support for some Numonyx parts (M25PE)
using block erase d8 as discussed with Peter Stuge
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3707 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/flashrom/spi.c')
-rw-r--r-- | util/flashrom/spi.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/util/flashrom/spi.c b/util/flashrom/spi.c index 0028b4cacd..83624fa381 100644 --- a/util/flashrom/spi.c +++ b/util/flashrom/spi.c @@ -310,6 +310,29 @@ int spi_block_erase_d8(const struct flashchip *flash, unsigned long addr) return 0; } +int spi_chip_erase_d8(struct flashchip *flash) +{ + int i, rc = 0; + int total_size = flash->total_size * 1024; + int erase_size = 64 * 1024; + + spi_disable_blockprotect(); + + printf("Erasing chip: \n"); + + for (i = 0; i < total_size / erase_size; i++) { + rc = spi_block_erase_d8(flash, i * erase_size); + if (rc) { + printf("Error erasing block at 0x%x\n", i); + break; + } + } + + printf("\n"); + + return rc; +} + /* Sector size is usually 4k, though Macronix eliteflash has 64k */ int spi_sector_erase(const struct flashchip *flash, unsigned long addr) { |