From 9a795d83fbb8842a271d5e037dc983a57b0419fd Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Wed, 14 Jul 2010 16:19:05 +0000 Subject: 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 Acked-by: Michael Karcher --- buspirate_spi.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'buspirate_spi.c') 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); } -- cgit v1.1