From c2503dbe8864a3a3b917f08794d2414455118891 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Mon, 23 Nov 2020 15:45:00 +0100 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/47868 Reviewed-by: Christian Walter Reviewed-by: Angel Pons Reviewed-by: Jonathan Zhang Tested-by: build bot (Jenkins) --- src/soc/intel/xeon_sp/uncore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index de29dea2b4..8965b3b81f 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -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); 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 * Add TSEG and MESEG Regions as reserved memory