[coreboot] [commit] r6174 - in trunk/src: include lib mainboard/asus/m2v mainboard/asus/m2v-mx_se mainboard/getac/p470 mainboard/ibase/mb899 mainboard/intel/d945gclf mainboard/kontron/986lcd-m mainboard/roda/...

repository service svn at coreboot.org
Mon Dec 13 21:02:26 CET 2010


Author: ruik
Date: Mon Dec 13 21:02:23 2010
New Revision: 6174
URL: https://tracker.coreboot.org/trac/coreboot/changeset/6174

Log:
Compile cbmem.c instead of including it in romstage,
and do that only if resume is done.

Signed-off-by: Rudolf Marek <r.marek at assembler.cz>
Acked-by: Patrick Georgi <patrick at georgi-clan.de>

Modified:
   trunk/src/include/cbmem.h
   trunk/src/lib/Makefile.inc
   trunk/src/lib/cbmem.c
   trunk/src/mainboard/asus/m2v-mx_se/romstage.c
   trunk/src/mainboard/asus/m2v/romstage.c
   trunk/src/mainboard/getac/p470/romstage.c
   trunk/src/mainboard/ibase/mb899/romstage.c
   trunk/src/mainboard/intel/d945gclf/romstage.c
   trunk/src/mainboard/kontron/986lcd-m/romstage.c
   trunk/src/mainboard/roda/rk886ex/romstage.c

Modified: trunk/src/include/cbmem.h
==============================================================================
--- trunk/src/include/cbmem.h	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/include/cbmem.h	Mon Dec 13 21:02:23 2010	(r6174)
@@ -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

Modified: trunk/src/lib/Makefile.inc
==============================================================================
--- trunk/src/lib/Makefile.inc	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/lib/Makefile.inc	Mon Dec 13 21:02:23 2010	(r6174)
@@ -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

Modified: trunk/src/lib/cbmem.c
==============================================================================
--- trunk/src/lib/cbmem.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/lib/cbmem.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -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
 

Modified: trunk/src/mainboard/asus/m2v-mx_se/romstage.c
==============================================================================
--- trunk/src/mainboard/asus/m2v-mx_se/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/asus/m2v-mx_se/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -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)
 {

Modified: trunk/src/mainboard/asus/m2v/romstage.c
==============================================================================
--- trunk/src/mainboard/asus/m2v/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/asus/m2v/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -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"
 

Modified: trunk/src/mainboard/getac/p470/romstage.c
==============================================================================
--- trunk/src/mainboard/getac/p470/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/getac/p470/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -262,14 +262,6 @@
 
 #include <cbmem.h>
 
-// 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;

Modified: trunk/src/mainboard/ibase/mb899/romstage.c
==============================================================================
--- trunk/src/mainboard/ibase/mb899/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/ibase/mb899/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -225,14 +225,6 @@
 
 #include <cbmem.h>
 
-// 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;

Modified: trunk/src/mainboard/intel/d945gclf/romstage.c
==============================================================================
--- trunk/src/mainboard/intel/d945gclf/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/intel/d945gclf/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -186,14 +186,6 @@
 
 #include <cbmem.h>
 
-// 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;

Modified: trunk/src/mainboard/kontron/986lcd-m/romstage.c
==============================================================================
--- trunk/src/mainboard/kontron/986lcd-m/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/kontron/986lcd-m/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -314,14 +314,6 @@
 
 #include <cbmem.h>
 
-// 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;

Modified: trunk/src/mainboard/roda/rk886ex/romstage.c
==============================================================================
--- trunk/src/mainboard/roda/rk886ex/romstage.c	Mon Dec 13 20:59:13 2010	(r6173)
+++ trunk/src/mainboard/roda/rk886ex/romstage.c	Mon Dec 13 21:02:23 2010	(r6174)
@@ -235,14 +235,6 @@
 
 #include <cbmem.h>
 
-// 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;




More information about the coreboot mailing list