diff options
author | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-07-14 16:19:05 +0000 |
---|---|---|
committer | Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> | 2010-07-14 16:19:05 +0000 |
commit | d694e9230646d81289dda15fbf062f0da3f927f2 (patch) | |
tree | a9049f708d0ab7d42d122fecd23855aaa819c5bc /buspirate_spi.c | |
parent | 61bff423a1c1ad865d3042ea511186f1df486501 (diff) | |
download | flashrom-d694e9230646d81289dda15fbf062f0da3f927f2.zip flashrom-d694e9230646d81289dda15fbf062f0da3f927f2.tar.gz |
Convert SPI chips to partial write, but wrap the write functions in a compat layer to allow converting the rest of flashrom later
I actually have patches for most of the remaining conversion, but I wanted
to get this out and reviewed first. 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 'buspirate_spi.c')
-rw-r--r-- | buspirate_spi.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/buspirate_spi.c b/buspirate_spi.c index e0683ec..e93cf1a 100644 --- a/buspirate_spi.c +++ b/buspirate_spi.c @@ -309,18 +309,8 @@ int buspirate_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len return spi_read_chunked(flash, buf, start, len, 12); } -int buspirate_spi_write_256(struct flashchip *flash, uint8_t *buf) +int buspirate_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"); - - return spi_write_chunked(flash, buf, 0, total_size, 12); + return spi_write_chunked(flash, buf, start, len, 12); } |