summaryrefslogtreecommitdiff
path: root/src/northbridge/amd/pi
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-04-20 13:06:08 +0200
committerFelix Held <felix-coreboot@felixheld.de>2023-04-21 15:11:56 +0000
commite345378354225981311304df2357fe7008fcd826 (patch)
treeb390dc2ccc512f6deb0702554241b45463c6f2fd /src/northbridge/amd/pi
parentfb532c711e2ef317108d6ffc35ae751bf7d58530 (diff)
nb/amd/pi/00730F01/northbridge: use get_top_of_mem_[below,above]_4gb
Use get_top_of_mem_below_4gb and get_top_of_mem_above_4g instead of open-coding the functionality. Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I6332b051acf8d00ba6528360b18ea0d3c4dc30fd Reviewed-on: https://review.coreboot.org/c/coreboot/+/74611 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
Diffstat (limited to 'src/northbridge/amd/pi')
-rw-r--r--src/northbridge/amd/pi/00730F01/northbridge.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c
index d963171311..d373493e85 100644
--- a/src/northbridge/amd/pi/00730F01/northbridge.c
+++ b/src/northbridge/amd/pi/00730F01/northbridge.c
@@ -538,13 +538,11 @@ static unsigned long acpi_fill_ivrs(acpi_ivrs_t *ivrs, unsigned long current)
static void northbridge_fill_ssdt_generator(const struct device *device)
{
- msr_t msr;
char pscope[] = "\\_SB.PCI0";
acpigen_write_scope(pscope);
- msr = rdmsr(TOP_MEM);
- acpigen_write_name_dword("TOM1", msr.lo);
- msr = rdmsr(TOP_MEM2);
+ acpigen_write_name_dword("TOM1", get_top_of_mem_below_4gb());
+
/*
* Since XP only implements parts of ACPI 2.0, we can't use a qword
* here.
@@ -553,7 +551,7 @@ static void northbridge_fill_ssdt_generator(const struct device *device)
* Shift value right by 20 bit to make it fit into 32bit,
* giving us 1MB granularity and a limit of almost 4Exabyte of memory.
*/
- acpigen_write_name_dword("TOM2", (msr.hi << 12) | msr.lo >> 20);
+ acpigen_write_name_dword("TOM2", get_top_of_mem_above_4g() >> 20);
acpigen_pop_len();
}