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
This commit is contained in:
committed by
Stefan Reinauer
parent
c6bb6be6d2
commit
a69d1db504
@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user