summaryrefslogtreecommitdiff
path: root/wbsio_spi.c
diff options
context:
space:
mode:
authorhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-03-01 22:38:27 +0000
committerhailfinger <hailfinger@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2012-03-01 22:38:27 +0000
commit8a65bed843377582ce27a841c6cb84b7d9081e96 (patch)
treed2ddcfc5b5c2f1e4f212280c7aa81f9ac2d42d96 /wbsio_spi.c
parent6cd4985732d6a70adef4a4b135547fcf02525324 (diff)
downloadflashrom-8a65bed843377582ce27a841c6cb84b7d9081e96.tar.gz
Fix parallel-style programmer access from ITE IT87/Winbond W83627 SPI
The ITE IT87 SPI driver uses a trick to speed up reading and writing: If a flash chip is 512 kByte or less, the flash chip can be completely mapped in memory and both read and write accesses are faster that way. The current IT87 SPI code did use the parallel programmer interface for memory mapped reads and writes, but that's the wrong abstraction. It has been fixed to use mmio_read*/mmio_write* for that purpose. The Winbond W83627 SPI driver uses the same trick in its read path for all supported chip sizes. Fix it the same way. Switch internal_chip_readn to use mmio_readn as proper abstraction. Kudos to Michael Karcher for spotting the bugs. Reported-by: Johan Svensson <flashrom.js@crypt.se> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Tested-by: Johan Svensson <flashrom.js@crypt.se> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1511 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'wbsio_spi.c')
-rw-r--r--wbsio_spi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/wbsio_spi.c b/wbsio_spi.c
index 740a48c..774890e 100644
--- a/wbsio_spi.c
+++ b/wbsio_spi.c
@@ -202,7 +202,8 @@ static int wbsio_spi_send_command(struct flashctx *flash, unsigned int writecnt,
static int wbsio_spi_read(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len)
{
- return read_memmapped(flash, buf, start, len);
+ mmio_readn((void *)(flash->virtual_memory + start), buf, len);
+ return 0;
}
#endif