summaryrefslogtreecommitdiffstats
path: root/ichspi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-06-16 08:55:44 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-06-16 08:55:44 +0000
commit6253d81ae44a70cb42a9a2ac69f03370c1d0ddf6 (patch)
tree29b0a806979474c3d8dcbc6acfa7022728ca4a15 /ichspi.c
parent6da199a7c3dda06aeffcf05b50afd1d8a7ae874a (diff)
downloadflashrom-6253d81ae44a70cb42a9a2ac69f03370c1d0ddf6.zip
flashrom-6253d81ae44a70cb42a9a2ac69f03370c1d0ddf6.tar.gz
This patch gives us arbitrary range reads at byte boundaries for every single chip supported by flashrom
That means you can tell flashrom to read exactly bytes 12345-56789 (start 12345, length 44445) and it will not fetch a single byte more. Uwe tested this on one LPC, one SPI, and one parallel flash board. Corresponding to flashrom svn r596. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
Diffstat (limited to 'ichspi.c')
-rw-r--r--ichspi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ichspi.c b/ichspi.c
index e3fb740..9091230 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -647,14 +647,14 @@ static int ich_spi_write_page(struct flashchip *flash, uint8_t * bytes,
return 0;
}
-int ich_spi_read(struct flashchip *flash, uint8_t * buf)
+int ich_spi_read(struct flashchip *flash, uint8_t * buf, int start, int len)
{
int maxdata = 64;
if (spi_controller == SPI_CONTROLLER_VIA)
maxdata = 16;
- return spi_read_chunked(flash, buf, maxdata);
+ return spi_read_chunked(flash, buf, start, len, maxdata);
}
int ich_spi_write_256(struct flashchip *flash, uint8_t * buf)
OpenPOWER on IntegriCloud