From e1ea802ea69b70826b997b9bb465e0b2a3b0fce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Wed, 4 Sep 2013 14:11:08 +0300 Subject: CBMEM tables: Remove references to global high_tables_base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Unify checks and writing of CBMEM tables for x86 and ARMv7. Change-Id: I89c012bce1b86d0710748719a8840ec532ce6939 Signed-off-by: Kyösti Mälkki Reviewed-on: http://review.coreboot.org/3559 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Aaron Durbin --- src/lib/cbmem.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/lib/cbmem.c') diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c index 206fdbf887..32a46140ce 100644 --- a/src/lib/cbmem.c +++ b/src/lib/cbmem.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #if CONFIG_HAVE_ACPI_RESUME && !defined(__PRE_RAM__) @@ -260,6 +261,22 @@ BOOT_STATE_INIT_ENTRIES(cbmem_bscb) = { init_cbmem_post_device, NULL), }; +int cbmem_base_check(void) +{ + if (!high_tables_base) { + printk(BIOS_ERR, "ERROR: CBMEM Base is not set.\n"); + // Are there any boards without? + // Stepan thinks we should die() here! + } + printk(BIOS_DEBUG, "CBMEM Base is %llx.\n", high_tables_base); + return !!high_tables_base; +} + +void cbmem_add_lb_mem(struct lb_memory *mem) +{ + lb_add_memory_range(mem, LB_MEM_TABLE, high_tables_base, high_tables_size); +} + void cbmem_list(void) { struct cbmem_entry *cbmem_toc; -- cgit v1.2.3