From aa4d9b94fd1c84f9dc73a029a8eae4743cec8da4 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Fri, 1 Feb 2019 14:20:37 +0100 Subject: soc/intel/apl: Call mca_configure() on cold boots only By APL BIOS Spec, we must not do this on warm boots. The TODO comment seems stale and copied over. So the actual requirements for SGX are unknown and we add a guard for that case. Change-Id: I09b4a2fe22267d7318951aac20a3ea566403492e Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/c/31200 Reviewed-by: Angel Pons Reviewed-by: Werner Zeh Reviewed-by: Aaron Durbin Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- src/soc/intel/apollolake/cpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/soc/intel/apollolake/cpu.c') diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c index bcec28e514..d1c5f6f406 100644 --- a/src/soc/intel/apollolake/cpu.c +++ b/src/soc/intel/apollolake/cpu.c @@ -17,6 +17,7 @@ * GNU General Public License for more details. */ +#include #include #include #include "chip.h" @@ -70,10 +71,11 @@ static const struct reg_script core_msr_script[] = { void soc_core_init(struct device *cpu) { /* Clear out pending MCEs */ - /* TODO(adurbin): This should only be done on a cold boot. Also, some - * of these banks are core vs package scope. For now every CPU clears - * every bank. */ - mca_configure(NULL); + /* TODO(adurbin): Some of these banks are core vs package + scope. For now every CPU clears every bank. */ + if (IS_ENABLED(SOC_INTEL_COMMON_BLOCK_SGX) || + acpi_get_sleep_type() == ACPI_S5) + mca_configure(NULL); /* Set core MSRs */ reg_script_run(core_msr_script); -- cgit v1.2.3