From fdddc463cec6eb10e85b5dd42edf13faceb35fe0 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 21 Sep 2017 20:23:41 +0530 Subject: soc/intel/skylake: Calculate soc reserved memory size This patch implements soc override function to calculate reserve memory size (PRMRR, TraceHub, PTT etc). System memory should reserve those memory ranges. BRANCH=none BUG=b:63974384 TEST=Ensures DRAM based resource allocation has taken care of intel soc reserved ranges. Change-Id: I19583f7d18ca11c3a58eb61c927e5c3c3b65d2ec Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/21540 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) --- src/soc/intel/skylake/memmap.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) (limited to 'src/soc/intel') diff --git a/src/soc/intel/skylake/memmap.c b/src/soc/intel/skylake/memmap.c index 0d31ea8c06..485b8c4cbb 100644 --- a/src/soc/intel/skylake/memmap.c +++ b/src/soc/intel/skylake/memmap.c @@ -255,7 +255,7 @@ static size_t calculate_reserved_mem_size(uintptr_t dram_base, * the base registers from each other to determine sizes of the regions. In * other words, the memory map is in a fixed order no matter what. */ -static uintptr_t calculate_dram_base(void) +static uintptr_t calculate_dram_base(size_t *reserved_mem_size) { uintptr_t dram_base; const struct device *dev; @@ -271,15 +271,34 @@ static uintptr_t calculate_dram_base(void) dram_base -= calculate_traditional_mem_size(dram_base, dev); /* Get Intel Reserved Memory Range Size */ - dram_base -= calculate_reserved_mem_size(dram_base, dev); + *reserved_mem_size = calculate_reserved_mem_size(dram_base, dev); + + dram_base -= *reserved_mem_size; return dram_base; } +/* + * SoC implementation + * + * SoC call to summarize all Intel Reserve MMIO size and report to SA + */ +size_t soc_reserved_mmio_size(void) +{ + size_t chipset_mem_size; + + calculate_dram_base(&chipset_mem_size); + + /* Get Intel Reserved Memory Range Size */ + return chipset_mem_size; +} + /* Fill up memory layout information */ void fill_soc_memmap_ebda(struct ebda_config *cfg) { - cfg->tolum_base = calculate_dram_base(); + size_t chipset_mem_size; + + cfg->tolum_base = calculate_dram_base(&chipset_mem_size); } void cbmem_top_init(void) -- cgit v1.2.3