From bf696f56021b26596121b060df6bb2f4172231eb Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 10 Nov 2016 20:04:19 -0600 Subject: 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 Reviewed-on: https://review.coreboot.org/17372 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Andrey Petrov Reviewed-by: Paul Menzel --- src/soc/intel/apollolake/cpu.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/soc/intel/apollolake') 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); } -- cgit v1.2.3