summaryrefslogtreecommitdiff
path: root/spi25.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-10-08 18:52:29 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-10-08 18:52:29 +0000
commit0eb4e5ed213a64025c22dcb0536e78a22c878a23 (patch)
tree957964a468245432abbd23cd06839898b64105ce /spi25.c
parent209b4ac322126515a11dc780c157852eb9e44b4d (diff)
downloadflashrom-0eb4e5ed213a64025c22dcb0536e78a22c878a23.tar.gz
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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1206 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'spi25.c')
-rw-r--r--spi25.c16
1 files changed, 0 insertions, 16 deletions
diff --git a/spi25.c b/spi25.c
index 9aaefc4..bc2c86c 100644
--- a/spi25.c
+++ b/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);
}