[coreboot-gerrit] Patch set updated for coreboot: FMAP: Clean up debug output

Patrick Georgi (pgeorgi@google.com) gerrit at coreboot.org
Fri Feb 12 19:55:54 CET 2016


Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13695

-gerrit

commit ca5ae7c4475e01e9a0fe13c8c32f648d4527f32d
Author: Duncan Laurie <dlaurie at chromium.org>
Date:   Tue Feb 9 09:17:56 2016 -0800

    FMAP: Clean up debug output
    
    Reduce the debug output from FMAP lookups.  When we had one or
    two FMAP lookups in a boot this was not a big deal, but now that
    we do many lookups it is a lot of unnecessary output duplication.
    
    This change reduces these 3 lines:
    
    FMAP: area VBLOCK_A found
    FMAP:   offset: 200000
    FMAP:   size:   65536 bytes
    
    To just one line:
    
    FMAP: area VBLOCK_A found @ 200000 (65536 bytes)
    
    And makes the header output only print once:
    
    FMAP: Found "FMAP" version 1.0 at c10000.
    FMAP: base = 0 size = 1000000 #areas = 29
    
    BUG=chrome-os-partner:40635
    BRANCH=glados
    TEST=boot on chell and enjoy non-truncated memconsole
    
    Change-Id: Ib5862b8bfad113a700faae89089557094aa6d499
    Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
    Original-Commit-Id: 6890f36536d4ae6fc4988fc8191b0cff4e33e2e6
    Original-Change-Id: Ifefee1ab26e6ee406de552880fbbd5b7916fcadd
    Original-Signed-off-by: Duncan Laurie <dlaurie at chromium.org>
    Original-Reviewed-on: https://chromium-review.googlesource.com/326887
    Original-Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
 src/lib/fmap.c | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/lib/fmap.c b/src/lib/fmap.c
index 028bc25..54e54ba 100644
--- a/src/lib/fmap.c
+++ b/src/lib/fmap.c
@@ -13,6 +13,7 @@
  * GNU General Public License for more details.
  */
 
+#include <arch/early_variables.h>
 #include <boot_device.h>
 #include <console/console.h>
 #include <fmap.h>
@@ -24,6 +25,8 @@
  * See http://code.google.com/p/flashmap/ for more information on FMAP.
  */
 
+static int fmap_print_once CAR_GLOBAL;
+
 int find_fmap_directory(struct region_device *fmrd)
 {
 	const struct region_device *boot;
@@ -50,10 +53,13 @@ int find_fmap_directory(struct region_device *fmrd)
 		return -1;
 	}
 
-	printk(BIOS_DEBUG, "FMAP: Found \"%s\" version %d.%d at %zx.\n",
-	       fmap->name, fmap->ver_major, fmap->ver_minor, offset);
-	printk(BIOS_DEBUG, "FMAP: base = %llx size = %x #areas = %d\n",
-	       (long long)fmap->base, fmap->size, fmap->nareas);
+	if (!car_get_var(fmap_print_once)) {
+		printk(BIOS_DEBUG, "FMAP: Found \"%s\" version %d.%d at %zx.\n",
+		       fmap->name, fmap->ver_major, fmap->ver_minor, offset);
+		printk(BIOS_DEBUG, "FMAP: base = %llx size = %x #areas = %d\n",
+		       (long long)fmap->base, fmap->size, fmap->nareas);
+		car_set_var(fmap_print_once, 1);
+	}
 
 	fmap_size += fmap->nareas * sizeof(struct fmap_area);
 
@@ -97,9 +103,8 @@ int fmap_locate_area(const char *name, struct region *ar)
 			continue;
 		}
 
-		printk(BIOS_DEBUG, "FMAP: area %s found\n", name);
-		printk(BIOS_DEBUG, "FMAP:   offset: %x\n", area->offset);
-		printk(BIOS_DEBUG, "FMAP:   size:   %d bytes\n", area->size);
+		printk(BIOS_DEBUG, "FMAP: area %s found @ %x (%d bytes)\n",
+		       name, area->offset, area->size);
 
 		ar->offset = area->offset;
 		ar->size = area->size;



More information about the coreboot-gerrit mailing list