summaryrefslogtreecommitdiffstats
path: root/spi25.c
diff options
context:
space:
mode:
authorHelge Wagner <helge.wagner@ge.com>2010-10-05 22:29:08 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-10-05 22:29:08 +0000
commit1db7a448b37f1f699bd9a64d2187f3883e0f4503 (patch)
tree90d10ef4b79f1e9fdeb2ad9cdb165f0d04f429c7 /spi25.c
parent738e252112271f63c8ad4c9a135cfe17ff98e87d (diff)
downloadflashrom-1db7a448b37f1f699bd9a64d2187f3883e0f4503.tar.gz
flashrom-1db7a448b37f1f699bd9a64d2187f3883e0f4503.tar.bz2
flashrom-1db7a448b37f1f699bd9a64d2187f3883e0f4503.zip
Massive speedups for SST25VF032B and SST25VF064C
Use AAI write for SST SST25VF032B. Speedup from 228 to 113 seconds. Use page (256 byte) write for SST SST25VF064C. Speedup from 3091 to 123 seconds. Corresponding to flashrom svn r1194. Signed-off-by: Helge Wagner <helge.wagner@ge.com> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'spi25.c')
-rw-r--r--spi25.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/spi25.c b/spi25.c
index 9cab10aa0..688a32952 100644
--- a/spi25.c
+++ b/spi25.c
@@ -1300,7 +1300,7 @@ int spi_chip_write_1(struct flashchip *flash, uint8_t *buf)
return spi_chip_write_1_new(flash, buf, 0, flash->total_size * 1024);
}
-int spi_aai_write(struct flashchip *flash, uint8_t *buf, int start, int len)
+int spi_aai_write_new(struct flashchip *flash, uint8_t *buf, int start, int len)
{
uint32_t pos = start;
int result;
@@ -1391,3 +1391,17 @@ int spi_aai_write(struct flashchip *flash, uint8_t *buf, int start, int len)
spi_write_disable();
return 0;
}
+
+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);
+}
+