[coreboot] [PATCH] flashrom: Fix Elan SC520 handling

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Sat May 9 05:27:00 CEST 2009

Fix Elan SC520 handling.

flashbase is a variable which should never be set outside chipset code.
It is only used to calculate the base address of the flash space at
exactly one location in the code.

Setting flashbase during probe caused subsequent probes to fail unless
special handling code was used. We had such code and it caused every
probe except the first to fail on Elan SC520.

Remove the superfluous flashbase assignment and simplify the rest of the

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>

Index: flashrom-flashbase/flashrom.c
--- flashrom-flashbase/flashrom.c	(Revision 486)
+++ flashrom-flashbase/flashrom.c	(Arbeitskopie)
@@ -113,7 +113,7 @@
 			size = getpagesize();
-		base = flashbase && flashchips == first_flash ? flashbase : (0xffffffff - size + 1);
+		base = flashbase ? flashbase : (0xffffffff - size + 1);
 		flash->virtual_memory = bios = physmap("flash chip", base, size);
 		if (force)
@@ -135,7 +135,6 @@
 	printf("Found chip \"%s %s\" (%d KB) at physical address 0x%lx.\n",
 	       flash->vendor, flash->name, flash->total_size, base);
-	flashbase = base;
 	return flash;


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: flashrom_flashbase.diff
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20090509/98117dd8/attachment.ksh>

More information about the coreboot mailing list