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 --- wbsio_spi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'wbsio_spi.c') diff --git a/wbsio_spi.c b/wbsio_spi.c index ca7bd01..8db6524 100644 --- a/wbsio_spi.c +++ b/wbsio_spi.c @@ -189,16 +189,14 @@ int wbsio_spi_read(struct flashchip *flash, uint8_t *buf, int start, int len) return read_memmapped(flash, buf, start, len); } -int wbsio_spi_write_1(struct flashchip *flash, uint8_t *buf) +int wbsio_spi_write_1(struct flashchip *flash, uint8_t *buf, int start, int len) { - int size = flash->total_size * 1024; - - if (size > 1024 * 1024) { + if (flash->total_size * 1024 > 1024 * 1024) { msg_perr("%s: Winbond saved on 4 register bits so max chip size is 1024 KB!\n", __func__); return 1; } - return spi_chip_write_1(flash, buf); + return spi_chip_write_1_new(flash, buf, start, len); } #endif -- cgit v1.1