summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorStefan Reinauer <reinauer@google.com>2011-01-19 06:21:54 +0000
committerStefan Reinauer <stefan.reinauer@coreboot.org>2011-01-19 06:21:54 +0000
commit051e2366fbf453aa39ecd826027fbf553a33c3d4 (patch)
treeb9fe7f57647b6a29c8fa016cea0fe1a1e7042768 /flashrom.c
parenta60faab83ef86bcf2884311db07cf13f445d7f47 (diff)
downloadast2050-flashrom-051e2366fbf453aa39ecd826027fbf553a33c3d4.zip
ast2050-flashrom-051e2366fbf453aa39ecd826027fbf553a33c3d4.tar.gz
Avoid printing mapped addresses for programmers that do not map flash chips
Don't print the local memory flash chip address on programmers that don't actually map the flash chip into local memory (like the dediprog) because the value does not make sense there. This version was reworked / rewritten by Mathias Krause to have less "impact" Corresponding to flashrom svn r1253. Signed-off-by: Stefan Reinauer <reinauer@google.com> Acked-by: Mathias Krause <mathias.krause@secunet.com>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/flashrom.c b/flashrom.c
index 938579c..bf1e3e0 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -1127,6 +1127,7 @@ struct flashchip *probe_flash(struct flashchip *first_flash, int force)
{
struct flashchip *flash;
unsigned long base = 0;
+ char location[64];
uint32_t size;
enum chipbustype buses_common;
char *tmp;
@@ -1178,10 +1179,16 @@ notfound:
if (!flash || !flash->name)
return NULL;
- msg_cinfo("%s chip \"%s %s\" (%d KB, %s) at physical address 0x%lx.\n",
+ if (programmer_table[programmer].map_flash_region == physmap) {
+ snprintf(location, sizeof(location), "at physical address 0x%lx", base);
+ } else {
+ snprintf(location, sizeof(location), "on %s", programmer_table[programmer].name);
+ }
+
+ msg_cinfo("%s chip \"%s %s\" (%d KB, %s) %s.\n",
force ? "Assuming" : "Found",
flash->vendor, flash->name, flash->total_size,
- flashbuses_to_text(flash->bustype), base);
+ flashbuses_to_text(flash->bustype), location);
/* Flash registers will not be mapped if the chip was forced. Lock info
* may be stored in registers, so avoid lock info printing.
OpenPOWER on IntegriCloud