Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: ichspi.c

Issue 6698020: ichspi.c: lower down the ICH7 chipset CDS timeout from 60s to 1ms. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/flashrom.git@master
Patch Set: increase timeout to 30s for full erase. a early exit if error appears. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ichspi.c
diff --git a/ichspi.c b/ichspi.c
index df0c57793179a7bc976692b5b243aff56ed13f59..6e1ef05cd884580366c66f2da19e9d93c4199d36 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -570,13 +570,18 @@ static int ich7_run_opcode(OPCODE op, uint32_t offset,
/* write it */
REGWRITE16(ICH7_REG_SPIC, temp16);
- /* wait for cycle complete */
- timeout = 100 * 1000 * 60; // 60s is a looong timeout.
+ /* Original timeout is 60 minutes, which is too excessive.
+ * Reduce to 30 secs for chip full erase (around 10 secs).
+ * We also exit the loop if the error bit is set.
+ */
+ timeout = 100 * 1000 * 30;
while (((REGREAD16(ICH7_REG_SPIS) & SPIS_CDS) == 0) && --timeout) {
programmer_delay(10);
+ if (REGREAD16(ICH7_REG_SPIS) & SPIS_FCERR)
+ break; /* Transaction error */
}
if (!timeout) {
- msg_perr("timeout\n");
+ msg_perr("ICH7 CDS timeout\n");
}
/* FIXME: make sure we do not needlessly cause transaction errors. */
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698