Accoring to PCH documentation crossing 256-byte boundary is invalid and causes wraparound. Please apply attached patch
Index: ichspi.c
===================================================================
--- ichspi.c (revision 1764)
+++ ichspi.c (working copy)
@@ -1272,6 +1272,7 @@
}
msg_pdbg("Erasing %d bytes starting at 0x%06x.\n", len, addr);
+ ich_hwseq_set_addr(addr);
/* make sure FDONE, FCERR, AEL are cleared by writing 1 to them */
REGWRITE16(ICH9_REG_HSFS, REGREAD16(ICH9_REG_HSFS));
@@ -1308,6 +1309,9 @@
while (len > 0) {
block_len = min(len, flash->pgm->opaque.max_data_read);
+ if (block_len > (~addr & 0xff))
+ block_len = (~addr & 0xff) + 1;
+
ich_hwseq_set_addr(addr);
hsfc = REGREAD16(ICH9_REG_HSFC);
hsfc &= ~HSFC_FCYCLE; /* set read operation */
@@ -1347,6 +1351,8 @@
while (len > 0) {
ich_hwseq_set_addr(addr);
block_len = min(len, flash->pgm->opaque.max_data_write);
+ if (block_len > (~addr & 0xff))
+ block_len = (~addr & 0xff) + 1;
ich_fill_data(buf, block_len, ICH9_REG_FDATA0);
hsfc = REGREAD16(ICH9_REG_HSFC);
hsfc &= ~HSFC_FCYCLE; /* clear operation */
signature.asc
Description: OpenPGP digital signature
_______________________________________________ flashrom mailing list [email protected] http://www.flashrom.org/mailman/listinfo/flashrom
