On Sat, Jun 28, 2008 at 06:38:01PM +0200, Peter Stuge wrote:
> Unfortunately this patch broke flashrom on ICH7 not using SPI for
> at least one user as reported on IRC just now. :(
..
> I asked the reporter to send a message to flashrom@ and I got a
> promise about testing patches to fix the problem. :)

I had an idea. The attached patch fixes flashrom 3393 on non-SPI ICH7
at least for the reporter.

The second hunk is needed for me to be able to compile flashrom with
gcc 4.2.2. That should teach me to build test before I ack. Also
there seems to be a bit of whitespace damage in the 3393 patch.


//Peter
flashrom: Fix ICH7 non-SPI that broke in r3393

r3393 assumed that ICH7 always used SPI. This patch resets ich7_detected back
to 0 when BOOT BIOS Straps indicate something else than SPI.

Also fixes a build error in ichspi.c with gcc 4.2.2.

Signed-off-by: Peter Stuge <[EMAIL PROTECTED]>

Index: chipset_enable.c
===================================================================
--- chipset_enable.c	(revision 3393)
+++ chipset_enable.c	(working copy)
@@ -212,6 +212,8 @@
 	bbs = (gcs >> 10) & 0x3;
 	printf_debug("BOOT BIOS Straps: 0x%x (%s)\n",	bbs,
 		     (bbs == 0x3) ? "LPC" : ((bbs == 0x2) ? "PCI" : "SPI"));
+	if (bbs >= 2)
+		ich7_detected = 0;
 
 	buc = *(volatile uint8_t *)(rcrb + 0x3414);
 	printf_debug("Top Swap : %s\n", (buc & 1)?"enabled (A16 inverted)":"not enabled");
Index: ichspi.c
===================================================================
--- ichspi.c	(revision 3393)
+++ ichspi.c	(working copy)
@@ -229,7 +229,7 @@
 {
 	int write_cmd = 0;
 	int timeout;
-	uint32_t temp32;
+	uint32_t temp32 = 0;
 	uint16_t temp16;
 	uint32_t a;
 
-- 
coreboot mailing list
[email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to