Fix broken flash chip base address logic
Elan SC520 requries us to deal with flash chip base addresses at locations
other than top of 4GB. The logic for that was incorrectly triggered also when
a board had more than one flash chip. This patch will honor flashbase only when
probing for the first flash chip on the board, and look at top of 4GB for later
chips.
Corresponding to flashrom svn r415 and coreboot v2 svn r3932.
Signed-off-by: Peter Stuge <peter@stuge.se>
Acked-by: Myles Watson <mylesgw@gmail.com>
diff --git a/flashrom.c b/flashrom.c
index e19f7f2..a47bfa0 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -121,7 +121,7 @@
size = getpagesize();
}
- base = flashbase ? flashbase : (0xffffffff - size + 1);
+ base = flashbase && flashchips == first_flash ? flashbase : (0xffffffff - size + 1);
flash->virtual_memory = bios = physmap("flash chip", base, size);
if (force)