summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2010-12-13 20:02:23 +0000
committerRudolf Marek <r.marek@assembler.cz>2010-12-13 20:02:23 +0000
commit475916ddbfb0ba9fed7f17a2613736551912e3f9 (patch)
tree1d902f5800e485eed450a3a00459f4256db77bae /src
parentc4369536da601a02b23cb936c16e54c0485ec21e (diff)
downloadcoreboot-475916ddbfb0ba9fed7f17a2613736551912e3f9.tar.xz
Compile cbmem.c instead of including it in romstage,
and do that only if resume is done. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6174 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src')
-rw-r--r--src/include/cbmem.h3
-rw-r--r--src/lib/Makefile.inc1
-rw-r--r--src/lib/cbmem.c7
-rw-r--r--src/mainboard/asus/m2v-mx_se/romstage.c9
-rw-r--r--src/mainboard/asus/m2v/romstage.c9
-rw-r--r--src/mainboard/getac/p470/romstage.c8
-rw-r--r--src/mainboard/ibase/mb899/romstage.c8
-rw-r--r--src/mainboard/intel/d945gclf/romstage.c8
-rw-r--r--src/mainboard/kontron/986lcd-m/romstage.c8
-rw-r--r--src/mainboard/roda/rk886ex/romstage.c8
10 files changed, 10 insertions, 59 deletions
diff --git a/src/include/cbmem.h b/src/include/cbmem.h
index 5fd2e78aff..d9ec93c60c 100644
--- a/src/include/cbmem.h
+++ b/src/include/cbmem.h
@@ -49,8 +49,9 @@ void *cbmem_find(u32 id);
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
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index ed52ea940c..d5e76ade1d 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -15,6 +15,7 @@ ramstage-y += lzma.c
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
diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c
index c758240d64..5417ab8c49 100644
--- a/src/lib/cbmem.c
+++ b/src/lib/cbmem.c
@@ -48,6 +48,13 @@ void __attribute__((weak)) set_cbmem_toc(struct cbmem_entry * x)
{
/* 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
diff --git a/src/mainboard/asus/m2v-mx_se/romstage.c b/src/mainboard/asus/m2v-mx_se/romstage.c
index 4a147229e7..476f8860f4 100644
--- a/src/mainboard/asus/m2v-mx_se/romstage.c
+++ b/src/mainboard/asus/m2v-mx_se/romstage.c
@@ -74,15 +74,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
#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)
{
diff --git a/src/mainboard/asus/m2v/romstage.c b/src/mainboard/asus/m2v/romstage.c
index 3945f34f1f..7c224632e1 100644
--- a/src/mainboard/asus/m2v/romstage.c
+++ b/src/mainboard/asus/m2v/romstage.c
@@ -73,15 +73,6 @@ static inline int spd_read_byte(unsigned device, unsigned address)
#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"
diff --git a/src/mainboard/getac/p470/romstage.c b/src/mainboard/getac/p470/romstage.c
index affc36a542..ac71a6b256 100644
--- a/src/mainboard/getac/p470/romstage.c
+++ b/src/mainboard/getac/p470/romstage.c
@@ -262,14 +262,6 @@ static void early_ich7_init(void)
#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;
diff --git a/src/mainboard/ibase/mb899/romstage.c b/src/mainboard/ibase/mb899/romstage.c
index 15a735e9fa..d3a029961a 100644
--- a/src/mainboard/ibase/mb899/romstage.c
+++ b/src/mainboard/ibase/mb899/romstage.c
@@ -225,14 +225,6 @@ static void early_ich7_init(void)
#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;
diff --git a/src/mainboard/intel/d945gclf/romstage.c b/src/mainboard/intel/d945gclf/romstage.c
index e47f08c3c2..f7056737dc 100644
--- a/src/mainboard/intel/d945gclf/romstage.c
+++ b/src/mainboard/intel/d945gclf/romstage.c
@@ -186,14 +186,6 @@ static void early_ich7_init(void)
#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;
diff --git a/src/mainboard/kontron/986lcd-m/romstage.c b/src/mainboard/kontron/986lcd-m/romstage.c
index 0b93259ba2..5d773ce636 100644
--- a/src/mainboard/kontron/986lcd-m/romstage.c
+++ b/src/mainboard/kontron/986lcd-m/romstage.c
@@ -314,14 +314,6 @@ static void early_ich7_init(void)
#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;
diff --git a/src/mainboard/roda/rk886ex/romstage.c b/src/mainboard/roda/rk886ex/romstage.c
index 85d163baf8..80afe80745 100644
--- a/src/mainboard/roda/rk886ex/romstage.c
+++ b/src/mainboard/roda/rk886ex/romstage.c
@@ -235,14 +235,6 @@ static void init_artec_dongle(void)
#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;