[flashrom] [commit] r1194 - trunk
repository service
svn at flashrom.org
Wed Oct 6 00:29:08 CEST 2010
Author: hailfinger
Date: Wed Oct 6 00:29:08 2010
New Revision: 1194
URL: http://flashrom.org/trac/flashrom/changeset/1194
Log:
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.
Signed-off-by: Helge Wagner <helge.wagner at ge.com>
Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
Modified:
trunk/chipdrivers.h
trunk/flashchips.c
trunk/spi25.c
Modified: trunk/chipdrivers.h
==============================================================================
--- trunk/chipdrivers.h Wed Oct 6 00:06:05 2010 (r1193)
+++ trunk/chipdrivers.h Wed Oct 6 00:29:08 2010 (r1194)
@@ -63,7 +63,8 @@
int spi_nbyte_read(int addr, uint8_t *bytes, int len);
int spi_read_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize);
int spi_write_chunked(struct flashchip *flash, uint8_t *buf, int start, int len, int chunksize);
-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);
+int spi_aai_write(struct flashchip *flash, uint8_t *buf);
/* 82802ab.c */
uint8_t wait_82802ab(chipaddr bios);
Modified: trunk/flashchips.c
==============================================================================
--- trunk/flashchips.c Wed Oct 6 00:06:05 2010 (r1193)
+++ trunk/flashchips.c Wed Oct 6 00:29:08 2010 (r1194)
@@ -4860,7 +4860,7 @@
.model_id = SST_SST25VF032B,
.total_size = 4096,
.page_size = 256,
- .tested = TEST_OK_PRW,
+ .tested = TEST_OK_PREW,
.probe = probe_spi_rdid,
.probe_timing = TIMING_ZERO,
.block_erasers =
@@ -4883,7 +4883,7 @@
},
},
.unlock = spi_disable_blockprotect,
- .write = spi_chip_write_1,
+ .write = spi_aai_write,
.read = spi_chip_read,
},
@@ -4918,7 +4918,7 @@
},
},
.unlock = spi_disable_blockprotect,
- .write = spi_chip_write_1,
+ .write = spi_chip_write_256,
.read = spi_chip_read,
},
Modified: trunk/spi25.c
==============================================================================
--- trunk/spi25.c Wed Oct 6 00:06:05 2010 (r1193)
+++ trunk/spi25.c Wed Oct 6 00:29:08 2010 (r1194)
@@ -1300,7 +1300,7 @@
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 @@
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);
+}
+
More information about the flashrom
mailing list