summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2014-03-28 23:46:45 +0200
committerKyösti Mälkki <kyosti.malkki@gmail.com>2014-04-01 11:36:00 +0200
commitdeb2cb27e9bade18c4d186899edfaeabfc1131bd (patch)
tree3827d61ee049cb0f2d5edc6951210d112b5378f7
parent0ec3f493a332a7e779600406732141573fafd526 (diff)
downloadcoreboot-deb2cb27e9bade18c4d186899edfaeabfc1131bd.tar.xz
Static CBMEM / CAR: Flag boards with BROKEN_CAR_MIGRATE
Use of CAR_GLOBAL is not safe after CAR is torn down, unless the board properly implements EARLY_CBMEM_INIT. Flag vulnerable boards that only do cbmem_recovery() in romstage on S3 resume and implementation with Intel FSP that invalidates cache before we have a chance to copy the contents. Change-Id: Iecd10dee9b73ab3f1f66826950fa0945675ff39f Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5419 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@google.com>
-rw-r--r--src/Kconfig9
-rw-r--r--src/arch/x86/boot/Makefile.inc2
-rw-r--r--src/arch/x86/boot/cbmem.c4
-rw-r--r--src/cpu/x86/Makefile.inc2
-rw-r--r--src/lib/Makefile.inc2
-rw-r--r--src/mainboard/asus/dsbf/Kconfig1
-rw-r--r--src/mainboard/intel/cougar_canyon2/Kconfig1
-rw-r--r--src/mainboard/iwave/iWRainbowG6/Kconfig1
-rw-r--r--src/mainboard/supermicro/x7db8/Kconfig1
9 files changed, 19 insertions, 4 deletions
diff --git a/src/Kconfig b/src/Kconfig
index 531a8c860b..fe7dc9b017 100644
--- a/src/Kconfig
+++ b/src/Kconfig
@@ -170,6 +170,15 @@ config EARLY_CBMEM_INIT
some, for instance, execution timestamps. It needs support in
romstage.c and should be enabled by the board's Kconfig.
+config BROKEN_CAR_MIGRATE
+ bool
+ default y if !EARLY_CBMEM_INIT && HAVE_ACPI_RESUME
+ default n
+ help
+ Many boards use CAR_GLOBAL but have no EARLY_CBMEM_INIT and
+ manage CAR migration on S3 resume path only. Couple boards use
+ CAR_GLOBAL and never do CAR migration.
+
config DYNAMIC_CBMEM
bool "The CBMEM space is dynamically grown."
default n
diff --git a/src/arch/x86/boot/Makefile.inc b/src/arch/x86/boot/Makefile.inc
index 79c64170b4..928fc03e68 100644
--- a/src/arch/x86/boot/Makefile.inc
+++ b/src/arch/x86/boot/Makefile.inc
@@ -1,5 +1,5 @@
romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c
-romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c
+romstage-$(CONFIG_BROKEN_CAR_MIGRATE) += cbmem.c
ramstage-y += boot.c
ramstage-y += gdt.c
diff --git a/src/arch/x86/boot/cbmem.c b/src/arch/x86/boot/cbmem.c
index c2d9a2ed87..8b2b6da678 100644
--- a/src/arch/x86/boot/cbmem.c
+++ b/src/arch/x86/boot/cbmem.c
@@ -49,13 +49,15 @@ void set_top_of_ram(uint64_t ramtop)
backup_top_of_ram(ramtop);
cbmem_late_set_table(ramtop - HIGH_MEMORY_SIZE, HIGH_MEMORY_SIZE);
}
+#endif /* !__PRE_RAM__ */
+#if CONFIG_BROKEN_CAR_MIGRATE || !defined(__PRE_RAM__)
unsigned long __attribute__((weak)) get_top_of_ram(void)
{
printk(BIOS_WARNING, "WARNING: you need to define get_top_of_ram() for your chipset\n");
return 0;
}
-#endif /* !__PRE_RAM__ */
+#endif
#else
diff --git a/src/cpu/x86/Makefile.inc b/src/cpu/x86/Makefile.inc
index c0b50c59ae..514d96cfbf 100644
--- a/src/cpu/x86/Makefile.inc
+++ b/src/cpu/x86/Makefile.inc
@@ -1,5 +1,5 @@
romstage-$(CONFIG_EARLY_CBMEM_INIT) += car.c
-romstage-$(CONFIG_HAVE_ACPI_RESUME) += car.c
+romstage-$(CONFIG_BROKEN_CAR_MIGRATE) += car.c
subdirs-$(CONFIG_PARALLEL_MP) += name
ramstage-$(CONFIG_PARALLEL_MP) += mp_init.c
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 93babd3c1f..f8cf3b1d84 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -103,7 +103,7 @@ romstage-y += dynamic_cbmem.c
else
ramstage-y += cbmem.c
romstage-$(CONFIG_EARLY_CBMEM_INIT) += cbmem.c
-romstage-$(CONFIG_HAVE_ACPI_RESUME) += cbmem.c
+romstage-$(CONFIG_BROKEN_CAR_MIGRATE) += cbmem.c
endif # CONFIG_DYNAMIC_CBMEM
ramstage-y += cbmem_info.c
diff --git a/src/mainboard/asus/dsbf/Kconfig b/src/mainboard/asus/dsbf/Kconfig
index 5d67014990..99aa56d965 100644
--- a/src/mainboard/asus/dsbf/Kconfig
+++ b/src/mainboard/asus/dsbf/Kconfig
@@ -11,6 +11,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_PIRQ_TABLE
select DRIVERS_I2C_W83793
select DRIVERS_GENERIC_IOAPIC
+ select BROKEN_CAR_MIGRATE
config MAINBOARD_DIR
string
diff --git a/src/mainboard/intel/cougar_canyon2/Kconfig b/src/mainboard/intel/cougar_canyon2/Kconfig
index 569888d3c9..61f1c6d34b 100644
--- a/src/mainboard/intel/cougar_canyon2/Kconfig
+++ b/src/mainboard/intel/cougar_canyon2/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select SUPERIO_SMSC_SIO1007
select ENABLE_VMX
select EARLY_CBMEM_INIT
+ select BROKEN_CAR_MIGRATE
config MAINBOARD_DIR
string
diff --git a/src/mainboard/iwave/iWRainbowG6/Kconfig b/src/mainboard/iwave/iWRainbowG6/Kconfig
index 75d4bb97df..c6c15d593b 100644
--- a/src/mainboard/iwave/iWRainbowG6/Kconfig
+++ b/src/mainboard/iwave/iWRainbowG6/Kconfig
@@ -14,6 +14,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_ACPI_TABLES
select BOARD_ROMSIZE_KB_1024
select GFXUMA
+ select BROKEN_CAR_MIGRATE
config MAINBOARD_DIR
string
diff --git a/src/mainboard/supermicro/x7db8/Kconfig b/src/mainboard/supermicro/x7db8/Kconfig
index 03f8cebd83..7becacba8a 100644
--- a/src/mainboard/supermicro/x7db8/Kconfig
+++ b/src/mainboard/supermicro/x7db8/Kconfig
@@ -11,6 +11,7 @@ config BOARD_SPECIFIC_OPTIONS # dummy
select HAVE_PIRQ_TABLE
select DRIVERS_I2C_W83793
select DRIVERS_GENERIC_IOAPIC
+ select BROKEN_CAR_MIGRATE
config MAINBOARD_DIR
string