summaryrefslogtreecommitdiff
path: root/src/soc/intel/apollolake
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2016-11-10 20:04:19 -0600
committerAaron Durbin <adurbin@chromium.org>2016-11-12 04:06:47 +0100
commitbf696f56021b26596121b060df6bb2f4172231eb (patch)
tree700d5ded2242c3e1e47c37e3fe73137de48cd295 /src/soc/intel/apollolake
parent2bebd7bc93e248f5bdf5677d07802eb9e14528b0 (diff)
downloadcoreboot-bf696f56021b26596121b060df6bb2f4172231eb.tar.xz
soc/intel/apollolake: cache the MMIO BIOS region
If the boot media is memory mapped temporarily mark it as write protect MTRR type so that memory-mapped accesses are faster. Depthcharge payload loading was sped up by 75ms using this. BUG=chrome-os-partner:56656,chrome-os-partner:59682 Change-Id: Iba87a51a05559d81b8e00fa4f6824dacf7a661f5 Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: https://review.coreboot.org/17372 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/soc/intel/apollolake')
-rw-r--r--src/soc/intel/apollolake/cpu.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c
index 6b5dee2339..e2d3a9dae7 100644
--- a/src/soc/intel/apollolake/cpu.c
+++ b/src/soc/intel/apollolake/cpu.c
@@ -183,4 +183,9 @@ void apollolake_init_cpus(device_t dev)
/* Clear for take-off */
if (mp_init_with_smm(dev->link_list, &mp_ops) < 0)
printk(BIOS_ERR, "MP initialization failure.\n");
+
+ /* Temporarily cache the memory-mapped boot media. */
+ if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED))
+ mtrr_use_temp_range(-CONFIG_ROM_SIZE, CONFIG_ROM_SIZE,
+ MTRR_TYPE_WRPROT);
}