1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-02 22:43:17 +02:00

Flashrom support for some Numonyx parts (M25PE)

Using block erase d8 as discussed with Peter Stuge

Corresponding to flashrom svn r333 and coreboot v2 svn r3707.

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
This commit is contained in:
Stefan Reinauer
2008-10-29 22:13:20 +00:00
committed by Stefan Reinauer
parent b759db2cb5
commit 424ed22ee9
3 changed files with 29 additions and 0 deletions

23
spi.c
View File

@ -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)
{