summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-04 09:42:02 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-01-06 17:34:44 +0100
commit4dba06a827af7962c9441a5f6a08f8f9b95224e0 (patch)
tree760ab591f4306a6779c7e54345fa8dd2db8385d5 /src/lib
parent5b353002a96f1cad9be96b14781f391c6d3faeff (diff)
CBMEM: Fix allocation for static CBMEM
CBMEM console buffer size is adjustable in menuconfig, but this would not correctly adjust the overall allocation made for CBMEM. HIGH_MEMORY_SIZE is aligned to 64kB and definitions are moved down in the header file as HIGH_MEMORY_SIZE is not used with DYNAMIC_CBMEM. Try to continue boot even if CBMEM cannot be created. This error would only occur during development of new ports anyways and more log output is better. Change-Id: I4ee2df601b12ab6532ffcae8897775ecaa2fc05f Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/4621 Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins)
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/cbmem.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c
index 6b0cbc8948..6cdf7721c9 100644
--- a/src/lib/cbmem.c
+++ b/src/lib/cbmem.c
@@ -104,13 +104,12 @@ static void cbmem_init(void)
cbmem_locate_table(&baseaddr, &size);
cbmem_trace_location(baseaddr, size, __FUNCTION__);
- cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
-
- if (size < (64 * 1024)) {
- printk(BIOS_DEBUG, "Increase CBMEM size!\n");
- for (;;) ;
+ if (!(baseaddr && size)) {
+ printk(BIOS_CRIT, "Unable to set location for CBMEM.\n");
+ return;
}
+ cbmem_toc = (struct cbmem_entry *)(unsigned long)baseaddr;
memset(cbmem_toc, 0, CBMEM_TOC_RESERVED);
cbmem_toc[0] = (struct cbmem_entry) {