From 0a2c9d7913978dfc82f14e26dded7fa1b89f47d1 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 2 Mar 2023 21:01:37 +0100 Subject: nb/amd/pi/00730F01: request binaryPI to use \_SB_ scope in PSTATE SSDT MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Instead of having binaryPI generate a PSTATE SSDT that uses \_PR_ as the scope for the CPU objects and patching this SSDT in coreboot to use the \_SB_ scope in patch_ssdt_processor_scope, request binaryPI to use the \_SB_ scope instead by setting the late platform configuration option ProcessorScopeInSb to true. TEST=APU2 still boots and Linux doesn't show any ACPI errors with this patch applied and it prints "ACPI: \_SB_.P000: Found 2 idle states". Signed-off-by: Felix Held Change-Id: I411201b55cfee30ae41da4e6814679bdb49e9bf7 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73386 Reviewed-by: Martin Roth Tested-by: build bot (Jenkins) Reviewed-by: Michał Żygowski Reviewed-by: Kyösti Mälkki --- src/northbridge/amd/pi/00730F01/northbridge.c | 16 ---------------- src/northbridge/amd/pi/00730F01/state_machine.c | 3 +++ 2 files changed, 3 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/northbridge/amd/pi/00730F01/northbridge.c b/src/northbridge/amd/pi/00730F01/northbridge.c index b9ac022697..46610c51e2 100644 --- a/src/northbridge/amd/pi/00730F01/northbridge.c +++ b/src/northbridge/amd/pi/00730F01/northbridge.c @@ -554,21 +554,6 @@ static void northbridge_fill_ssdt_generator(const struct device *device) acpigen_pop_len(); } -static void patch_ssdt_processor_scope(acpi_header_t *ssdt) -{ - unsigned int len = ssdt->length - sizeof(acpi_header_t); - unsigned int i; - - for (i = sizeof(acpi_header_t); i < len; i++) { - /* Search for _PR_ scope and replace it with _SB_ */ - if (*(uint32_t *)((unsigned long)ssdt + i) == 0x5f52505f) - *(uint32_t *)((unsigned long)ssdt + i) = 0x5f42535f; - } - /* Recalculate checksum */ - ssdt->checksum = 0; - ssdt->checksum = acpi_checksum((void *)ssdt, ssdt->length); -} - static unsigned long agesa_write_acpi_tables(const struct device *device, unsigned long current, acpi_rsdp_t *rsdp) @@ -639,7 +624,6 @@ static unsigned long agesa_write_acpi_tables(const struct device *device, printk(BIOS_DEBUG, "ACPI: * SSDT at %lx\n", current); ssdt = (acpi_header_t *)agesawrapper_getlateinitptr(PICK_PSTATE); if (ssdt != NULL) { - patch_ssdt_processor_scope(ssdt); memcpy((void *)current, ssdt, ssdt->length); ssdt = (acpi_header_t *)current; current += ssdt->length; diff --git a/src/northbridge/amd/pi/00730F01/state_machine.c b/src/northbridge/amd/pi/00730F01/state_machine.c index 9128c2427e..a05e9e04e8 100644 --- a/src/northbridge/amd/pi/00730F01/state_machine.c +++ b/src/northbridge/amd/pi/00730F01/state_machine.c @@ -69,6 +69,9 @@ void platform_BeforeInitLate(struct sysinfo *cb, AMD_LATE_PARAMS *Late) Late->GnbLateConfiguration.FchIoapicId = FCH_IOAPIC_ID; } + /* Make binaryPI use \_SB_ as processor object scope in PSTATE SSDT */ + Late->PlatformConfig.ProcessorScopeInSb = true; + /* Code for creating CDIT requires hop count table. If it is not * present AGESA_ERROR is returned, which confuses users. CDIT is not * written to the ACPI tables anyway. */ -- cgit v1.2.3