summaryrefslogtreecommitdiff
path: root/src/soc/intel/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/common')
-rw-r--r--src/soc/intel/common/block/cpu/cpulib.c9
-rw-r--r--src/soc/intel/common/block/include/intelblocks/cpulib.h8
-rw-r--r--src/soc/intel/common/block/include/intelblocks/msr.h1
3 files changed, 18 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/cpu/cpulib.c b/src/soc/intel/common/block/cpu/cpulib.c
index 0b91860dfd..9e4f7a27b0 100644
--- a/src/soc/intel/common/block/cpu/cpulib.c
+++ b/src/soc/intel/common/block/cpu/cpulib.c
@@ -501,3 +501,12 @@ void init_core_prmrr(void)
if (msr.lo & MTRR_CAP_PRMRR)
sync_core_prmrr();
}
+
+bool is_tme_supported(void)
+{
+ struct cpuid_result cpuid_regs;
+
+ cpuid_regs = cpuid_ext(0x7, 0x0); /* ECX[13] is feature capability */
+
+ return (cpuid_regs.ecx & TME_SUPPORTED);
+}
diff --git a/src/soc/intel/common/block/include/intelblocks/cpulib.h b/src/soc/intel/common/block/include/intelblocks/cpulib.h
index 0d489f4190..f0ebd09f82 100644
--- a/src/soc/intel/common/block/include/intelblocks/cpulib.h
+++ b/src/soc/intel/common/block/include/intelblocks/cpulib.h
@@ -194,4 +194,12 @@ void get_cpu_topology_from_apicid(uint32_t apicid, uint8_t *package,
*/
void init_core_prmrr(void);
+/*
+ * Check if TME is supported by the CPU
+ *
+ * coreboot shall detect the existence of TME feature by running CPUID instruction:
+ * CPUID leaf 7/sub-leaf 0: Return Value in ECX [bit 13] = 1
+ */
+bool is_tme_supported(void);
+
#endif /* SOC_INTEL_COMMON_BLOCK_CPULIB_H */
diff --git a/src/soc/intel/common/block/include/intelblocks/msr.h b/src/soc/intel/common/block/include/intelblocks/msr.h
index 8e56aa325b..a7ad699733 100644
--- a/src/soc/intel/common/block/include/intelblocks/msr.h
+++ b/src/soc/intel/common/block/include/intelblocks/msr.h
@@ -106,5 +106,6 @@
#define SMRR_LOCK_SUPPORTED (1<<14)
#define SGX_SUPPORTED (1<<2)
+#define TME_SUPPORTED (1<<13)
#endif /* SOC_INTEL_COMMON_MSR_H */