diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-10-11 22:08:02 +0300 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-10-14 17:16:22 +0200 |
commit | f8bf5a10c599ef071998bbc3f16e9e3d7fcdb6eb (patch) | |
tree | 3366c799fd1f4a3b68598357d5f6288a22d5b37f /src/lib | |
parent | cf18c856aafaaa2a7e5eaebf64a2d5c647e590e8 (diff) |
Revert "CBMEM: Always have early initialisation"
This reverts commit de1fe7f655c549e8dce5b34218221890fa5ccc34.
While things appeared to work, there were actually invalid references
to CAR storage after CAR was torn down on boards without
EARLY_CBMEM_INIT. It was discussed use of CAR_GLOBAL should be
restricted to boards that handle CAR migration properly.
Change-Id: I9969d2ea79c334a7f95a0dbb7c78065720e6ccae
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/3968
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Makefile.inc | 5 | ||||
-rw-r--r-- | src/lib/cbmem.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc index 1455e4cdd3..6110b88124 100644 --- a/src/lib/Makefile.inc +++ b/src/lib/Makefile.inc @@ -50,7 +50,7 @@ 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 @@ -108,7 +108,8 @@ ramstage-y += dynamic_cbmem.c romstage-y += dynamic_cbmem.c else ramstage-y += cbmem.c -romstage-$(CONFIG_CACHE_AS_RAM) += 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 diff --git a/src/lib/cbmem.c b/src/lib/cbmem.c index 8a39647dd1..de49816b03 100644 --- a/src/lib/cbmem.c +++ b/src/lib/cbmem.c @@ -95,6 +95,7 @@ void cbmem_late_set_table(uint64_t base, uint64_t size) * - suspend/resume backup memory */ +#if CONFIG_EARLY_CBMEM_INIT || !defined(__PRE_RAM__) static void cbmem_init(void) { uint64_t baseaddr, size; @@ -119,6 +120,7 @@ static void cbmem_init(void) .size = size - CBMEM_TOC_RESERVED }; } +#endif int cbmem_reinit(void) { @@ -218,6 +220,7 @@ void *cbmem_find(u32 id) return (void *)NULL; } +#if CONFIG_EARLY_CBMEM_INIT || !defined(__PRE_RAM__) /* Returns True if it was not initialized before. */ int cbmem_initialize(void) { @@ -241,6 +244,7 @@ int cbmem_initialize(void) return rv; } +#endif #ifndef __PRE_RAM__ static void init_cbmem_post_device(void *unused) |