summaryrefslogtreecommitdiff
path: root/wbsio_spi.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-07-14 16:19:05 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2010-07-14 16:19:05 +0000
commit395dd1d1e2d37d90416e6d296a5f1f79bb320842 (patch)
treea9049f708d0ab7d42d122fecd23855aaa819c5bc /wbsio_spi.c
parente8db2112db803b2c94a9fb55b136ebebda08c1ce (diff)
downloadflashrom-395dd1d1e2d37d90416e6d296a5f1f79bb320842.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. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1080 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'wbsio_spi.c')
-rw-r--r--wbsio_spi.c8
1 files changed, 3 insertions, 5 deletions
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