summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-10-11 22:08:02 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2013-10-14 17:16:22 +0200
commitf8bf5a10c599ef071998bbc3f16e9e3d7fcdb6eb (patch)
tree3366c799fd1f4a3b68598357d5f6288a22d5b37f /src
parentcf18c856aafaaa2a7e5eaebf64a2d5c647e590e8 (diff)
downloadcoreboot-f8bf5a10c599ef071998bbc3f16e9e3d7fcdb6eb.tar.xz
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')
-rw-r--r--src/Kconfig12
-rw-r--r--src/arch/x86/boot/Makefile.inc3
-rw-r--r--src/console/Kconfig1
-rw-r--r--src/cpu/x86/Makefile.inc3
-rw-r--r--src/lib/Makefile.inc5
-rw-r--r--src/lib/cbmem.c4
-rw-r--r--src/mainboard/emulation/qemu-i440fx/Kconfig1
-rw-r--r--src/mainboard/emulation/qemu-q35/Kconfig1
-rw-r--r--src/mainboard/google/butterfly/Kconfig1
-rw-r--r--src/mainboard/google/link/Kconfig1
-rw-r--r--src/mainboard/google/parrot/Kconfig1
-rw-r--r--src/mainboard/google/stout/romstage.c4
-rw-r--r--src/mainboard/intel/emeraldlake2/Kconfig1
-rw-r--r--src/mainboard/kontron/ktqm77/Kconfig1
-rw-r--r--src/mainboard/lenovo/t60/Kconfig1
-rw-r--r--src/mainboard/lenovo/x60/Kconfig1
-rw-r--r--src/mainboard/samsung/lumpy/Kconfig1
-rw-r--r--src/mainboard/samsung/stumpy/Kconfig1
-rw-r--r--src/mainboard/via/epia-m850/romstage.c2
-rw-r--r--src/northbridge/intel/sandybridge/raminit.c2
20 files changed, 42 insertions, 5 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 1c35fb3188..4af80027cd 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -170,9 +170,19 @@ config INCLUDE_CONFIG_FILE
config 0x8d740 raw 3324
(empty) 0x8e480 null 3610440
+config EARLY_CBMEM_INIT
+ bool
+ default n
+ help
+ Make coreboot initialize the CBMEM structures while running in ROM
+ stage. This is useful when the ROM stage wants to communicate
+ some, for instance, execution timestamps. It needs support in
+ romstage.c and should be enabled by the board's Kconfig.
+
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
@@ -180,7 +190,7 @@ config DYNAMIC_CBMEM
config COLLECT_TIMESTAMPS
bool "Create a table of timestamps collected during boot"
- default n
+ depends on (EARLY_CBMEM_INIT || DYNAMIC_CBMEM)
help
Make coreboot create a table of timer-ID/timer-value pairs to
allow measuring time spent at different phases of the boot process.
diff --git a/src/arch/x86/boot/Makefile.inc b/src/arch/x86/boot/Makefile.inc
index d3a5f2163c..4b4a841b4e 100644
--- a/src/arch/x86/boot/Makefile.inc
+++ b/src/arch/x86/boot/Makefile.inc
@@ -1,4 +1,5 @@
-romstage-y += cbmem.c
+romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c
+romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c
ramstage-y += boot.c
ramstage-$(CONFIG_MULTIBOOT) += multiboot.c
diff --git a/src/console/Kconfig b/src/console/Kconfig
index f415d93c39..9bfb6e9446 100644
--- a/src/console/Kconfig
+++ b/src/console/Kconfig
@@ -274,6 +274,7 @@ config CONSOLE_NE2K_IO_PORT
boundary, qemu needs broader align)
config CONSOLE_CBMEM
+ depends on (EARLY_CBMEM_INIT || DYNAMIC_CBMEM)
bool "Send console output to a CBMEM buffer"
default n
help
diff --git a/src/cpu/x86/Makefile.inc b/src/cpu/x86/Makefile.inc
index 311dcc1d1f..ca755dec5d 100644
--- a/src/cpu/x86/Makefile.inc
+++ b/src/cpu/x86/Makefile.inc
@@ -1 +1,2 @@
-romstage-$(CONFIG_CACHE_AS_RAM) += car.c
+romstage-$(CONFIG_EARLY_CBMEM_INIT) += car.c
+romstage-$(CONFIG_HAVE_ACPI_RESUME) += car.c
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)
diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig
index 2eed55bcd8..b462b8c04b 100644
--- a/src/mainboard/emulation/qemu-i440fx/Kconfig
+++ b/src/mainboard/emulation/qemu-i440fx/Kconfig
@@ -11,6 +11,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_TABLES
select HAVE_ACPI_RESUME
select BOARD_ROMSIZE_KB_256
+ select EARLY_CBMEM_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT
config MAINBOARD_DIR
diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig
index 43bba4697d..9d78bb8bf4 100644
--- a/src/mainboard/emulation/qemu-q35/Kconfig
+++ b/src/mainboard/emulation/qemu-q35/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_TABLES
# select HAVE_ACPI_RESUME
select BOARD_ROMSIZE_KB_256
+ select EARLY_CBMEM_INIT
select MAINBOARD_HAS_NATIVE_VGA_INIT
config MAINBOARD_DIR
diff --git a/src/mainboard/google/butterfly/Kconfig b/src/mainboard/google/butterfly/Kconfig
index d35be8d4cd..e9ad6ef733 100644
--- a/src/mainboard/google/butterfly/Kconfig
+++ b/src/mainboard/google/butterfly/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_SMI_HANDLER
select GFXUMA
select CHROMEOS
+ select EARLY_CBMEM_INIT
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/google/link/Kconfig b/src/mainboard/google/link/Kconfig
index d04059981d..b74c6044f9 100644
--- a/src/mainboard/google/link/Kconfig
+++ b/src/mainboard/google/link/Kconfig
@@ -16,6 +16,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select CHROMEOS
select SERIRQ_CONTINUOUS_MODE
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select EARLY_CBMEM_INIT
select MARK_GRAPHICS_MEM_WRCOMB
config MAINBOARD_DIR
diff --git a/src/mainboard/google/parrot/Kconfig b/src/mainboard/google/parrot/Kconfig
index 1108b13dc7..191e856d19 100644
--- a/src/mainboard/google/parrot/Kconfig
+++ b/src/mainboard/google/parrot/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_SMI_HANDLER
select GFXUMA
select CHROMEOS
+ select EARLY_CBMEM_INIT
# Workaround for EC/KBC IRQ1.
select SERIRQ_CONTINUOUS_MODE
diff --git a/src/mainboard/google/stout/romstage.c b/src/mainboard/google/stout/romstage.c
index a0700af2eb..8a961eaa7d 100644
--- a/src/mainboard/google/stout/romstage.c
+++ b/src/mainboard/google/stout/romstage.c
@@ -296,7 +296,11 @@ void main(unsigned long bist)
post_code(0x3e);
MCHBAR16(SSKPD) = 0xCAFE;
+#if CONFIG_EARLY_CBMEM_INIT
cbmem_was_initted = !cbmem_initialize();
+#else
+ cbmem_was_initted = cbmem_reinit();
+#endif
#if CONFIG_HAVE_ACPI_RESUME
/* If there is no high memory area, we didn't boot before, so
diff --git a/src/mainboard/intel/emeraldlake2/Kconfig b/src/mainboard/intel/emeraldlake2/Kconfig
index 1ad50d905d..fd98485ca5 100644
--- a/src/mainboard/intel/emeraldlake2/Kconfig
+++ b/src/mainboard/intel/emeraldlake2/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_RESUME
select GFXUMA
#select CHROMEOS
+ select EARLY_CBMEM_INIT
config MAINBOARD_DIR
string
diff --git a/src/mainboard/kontron/ktqm77/Kconfig b/src/mainboard/kontron/ktqm77/Kconfig
index d379f6fe13..e9d1ce790a 100644
--- a/src/mainboard/kontron/ktqm77/Kconfig
+++ b/src/mainboard/kontron/ktqm77/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_RESUME
select HAVE_SMI_HANDLER
select GFXUMA
+ select EARLY_CBMEM_INIT
select ENABLE_VMX
select HAVE_MRC
diff --git a/src/mainboard/lenovo/t60/Kconfig b/src/mainboard/lenovo/t60/Kconfig
index ec0353488a..0f0670e633 100644
--- a/src/mainboard/lenovo/t60/Kconfig
+++ b/src/mainboard/lenovo/t60/Kconfig
@@ -21,6 +21,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select CHANNEL_XOR_RANDOMIZATION
select HAVE_ACPI_TABLES
select HAVE_ACPI_RESUME
+ select EARLY_CBMEM_INIT
config MAINBOARD_DIR
string
default lenovo/t60
diff --git a/src/mainboard/lenovo/x60/Kconfig b/src/mainboard/lenovo/x60/Kconfig
index 8eb159b2f3..72aeef8f5d 100644
--- a/src/mainboard/lenovo/x60/Kconfig
+++ b/src/mainboard/lenovo/x60/Kconfig
@@ -24,6 +24,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_RESUME
select USE_OPTION_TABLE
select MAINBOARD_HAS_NATIVE_VGA_INIT
+ select EARLY_CBMEM_INIT
config MAINBOARD_DIR
string
diff --git a/src/mainboard/samsung/lumpy/Kconfig b/src/mainboard/samsung/lumpy/Kconfig
index 13c8748c47..91dc3b67dd 100644
--- a/src/mainboard/samsung/lumpy/Kconfig
+++ b/src/mainboard/samsung/lumpy/Kconfig
@@ -15,6 +15,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select SOUTHBRIDGE_INTEL_BD82X6X
select SUPERIO_SMSC_MEC1308
select DRIVERS_GENERIC_IOAPIC
+ select EARLY_CBMEM_INIT
select HAVE_MRC
config MAINBOARD_DIR
diff --git a/src/mainboard/samsung/stumpy/Kconfig b/src/mainboard/samsung/stumpy/Kconfig
index 17f854f714..f4f8e4d5eb 100644
--- a/src/mainboard/samsung/stumpy/Kconfig
+++ b/src/mainboard/samsung/stumpy/Kconfig
@@ -13,6 +13,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select NORTHBRIDGE_INTEL_SANDYBRIDGE
select SOUTHBRIDGE_INTEL_BD82X6X
select SUPERIO_ITE_IT8772F
+ select EARLY_CBMEM_INIT
select HAVE_MRC
config MAINBOARD_DIR
diff --git a/src/mainboard/via/epia-m850/romstage.c b/src/mainboard/via/epia-m850/romstage.c
index 473e60e1a2..39f4253d38 100644
--- a/src/mainboard/via/epia-m850/romstage.c
+++ b/src/mainboard/via/epia-m850/romstage.c
@@ -94,7 +94,9 @@ void main(unsigned long bist)
print_debug("We passed RAM verify\n");
/* We got RAM working, now we can write the timestamps to RAM */
+#if CONFIG_EARLY_CBMEM_INIT
cbmem_initialize();
+#endif
timestamp_add_now(TS_END_ROMSTAGE);
/* FIXME: See if this is needed or take this out please */
/* Disable Memcard and SDIO */
diff --git a/src/northbridge/intel/sandybridge/raminit.c b/src/northbridge/intel/sandybridge/raminit.c
index db9620254a..3b321d72b2 100644
--- a/src/northbridge/intel/sandybridge/raminit.c
+++ b/src/northbridge/intel/sandybridge/raminit.c
@@ -58,6 +58,7 @@ static void save_mrc_data(struct pei_data *pei_data)
{
u16 c1, c2, checksum;
+#if CONFIG_EARLY_CBMEM_INIT
struct mrc_data_container *mrcdata;
int output_len = ALIGN(pei_data->mrc_output_len, 16);
@@ -83,6 +84,7 @@ static void save_mrc_data(struct pei_data *pei_data)
mrcdata->mrc_checksum = compute_ip_checksum(mrcdata->mrc_data,
mrcdata->mrc_data_size);
+#endif
/* Save the MRC seed values to CMOS */
cmos_write32(CMOS_OFFSET_MRC_SEED, pei_data->scrambler_seed);