soc/intel/xeon_sp: Fix final MTRR usage

The region top_of_ram -> cbmem_top is used by FSP and cbmem, but is
also just regular DRAM. Marking it as such improves the final MTRR
solution a lot and fixes MTRR starvation depending on the setup.

Change-Id: I19ff7cf2d699b4cc34caccd91cafd6a284d699d3
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47868
Reviewed-by: Christian Walter <christian.walter@9elements.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Arthur Heymans 2020-11-23 15:45:00 +01:00
parent 6452a9fcfc
commit c2503dbe88
1 changed files with 5 additions and 0 deletions

View File

@ -200,6 +200,11 @@ static void mc_add_dram_resources(struct device *dev, int *res_count)
LOG_MEM_RESOURCE("low_ram", dev, index, base_kb, size_kb); LOG_MEM_RESOURCE("low_ram", dev, index, base_kb, size_kb);
ram_resource(dev, index++, base_kb, size_kb); ram_resource(dev, index++, base_kb, size_kb);
/* fsp_mem_base -> cbmem_top */
base_kb = top_of_ram / KiB;
size_kb = ((uintptr_t)cbmem_top() - top_of_ram) / KiB;
reserved_ram_resource(dev, index++, base_kb, size_kb);
/* /*
* FSP meomoy, CBMem regions are already added as reserved * FSP meomoy, CBMem regions are already added as reserved
* Add TSEG and MESEG Regions as reserved memory * Add TSEG and MESEG Regions as reserved memory