From a89a4ea8ea04aaf369cd99f487f3537fe9e46702 Mon Sep 17 00:00:00 2001 From: Raul E Rangel Date: Mon, 19 Apr 2021 17:09:30 -0600 Subject: [PATCH] soc/amd/{cezanne,common}/acpi: Add _OSC method The linux kernel requires a valid _OSC method. Otherwise the _LPI table is ignored. See https://source.chromium.org/chromiumos/chromiumos/codesearch/+/main:src/third_party/kernel/v5.10/drivers/acpi/bus.c;l=324 Before this patch: acpi_processor_get_lpi_info: LPI is not supported After this patch: acpi_processor_evaluate_lpi: ACPI: \_SB_.CP00: ACPI: Found 4 power states BUG=b:178728116 TEST=Boot OS and verify _LPI table is parsed Signed-off-by: Raul E Rangel Change-Id: I44e554b9db6f70fdd1559105cdaee53aeb2bfbf5 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52528 Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/cezanne/acpi/soc.asl | 2 ++ src/soc/amd/common/acpi/osc.asl | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 src/soc/amd/common/acpi/osc.asl diff --git a/src/soc/amd/cezanne/acpi/soc.asl b/src/soc/amd/cezanne/acpi/soc.asl index be511042e4..f7781dab2e 100644 --- a/src/soc/amd/cezanne/acpi/soc.asl +++ b/src/soc/amd/cezanne/acpi/soc.asl @@ -8,6 +8,8 @@ Scope(\_SB) { #include + #include + #include "pci_int_defs.asl" #include "mmio.asl" diff --git a/src/soc/amd/common/acpi/osc.asl b/src/soc/amd/common/acpi/osc.asl new file mode 100644 index 0000000000..22175caa45 --- /dev/null +++ b/src/soc/amd/common/acpi/osc.asl @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +/* + * Platform-Wide _OSC Operating System Capabilities + * + * Arg0: A Buffer containing a UUID + * Arg1: An Integer containing a Revision ID of the buffer format + * Arg2: An Integer containing a count of entries in Arg3 + * Arg3: A Buffer containing a list of DWORD capabilities + */ +Method (_OSC, 4, NotSerialized) { + CreateDWordField (Arg3, 0, CDW1) + If (Arg0 == ToUUID (OSC_SB_UUID)) { + /* Don't mask any capability bits off. */ + Return (Arg3) + } Else { + CDW1 |= OSC_CDW1_UNRECOGNIZED_UUID + Return (Arg3) + } +}