summaryrefslogtreecommitdiffstats
path: root/ft2232_spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-14 16:19:05 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2010-07-14 16:19:05 +0000
commit9a795d83fbb8842a271d5e037dc983a57b0419fd (patch)
treea9049f708d0ab7d42d122fecd23855aaa819c5bc /ft2232_spi.c
parent1748c5701f77ab7164ab3311f37abc356d825ccb (diff)
downloadflashrom-9a795d83fbb8842a271d5e037dc983a57b0419fd.tar.gz
flashrom-9a795d83fbb8842a271d5e037dc983a57b0419fd.tar.bz2
flashrom-9a795d83fbb8842a271d5e037dc983a57b0419fd.zip
Convert SPI chips to partial write
However, wrap the write functions in a compat layer to allow converting the rest of flashrom later. Tested on Intel NM10 by David Hendricks. Corresponding to flashrom svn r1080. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Diffstat (limited to 'ft2232_spi.c')
-rw-r--r--ft2232_spi.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 1dd2e0ccf..ee8515f18 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -288,20 +288,10 @@ int ft2232_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len)
return spi_read_chunked(flash, buf, start, len, 64 * 1024);
}
-int ft2232_spi_write_256(struct flashchip *flash, uint8_t *buf)
+int ft2232_spi_write_256(struct flashchip *flash, uint8_t *buf, int start, int len)
{
- int total_size = 1024 * flash->total_size;
-
spi_disable_blockprotect();
- /* Erase first. */
- msg_pinfo("Erasing flash before programming... ");
- if (erase_flash(flash)) {
- msg_perr("ERASE FAILED!\n");
- return -1;
- }
- msg_pinfo("done.\n");
- msg_pdbg("total_size is %d\n", total_size);
- return spi_write_chunked(flash, buf, 0, total_size, 256);
+ return spi_write_chunked(flash, buf, start, len, 256);
}
#endif