From ccd71c21222cd73c55284265d306d52e88d8c6c8 Mon Sep 17 00:00:00 2001 From: Carl-Daniel Hailfinger Date: Thu, 1 Mar 2012 22:38:27 +0000 Subject: 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. Tested-by: Johan Svensson Corresponding to flashrom svn r1511. Reported-by: Johan Svensson Signed-off-by: Carl-Daniel Hailfinger Acked-by: Michael Karcher --- internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'internal.c') diff --git a/internal.c b/internal.c index 5716e64..479cbf7 100644 --- a/internal.c +++ b/internal.c @@ -387,6 +387,6 @@ static uint32_t internal_chip_readl(const struct flashctx *flash, static void internal_chip_readn(const struct flashctx *flash, uint8_t *buf, const chipaddr addr, size_t len) { - memcpy(buf, (void *)addr, len); + mmio_readn((void *)addr, buf, len); return; } -- cgit v1.1