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>
This commit is contained in:
Subrata Banik 2017-09-21 20:23:41 +05:30 committed by Aaron Durbin
parent 73b8503183
commit fdddc463ce
1 changed files with 22 additions and 3 deletions

View File

@ -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 * 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. * 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; uintptr_t dram_base;
const struct device *dev; const struct device *dev;
@ -271,15 +271,34 @@ static uintptr_t calculate_dram_base(void)
dram_base -= calculate_traditional_mem_size(dram_base, dev); dram_base -= calculate_traditional_mem_size(dram_base, dev);
/* Get Intel Reserved Memory Range Size */ /* 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; 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 */ /* Fill up memory layout information */
void fill_soc_memmap_ebda(struct ebda_config *cfg) 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) void cbmem_top_init(void)