summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/soc/intel/alderlake/cpu.c9
-rw-r--r--src/soc/intel/apollolake/cpu.c9
-rw-r--r--src/soc/intel/cannonlake/cpu.c9
-rw-r--r--src/soc/intel/common/block/include/intelblocks/cpulib.h3
-rw-r--r--src/soc/intel/denverton_ns/cpu.c9
-rw-r--r--src/soc/intel/elkhartlake/cpu.c9
-rw-r--r--src/soc/intel/icelake/cpu.c9
-rw-r--r--src/soc/intel/jasperlake/cpu.c9
-rw-r--r--src/soc/intel/skylake/cpu.c16
-rw-r--r--src/soc/intel/tigerlake/cpu.c9
-rw-r--r--src/soc/intel/xeon_sp/cpx/cpu.c5
-rw-r--r--src/soc/intel/xeon_sp/skx/cpu.c5
12 files changed, 101 insertions, 0 deletions
diff --git a/src/soc/intel/alderlake/cpu.c b/src/soc/intel/alderlake/cpu.c
index fc4ca61f2d85..a6175ed79678 100644
--- a/src/soc/intel/alderlake/cpu.c
+++ b/src/soc/intel/alderlake/cpu.c
@@ -38,6 +38,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void soc_fsp_load(void)
{
fsps_load();
diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c
index 79a69f518cf2..ec262f7b35d7 100644
--- a/src/soc/intel/apollolake/cpu.c
+++ b/src/soc/intel/apollolake/cpu.c
@@ -54,6 +54,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_POWER_MISC);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_POWER_MISC, msr);
+}
+
void soc_core_init(struct device *cpu)
{
/* Configure Core PRMRR for SGX. */
diff --git a/src/soc/intel/cannonlake/cpu.c b/src/soc/intel/cannonlake/cpu.c
index b7ca2b4db355..7e5e4cc0ca79 100644
--- a/src/soc/intel/cannonlake/cpu.c
+++ b/src/soc/intel/cannonlake/cpu.c
@@ -27,6 +27,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void soc_fsp_load(void)
{
fsps_load();
diff --git a/src/soc/intel/common/block/include/intelblocks/cpulib.h b/src/soc/intel/common/block/include/intelblocks/cpulib.h
index b9c3ab70c301..281c9651a145 100644
--- a/src/soc/intel/common/block/include/intelblocks/cpulib.h
+++ b/src/soc/intel/common/block/include/intelblocks/cpulib.h
@@ -120,6 +120,9 @@ void cpu_set_eist(bool eist_status);
*/
bool cpu_soc_is_in_untrusted_mode(void);
+/* SoC function to set the BIOS DONE MSR. */
+void cpu_soc_bios_done(void);
+
/*
* This function fills in the number of Cores(physical) and Threads(virtual)
* of the CPU in the function arguments. It also returns if the number of cores
diff --git a/src/soc/intel/denverton_ns/cpu.c b/src/soc/intel/denverton_ns/cpu.c
index 93657fec02b8..8b5fb40e3c76 100644
--- a/src/soc/intel/denverton_ns/cpu.c
+++ b/src/soc/intel/denverton_ns/cpu.c
@@ -31,6 +31,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_POWER_MISC);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_POWER_MISC, msr);
+}
+
static struct smm_relocation_attrs relo_attrs;
static void dnv_configure_mca(void)
diff --git a/src/soc/intel/elkhartlake/cpu.c b/src/soc/intel/elkhartlake/cpu.c
index 3e0dae191ad3..f4baa65fd9a5 100644
--- a/src/soc/intel/elkhartlake/cpu.c
+++ b/src/soc/intel/elkhartlake/cpu.c
@@ -24,6 +24,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void soc_fsp_load(void)
{
fsps_load();
diff --git a/src/soc/intel/icelake/cpu.c b/src/soc/intel/icelake/cpu.c
index f503fcd051aa..37571758cb0a 100644
--- a/src/soc/intel/icelake/cpu.c
+++ b/src/soc/intel/icelake/cpu.c
@@ -24,6 +24,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void soc_fsp_load(void)
{
fsps_load();
diff --git a/src/soc/intel/jasperlake/cpu.c b/src/soc/intel/jasperlake/cpu.c
index 01cd6acac751..24e5aa79f927 100644
--- a/src/soc/intel/jasperlake/cpu.c
+++ b/src/soc/intel/jasperlake/cpu.c
@@ -24,6 +24,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void soc_fsp_load(void)
{
fsps_load();
diff --git a/src/soc/intel/skylake/cpu.c b/src/soc/intel/skylake/cpu.c
index 3439836f240d..26ab2712a9ba 100644
--- a/src/soc/intel/skylake/cpu.c
+++ b/src/soc/intel/skylake/cpu.c
@@ -27,6 +27,10 @@
bool cpu_soc_is_in_untrusted_mode(void)
{
+ /*
+ * TODO: Add dynamic detection to identify if skylake SoC
+ * is in coffeelake board.
+ */
if (!CONFIG(MAINBOARD_SUPPORTS_COFFEELAKE_CPU))
return false;
@@ -35,6 +39,18 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ if (!CONFIG(MAINBOARD_SUPPORTS_COFFEELAKE_CPU))
+ return;
+
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void configure_misc(void)
{
config_t *conf = config_of_soc();
diff --git a/src/soc/intel/tigerlake/cpu.c b/src/soc/intel/tigerlake/cpu.c
index ffccdccf4410..e81a655329ba 100644
--- a/src/soc/intel/tigerlake/cpu.c
+++ b/src/soc/intel/tigerlake/cpu.c
@@ -30,6 +30,15 @@ bool cpu_soc_is_in_untrusted_mode(void)
return !!(msr.lo & ENABLE_IA_UNTRUSTED);
}
+void cpu_soc_bios_done(void)
+{
+ msr_t msr;
+
+ msr = rdmsr(MSR_BIOS_DONE);
+ msr.lo |= ENABLE_IA_UNTRUSTED;
+ wrmsr(MSR_BIOS_DONE, msr);
+}
+
static void soc_fsp_load(void)
{
fsps_load();
diff --git a/src/soc/intel/xeon_sp/cpx/cpu.c b/src/soc/intel/xeon_sp/cpx/cpu.c
index 71249cb1d8c6..4ecfad0f8902 100644
--- a/src/soc/intel/xeon_sp/cpx/cpu.c
+++ b/src/soc/intel/xeon_sp/cpx/cpu.c
@@ -36,6 +36,11 @@ bool cpu_soc_is_in_untrusted_mode(void)
return false;
}
+void cpu_soc_bios_done(void)
+{
+ /* IA_UNTRUSTED_MODE is not supported in Cooper Lake */
+}
+
static void xeon_configure_mca(void)
{
msr_t msr;
diff --git a/src/soc/intel/xeon_sp/skx/cpu.c b/src/soc/intel/xeon_sp/skx/cpu.c
index c29952916a88..027e9bbcd358 100644
--- a/src/soc/intel/xeon_sp/skx/cpu.c
+++ b/src/soc/intel/xeon_sp/skx/cpu.c
@@ -26,6 +26,11 @@ bool cpu_soc_is_in_untrusted_mode(void)
return false;
}
+void cpu_soc_bios_done(void)
+{
+ /* IA_UNTRUSTED_MODE is not supported in Skylake */
+}
+
static void xeon_configure_mca(void)
{
msr_t msr;