1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-07-01 14:11:15 +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:
Carl-Daniel Hailfinger
2010-10-08 18:52:29 +00:00
parent 92c8b0cec2
commit f52f784bb3
12 changed files with 97 additions and 183 deletions

11
jedec.c
View File

@ -402,11 +402,6 @@ int write_jedec(struct flashchip *flash, uint8_t *buf)
mask = getaddrmask(flash);
if (erase_chip_jedec(flash)) {
msg_cerr("ERASE FAILED!\n");
return -1;
}
msg_cinfo("Programming page: ");
for (i = 0; i < total_size / page_size; i++) {
msg_cinfo("%04d at address: 0x%08x", i, i * page_size);
@ -429,12 +424,6 @@ int write_jedec_1(struct flashchip *flash, uint8_t * buf)
mask = getaddrmask(flash);
programmer_delay(10);
if (erase_flash(flash)) {
msg_cerr("ERASE FAILED!\n");
return -1;
}
msg_cinfo("Programming page: ");
for (i = 0; i < flash->total_size; i++) {
if ((i & 0x3) == 0)