[coreboot-gerrit] New patch to review for coreboot: src/lib: Enable display of cbmem during romstage and postcar

Lee Leahy (leroy.p.leahy@intel.com) gerrit at coreboot.org
Mon Jul 25 21:39:12 CEST 2016


Lee Leahy (leroy.p.leahy at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/15842

-gerrit

commit 54e9cb4ec926a80b79b43a4cbaa576fca20e72d6
Author: Lee Leahy <leroy.p.leahy at intel.com>
Date:   Sun Jul 24 19:52:15 2016 -0700

    src/lib: Enable display of cbmem during romstage and postcar
    
    Enable the display of cbmem during romstage and postcar.  Add a Kconfig
    value to prevent coreboot images from increasing in size when this
    feature is not in use.
    
    TEST=Build and run on Galileo Gen2
    
    Change-Id: Ib70ad517ebf7d37a7f46ba503b4432c7c04d7ded
    Signed-off-by: Lee Leahy <leroy.p.leahy at intel.com>
---
 src/Kconfig         | 6 ++++++
 src/lib/imd_cbmem.c | 8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/Kconfig b/src/Kconfig
index 7c1415e..1cc0bfa 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -209,6 +209,12 @@ config NO_XIP_EARLY_STAGES
 config EARLY_CBMEM_INIT
 	def_bool !LATE_CBMEM_INIT
 
+config EARLY_CBMEM_LIST
+	bool
+	default n
+	help
+	  Enable display of CBMEM during romstage and postcar.
+
 config COLLECT_TIMESTAMPS
 	bool "Create a table of timestamps collected during boot"
 	default n
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c
index a078071..3e3e2b0 100644
--- a/src/lib/imd_cbmem.c
+++ b/src/lib/imd_cbmem.c
@@ -279,7 +279,8 @@ void cbmem_add_bootmem(void)
 	bootmem_add_range(base, size, LB_MEM_TABLE);
 }
 
-#if ENV_RAMSTAGE
+#if ENV_RAMSTAGE || (IS_ENABLED(CONFIG_EARLY_CBMEM_LIST) \
+	&& (ENV_POSTCAR || ENV_ROMSTAGE))
 /*
  * -fdata-sections doesn't work so well on read only strings. They all
  * get put in the same section even though those strings may never be
@@ -288,8 +289,11 @@ void cbmem_add_bootmem(void)
 void cbmem_list(void)
 {
 	static const struct imd_lookup lookup[] = { CBMEM_ID_TO_NAME_TABLE };
+	struct imd *imd;
+	struct imd imd_backing;
 
-	imd_print_entries(cbmem_get_imd(), lookup, ARRAY_SIZE(lookup));
+	imd = imd_init_backing_with_recover(&imd_backing);
+	imd_print_entries(imd, lookup, ARRAY_SIZE(lookup));
 }
 #endif
 



More information about the coreboot-gerrit mailing list