aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/arch/x86/include/arch/cpu.h5
-rw-r--r--src/arch/x86/postcar_loader.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h
index 5d44aaeb6c..5f11c9dc0c 100644
--- a/src/arch/x86/include/arch/cpu.h
+++ b/src/arch/x86/include/arch/cpu.h
@@ -283,6 +283,11 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf,
uintptr_t addr, size_t size, int type);
/*
+ * Add variable MTRR covering the memory-mapped ROM with given MTRR type.
+ */
+void postcar_frame_add_romcache(struct postcar_frame *pcf, int type);
+
+/*
* Push used MTRR and Max MTRRs on to the stack
* and return pointer to stack top.
*/
diff --git a/src/arch/x86/postcar_loader.c b/src/arch/x86/postcar_loader.c
index 11f048de7a..1877108ed0 100644
--- a/src/arch/x86/postcar_loader.c
+++ b/src/arch/x86/postcar_loader.c
@@ -113,6 +113,13 @@ void postcar_frame_add_mtrr(struct postcar_frame *pcf,
}
}
+void postcar_frame_add_romcache(struct postcar_frame *pcf, int type)
+{
+ if (!IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED))
+ return;
+ postcar_frame_add_mtrr(pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, type);
+}
+
void *postcar_commit_mtrrs(struct postcar_frame *pcf)
{
/*