From efc92a86c2826f6fbac8c9c6098eb114c75bf9dd Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 8 Jun 2017 10:54:59 -0500 Subject: soc/intel/apollolake: use fast_spi_cache_bios_region() The fast_spi_cache_bios_region() does the necessary lookup of BIOS region size, etc. Don't inline the calculation and just defer to the common piece of code for memory-mapped spi flash boot. Change-Id: I6c390aa5a57244308016cd59679d8c3ab02031b8 Signed-off-by: Aaron Durbin Reviewed-on: https://review.coreboot.org/20116 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Barnali Sarkar Reviewed-by: Paul Menzel --- src/soc/intel/apollolake/cpu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/soc/intel/apollolake/cpu.c') diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c index ff300bcc90..9e951aa57d 100644 --- a/src/soc/intel/apollolake/cpu.c +++ b/src/soc/intel/apollolake/cpu.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -205,7 +206,7 @@ void apollolake_init_cpus(device_t dev) 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); + if (IS_ENABLED(CONFIG_BOOT_DEVICE_MEMORY_MAPPED) && + IS_ENABLED(CONFIG_BOOT_DEVICE_SPI_FLASH)) + fast_spi_cache_bios_region(); } -- cgit v1.2.3