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 <flashrom.js@crypt.se>

Corresponding to flashrom svn r1511.

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>
diff --git a/it87spi.c b/it87spi.c
index f089d78..fa37d52 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -330,7 +330,7 @@
 	OUTB(0x06, it8716f_flashport + 1);
 	OUTB(((2 + (fast_spi ? 1 : 0)) << 4), it8716f_flashport);
 	for (i = 0; i < flash->page_size; i++)
-		chip_writeb(flash, buf[i], bios + start + i);
+		mmio_writeb(buf[i], (void *)(bios + start + i));
 	OUTB(0, it8716f_flashport);
 	/* Wait until the Write-In-Progress bit is cleared.
 	 * This usually takes 1-10 ms, so wait in 1 ms steps.
@@ -356,7 +356,7 @@
 	if ((flash->total_size * 1024 > 512 * 1024)) {
 		spi_read_chunked(flash, buf, start, len, 3);
 	} else {
-		read_memmapped(flash, buf, start, len);
+		mmio_readn((void *)(flash->virtual_memory + start), buf, len);
 	}
 
 	return 0;