Kyösti Mälkki (kyosti.malkki@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/3969
-gerrit
commit ce7b6b4f1433a23ae0a551efa63964e6ef86f1f3 Author: Kyösti Mälkki kyosti.malkki@gmail.com Date: Sat Oct 12 00:22:57 2013 +0300
CBMEM: Restrict CAR_GLOBALs to boards with EARLY_CBMEM_INIT
The mechanisms behind CAR_GLOBALs migration only work correctly when romstage succesfully makes the cbmem_initialize() call.
Dummy get_top_of_ram() is removed from romstage to fail already at build-time for cases where cbmem_initialize() could not complete.
Change-Id: I359820fb196ef187b9aa2e8a3e8f658a0550f237 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- src/Kconfig | 1 + src/arch/x86/boot/cbmem.c | 12 ++++++------ src/cpu/x86/Makefile.inc | 2 +- src/lib/Makefile.inc | 7 ++----- 4 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/src/Kconfig b/src/Kconfig index 127887c..4af8002 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -182,6 +182,7 @@ config EARLY_CBMEM_INIT config DYNAMIC_CBMEM bool "The CBMEM space is dynamically grown." default n + select EARLY_CBMEM_INIT help Instead of reserving a static amount of CBMEM space the CBMEM area grows dynamically. CBMEM can be used both in romstage (after diff --git a/src/arch/x86/boot/cbmem.c b/src/arch/x86/boot/cbmem.c index 58ccbca..d8b2e56 100644 --- a/src/arch/x86/boot/cbmem.c +++ b/src/arch/x86/boot/cbmem.c @@ -18,12 +18,6 @@ #include <console/console.h> #include <cbmem.h>
-unsigned long __attribute__((weak)) get_top_of_ram(void) -{ - printk(BIOS_WARNING, "WARNING: you need to define get_top_of_ram() for your chipset\n"); - return 0; -} - #if !CONFIG_DYNAMIC_CBMEM void get_cbmem_table(uint64_t *base, uint64_t *size) { @@ -54,4 +48,10 @@ void set_top_of_ram(uint64_t ramtop) backup_top_of_ram(ramtop); cbmem_late_set_table(ramtop - HIGH_MEMORY_SIZE, HIGH_MEMORY_SIZE); } + +unsigned long __attribute__((weak)) get_top_of_ram(void) +{ + printk(BIOS_WARNING, "WARNING: you need to define get_top_of_ram() for your chipset\n"); + return 0; +} #endif diff --git a/src/cpu/x86/Makefile.inc b/src/cpu/x86/Makefile.inc index 311dcc1..584004d 100644 --- a/src/cpu/x86/Makefile.inc +++ b/src/cpu/x86/Makefile.inc @@ -1 +1 @@ -romstage-$(CONFIG_CACHE_AS_RAM) += car.c +romstage-$(CONFIG_EARLY_CBMEM_INIT) += car.c diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 44b5ebd..6110b88 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -50,16 +50,12 @@ romstage-$(CONFIG_CONSOLE_SERIAL8250MEM) += uart8250mem.c romstage-$(CONFIG_CONSOLE_NE2K) += ne2k.c romstage-$(CONFIG_SPKMODEM) += spkmodem.c
-ifeq ($(CONFIG_CACHE_AS_RAM),y) +ifeq ($(CONFIG_EARLY_CBMEM_INIT),y) romstage-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c romstage-$(CONFIG_CONSOLE_CBMEM) += cbmem_console.c romstage-$(CONFIG_USBDEBUG) += usbdebug.c endif
-ifneq ($(CONFIG_DYNAMIC_CBMEM),y) -romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c -endif - romstage-y += compute_ip_checksum.c ifneq ($(CONFIG_HAVE_ARCH_MEMMOVE),y) romstage-y += memmove.c @@ -112,6 +108,7 @@ ramstage-y += dynamic_cbmem.c romstage-y += dynamic_cbmem.c else ramstage-y += cbmem.c +romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c endif # CONFIG_DYNAMIC_CBMEM ramstage-y += cbmem_info.c