From f0c1c9791b2909e5d963d55b215485f66f1fc62e Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 2 Mar 2023 19:45:21 +0100 Subject: soc/amd/stoneyridge: request binaryPI to use \_SB_ scope in PSTATE SSDT 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=Careena still boots and Linux doesn't show any ACPI errors with this patch applied. With only patch_ssdt_processor_scope removed, but the ProcessorScopeInSb option not set, Linux will complain that it can't resolve the \PR.P00x symbols. Signed-off-by: Felix Held Change-Id: If88820a0f5df923f129e2e3b5335f5f0e38ee7f5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/73385 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- src/soc/amd/common/pi/agesawrapper.c | 3 +++ src/soc/amd/stoneyridge/northbridge.c | 16 ---------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/soc/amd/common/pi/agesawrapper.c b/src/soc/amd/common/pi/agesawrapper.c index 40858553df..2539a1d68a 100644 --- a/src/soc/amd/common/pi/agesawrapper.c +++ b/src/soc/amd/common/pi/agesawrapper.c @@ -266,6 +266,9 @@ static AGESA_STATUS amd_init_late(AMD_LATE_PARAMS *LateParams) LateParams->GnbLateConfiguration.FchIoapicId = FCH_IOAPIC_ID; } + /* Make binaryPI use \_SB_ as processor object scope in PSTATE SSDT */ + LateParams->PlatformConfig.ProcessorScopeInSb = true; + timestamp_add_now(TS_AGESA_INIT_LATE_START); Status = amd_dispatch(LateParams); timestamp_add_now(TS_AGESA_INIT_LATE_END); diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c index 6389cc439c..e318024dd8 100644 --- a/src/soc/amd/stoneyridge/northbridge.c +++ b/src/soc/amd/stoneyridge/northbridge.c @@ -207,21 +207,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) @@ -296,7 +281,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; -- cgit v1.2.3