See patch.
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.

Signed-off-by: Stefan Reinauer <[email protected]>

Index: flashrom.c
===================================================================
--- flashrom.c	(revision 1250)
+++ flashrom.c	(working copy)
@@ -604,6 +604,23 @@
 	programmer_table[programmer].delay(usecs);
 }
 
+char *programmer_extension_to_text(struct flashchip *flash)
+{
+	unsigned long base;
+	uint32_t size;
+
+	static char extension[64];
+	memset(extension, 0, 64);
+
+	size = flash->total_size * 1024;
+	base = flashbase ? flashbase : (0xffffffff - size + 1);
+
+	if (programmer_table[programmer].map_flash_region == physmap) {
+		snprintf(extension, sizeof(extension), " at physical address 0x%lx", base);
+	}
+	return extension;
+}
+
 void map_flash_registers(struct flashchip *flash)
 {
 	size_t size = flash->total_size * 1024;
@@ -1178,10 +1195,11 @@
 	if (!flash || !flash->name)
 		return NULL;
 
-	msg_cinfo("%s chip \"%s %s\" (%d KB, %s) at physical address 0x%lx.\n",
+	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),
+	       programmer_extension_to_text(flash));
 
 	/* Flash registers will not be mapped if the chip was forced. Lock info
 	 * may be stored in registers, so avoid lock info printing.
_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to