diff options
author | Felix Held <felix-coreboot@felixheld.de> | 2023-05-05 15:20:15 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-06-07 00:22:09 +0000 |
commit | 8cab80c84f2be22e1f45a2b31c8019695b70abb2 (patch) | |
tree | 39d4f4652869298f2a1ab41149ba9a73e1364b96 /src/soc/amd/stoneyridge | |
parent | b56ea2503f77f8c9962c55e65447030e657408f7 (diff) |
soc/amd/common/acpi: move acpi_fill_root_complex_tom to Stoneyridge
Now that Stoneyridge is the only AMD SoC that still needs the part of
the SSDT that contains the TOM1 and TOM2, move it from the common code
to the Stoneyridge northbridge code.
Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: I9091360d6a82183092ef75417ad652523babe075
Reviewed-on: https://review.coreboot.org/c/coreboot/+/75564
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/soc/amd/stoneyridge')
-rw-r--r-- | src/soc/amd/stoneyridge/northbridge.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index 452a7bb2eb..90d227ade0 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -167,6 +167,31 @@ static void northbridge_init(struct device *dev) register_new_ioapic((u8 *)IO_APIC2_ADDR); } +/* Used by \_SB.PCI0._CRS */ +static void acpi_fill_root_complex_tom(const struct device *device) +{ + const char *scope; + + assert(device); + + scope = acpi_device_scope(device); + assert(scope); + acpigen_write_scope(scope); + + 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. + * See http://www.acpi.info/presentations/S01USMOBS169_OS%2520new.ppt + * slide 22ff. + * 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", get_top_of_mem_above_4gb() >> 20); + acpigen_pop_len(); +} + static unsigned long acpi_fill_hest(acpi_hest_t *hest) { void *addr, *current; |