diff options
author | Subrata Banik <subrata.banik@intel.com> | 2017-09-21 20:23:41 +0530 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2017-09-22 16:23:30 +0000 |
commit | fdddc463cec6eb10e85b5dd42edf13faceb35fe0 (patch) | |
tree | 860eab060df7f323a50854802d4b739943d11e3f /src/soc | |
parent | 73b8503183a552fa31fb55d539e9cc2ad4492e8d (diff) |
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 <subrata.banik@intel.com>
Reviewed-on: https://review.coreboot.org/21540
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/skylake/memmap.c | 25 |
1 files changed, 22 insertions, 3 deletions
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) |