aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/intel/car/non-evict
diff options
context:
space:
mode:
Diffstat (limited to 'src/cpu/intel/car/non-evict')
-rw-r--r--src/cpu/intel/car/non-evict/Kconfig5
-rw-r--r--src/cpu/intel/car/non-evict/cache_as_ram.S13
2 files changed, 18 insertions, 0 deletions
diff --git a/src/cpu/intel/car/non-evict/Kconfig b/src/cpu/intel/car/non-evict/Kconfig
new file mode 100644
index 0000000000..faf13e704d
--- /dev/null
+++ b/src/cpu/intel/car/non-evict/Kconfig
@@ -0,0 +1,5 @@
+config CPU_HAS_L2_ENABLE_MSR
+ bool
+ help
+ Select this in Kconfig of CPU sockets/SOC where the CPU
+ has an MSR to enable the L2 CPU cache
diff --git a/src/cpu/intel/car/non-evict/cache_as_ram.S b/src/cpu/intel/car/non-evict/cache_as_ram.S
index d2beaa7d5a..3203159f40 100644
--- a/src/cpu/intel/car/non-evict/cache_as_ram.S
+++ b/src/cpu/intel/car/non-evict/cache_as_ram.S
@@ -24,6 +24,7 @@
#define CACHE_AS_RAM_BASE CONFIG_DCACHE_RAM_BASE
#define NoEvictMod_MSR 0x2e0
+#define BBL_CR_CTL3_MSR 0x11e
.global bootblock_pre_c_entry
@@ -133,6 +134,18 @@ addrsize_set_high:
orl $MTRR_DEF_TYPE_EN, %eax
wrmsr
+#if IS_ENABLED(CONFIG_CPU_HAS_L2_ENABLE_MSR)
+ /*
+ * Enable the L2 cache. Currently this assumes that this
+ * only affect socketed CPU's for which this is always valid,
+ * hence the static preprocesser.
+ */
+ movl $BBL_CR_CTL3_MSR, %ecx
+ rdmsr
+ orl $0x100, %eax
+ wrmsr
+#endif
+
/* Enable cache (CR0.CD = 0, CR0.NW = 0). */
movl %cr0, %eax
andl $(~(CR0_CacheDisable | CR0_NoWriteThrough)), %eax