vc/amd/opensil/genoa_poc/memmap: use get_top_of_mem_below_4gb

Use get_top_of_mem_below_4gb instead of open-coding the functionality.

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I5885e9ad89ed9f0aa657c56804e98c352267267f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/81092
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Varshit Pandya <pandyavarshit@gmail.com>
This commit is contained in:
Felix Held
2024-03-05 19:43:32 +01:00
parent a640b123f5
commit d4a1ba47b9

View File

@@ -110,7 +110,7 @@ void add_opensil_memmap(struct device *dev, unsigned long *idx)
mem_usable);
// Account for UMA and TSEG
const uint32_t top_mem = ALIGN_DOWN(rdmsr(TOP_MEM).lo, 1 * MiB);
const uint32_t top_mem = ALIGN_DOWN(get_top_of_mem_below_4gb(), 1 * MiB);
if (mem_usable != top_mem)
reserved_ram_from_to(dev, (*idx)++, mem_usable, top_mem);