From 08a4613219f5a26a2bcf1216deeb08284cb5269a Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Mon, 7 Oct 2013 16:24:44 -0500 Subject: baytrail: adjust cache policy during romstage The caching policy for romstage was previously using a 32KiB of cache-as-ram for both the MRC wrapper and the romstage stack/data. It also used a 32KiB code cache region. The BWG's limitations for the code and data region before memory is up was wrong. It consists of a 16-way set associative 1MiB cache. As long as enough addresses are not read there isn't a risk of evicting the data/stack. Now create a 64KiB cache-as-ram region split evenly between romstage and the MRC wrapper. Additionally cache the memory just below 4GiB in CBFS size. This will cover any code and read-only data needed. BUG=chrome-os-partner:22858 BRANCH=None TEST=Built and booted quickly with corresponding changes to MRC warpper. CQ-DEPEND=CL:*146175 Change-Id: I021cecb886a9c0622005edc389136d22905d4520 Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/172150 Reviewed-by: Duncan Laurie Reviewed-on: http://review.coreboot.org/4868 Tested-by: build bot (Jenkins) Reviewed-by: Alexandru Gagniuc --- src/soc/intel/baytrail/romstage/cache_as_ram.inc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/soc/intel/baytrail/romstage') diff --git a/src/soc/intel/baytrail/romstage/cache_as_ram.inc b/src/soc/intel/baytrail/romstage/cache_as_ram.inc index 82c77e2b16..f6e029dc56 100644 --- a/src/soc/intel/baytrail/romstage/cache_as_ram.inc +++ b/src/soc/intel/baytrail/romstage/cache_as_ram.inc @@ -31,10 +31,10 @@ (CONFIG_DCACHE_RAM_SIZE + CONFIG_DCACHE_RAM_MRC_VAR_SIZE) #define CACHE_AS_RAM_BASE CONFIG_DCACHE_RAM_BASE -/* Enough room to cache CAR_TILE_SIZE starting at MRC_BIN_ADDRESS */ -#define CACHE_MRC_BASE (CONFIG_MRC_BIN_ADDRESS) -#define CACHE_MRC_MASK (~(CONFIG_CAR_TILE_SIZE - 1)) - +/* Cache all of CBFS just below 4GiB as Write-Protect type. */ +#define CODE_CACHE_SIZE (CONFIG_CBFS_SIZE) +#define CODE_CACHE_BASE (-CODE_CACHE_SIZE) +#define CODE_CACHE_MASK (~(CODE_CACHE_SIZE - 1)) #define CPU_PHYSMASK_HI ((1 << (CONFIG_CPU_ADDR_BITS - 32)) - 1) #define NoEvictMod_MSR 0x2e0 @@ -109,14 +109,14 @@ wait_for_sipi: wrmsr post_code(0x25) - /* Set Cache-as-RAM base address. */ + /* Set code caching up for romstage. */ movl $(MTRRphysBase_MSR(1)), %ecx - movl $(CACHE_MRC_BASE | MTRR_TYPE_WRPROT), %eax + movl $(CODE_CACHE_BASE | MTRR_TYPE_WRPROT), %eax xorl %edx, %edx wrmsr movl $(MTRRphysMask_MSR(1)), %ecx - movl $(CACHE_MRC_MASK | MTRRphysMaskValid), %eax + movl $(CODE_CACHE_MASK | MTRRphysMaskValid), %eax movl $CPU_PHYSMASK_HI, %edx wrmsr -- cgit v1.2.3