mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 06:23:18 +02:00
Move implicit erase out of chip drivers
Flashrom had an implicit erase-on-write for most flash chip and programmer drivers, but it was not entirely consistent. Some drivers had their own hand-rolled partial update functionality which made handling partial updates from generic code impossible. Move implicit erase out of chip drivers, and kill some dead erase functions at the same time. A full chip erase is now performed in the generic code for all flash chips on write, and after that the whole chip is written. Corresponding to flashrom svn r1206. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
This commit is contained in:
16
spi25.c
16
spi25.c
@ -1321,14 +1321,6 @@ int spi_chip_write_1_new(struct flashchip *flash, uint8_t *buf, int start, int l
|
||||
|
||||
int spi_chip_write_1(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
/* Erase first */
|
||||
msg_cinfo("Erasing flash before programming... ");
|
||||
if (erase_flash(flash)) {
|
||||
msg_cerr("ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
msg_cinfo("done.\n");
|
||||
|
||||
return spi_chip_write_1_new(flash, buf, 0, flash->total_size * 1024);
|
||||
}
|
||||
|
||||
@ -1426,14 +1418,6 @@ int spi_aai_write_new(struct flashchip *flash, uint8_t *buf, int start, int len)
|
||||
|
||||
int spi_aai_write(struct flashchip *flash, uint8_t *buf)
|
||||
{
|
||||
/* Erase first */
|
||||
msg_cinfo("Erasing flash before programming... ");
|
||||
if (erase_flash(flash)) {
|
||||
msg_cerr("ERASE FAILED!\n");
|
||||
return -1;
|
||||
}
|
||||
msg_cinfo("done.\n");
|
||||
|
||||
return spi_aai_write_new(flash, buf, 0, flash->total_size * 1024);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user