From patchwork Sun Dec 12 00:08:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: compile cbmem.c instead of including it in romstage Date: Sun, 12 Dec 2010 00:08:32 -0000 From: Rudolf Marek X-Patchwork-Id: 2423 Message-Id: <4D041280.2020201@assembler.cz> To: coreboot@coreboot.org Yes I fixed the message. Thanks, Rudolf Acked-by: Patrick Georgi Index: coreboot/src/include/cbmem.h =================================================================== --- coreboot.orig/src/include/cbmem.h 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/include/cbmem.h 2010-12-12 01:07:11.000000000 +0100 @@ -49,8 +49,9 @@ void cbmem_list(void); void cbmem_arch_init(void); +extern struct cbmem_entry *get_cbmem_toc(void); + #ifndef __PRE_RAM__ -struct cbmem_entry *get_cbmem_toc(void); void set_cbmem_toc(struct cbmem_entry *); #endif #endif Index: coreboot/src/lib/Makefile.inc =================================================================== --- coreboot.orig/src/lib/Makefile.inc 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/lib/Makefile.inc 2010-12-12 01:07:11.000000000 +0100 @@ -15,6 +15,7 @@ ramstage-y += gcc.c ramstage-y += cbmem.c +romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c romstage-y += uart8250.c romstage-y += memset.c romstage-y += memcpy.c Index: coreboot/src/lib/cbmem.c =================================================================== --- coreboot.orig/src/lib/cbmem.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/lib/cbmem.c 2010-12-12 01:07:46.000000000 +0100 @@ -48,6 +48,13 @@ { /* do nothing, this should be called by chipset to save TOC in NVRAM */ } +#else + +struct cbmem_entry *__attribute__((weak)) get_cbmem_toc(void) +{ + printk(BIOS_WARNING, "WARNING: you need to define get_cbmem_toc() for your chipset\n"); + return NULL; +} #endif Index: coreboot/src/mainboard/asus/m2v-mx_se/romstage.c =================================================================== --- coreboot.orig/src/mainboard/asus/m2v-mx_se/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/asus/m2v-mx_se/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -74,15 +74,6 @@ #define SB_VFSMAF 0 - -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM__ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - /* this function might fail on some K8 CPUs with errata #181 */ static void ldtstop_sb(void) { Index: coreboot/src/mainboard/asus/m2v/romstage.c =================================================================== --- coreboot.orig/src/mainboard/asus/m2v/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/asus/m2v/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -73,15 +73,6 @@ #include "cpu/amd/dualcore/dualcore.c" #include "cpu/amd/car/post_cache_as_ram.c" #include "cpu/amd/model_fxx/init_cpus.c" - -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM__ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - #include "cpu/amd/model_fxx/fidvid.c" #include "northbridge/amd/amdk8/resourcemap.c" Index: coreboot/src/mainboard/getac/p470/romstage.c =================================================================== --- coreboot.orig/src/mainboard/getac/p470/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/getac/p470/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -262,14 +262,6 @@ #include -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM_ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - void main(unsigned long bist) { u32 reg32; Index: coreboot/src/mainboard/ibase/mb899/romstage.c =================================================================== --- coreboot.orig/src/mainboard/ibase/mb899/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/ibase/mb899/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -225,14 +225,6 @@ #include -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM__ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - void main(unsigned long bist) { u32 reg32; Index: coreboot/src/mainboard/intel/d945gclf/romstage.c =================================================================== --- coreboot.orig/src/mainboard/intel/d945gclf/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/intel/d945gclf/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -186,14 +186,6 @@ #include -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM__ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - void main(unsigned long bist) { u32 reg32; Index: coreboot/src/mainboard/kontron/986lcd-m/romstage.c =================================================================== --- coreboot.orig/src/mainboard/kontron/986lcd-m/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/kontron/986lcd-m/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -314,14 +314,6 @@ #include -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM__ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - void main(unsigned long bist) { u32 reg32; Index: coreboot/src/mainboard/roda/rk886ex/romstage.c =================================================================== --- coreboot.orig/src/mainboard/roda/rk886ex/romstage.c 2010-12-12 01:07:08.000000000 +0100 +++ coreboot/src/mainboard/roda/rk886ex/romstage.c 2010-12-12 01:07:11.000000000 +0100 @@ -235,14 +235,6 @@ #include -// Now, this needs to be included because it relies on the symbol -// __PRE_RAM__ being set during CAR stage (in order to compile the -// BSS free versions of the functions). Either rewrite the code -// to be always BSS free, or invent a flag that's better suited than -// __PRE_RAM__ to determine whether we're in ram init stage (stage 1) -// -#include "lib/cbmem.c" - void main(unsigned long bist) { u32 reg32;