From 38ea678258ff89c4e46befa6f2287fb2cd5461fd Mon Sep 17 00:00:00 2001 From: Felix Held Date: Fri, 7 May 2021 20:08:10 +0200 Subject: soc/amd/picasso/acpi/cpu: move WAL1 method that calls ALIB to common TEST=Mandolin still boots into Linux and there's no ACPI warning in dmesg. Signed-off-by: Felix Held Change-Id: I7e6d38ebeae5e55a4a65930b989838532ab9c446 Reviewed-on: https://review.coreboot.org/c/coreboot/+/53920 Reviewed-by: Raul Rangel Tested-by: build bot (Jenkins) --- src/soc/amd/common/acpi/alib.asl | 30 ++++++++++++++++++++++++++++++ src/soc/amd/picasso/acpi/cpu.asl | 28 +--------------------------- src/soc/amd/picasso/acpi/sb_pci0_fch.asl | 2 -- 3 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 src/soc/amd/common/acpi/alib.asl diff --git a/src/soc/amd/common/acpi/alib.asl b/src/soc/amd/common/acpi/alib.asl new file mode 100644 index 000000000000..bf4a1376a508 --- /dev/null +++ b/src/soc/amd/common/acpi/alib.asl @@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +/* The ALIB method object is defined in an SSDT */ +External(\_SB.ALIB, MethodObj) + +/* Wrapper method that calls ALIB function 1 to report current AC/DC state. */ +Method (WAL1) +{ + /* Send ALIB Function 1 the AC/DC state */ + Local0 = Buffer (0x03) {} + CreateWordField (Local0, 0, F1SZ) + CreateByteField (Local0, 2, F1DA) + + /* First argument is size i.e. 3 bytes */ + F1SZ = 3 + + /* + * Second argument is power state i.e. AC or DC. + * ALIB expects AC = 0, DC = 1. + * PWRS reports AC = 1, DC = 0. + * + * Hence, need to invert the state of PWRS. + */ + F1DA = \PWRS ^ 1 + + Printf ("ALIB call: func 1 params %o", Local0) + \_SB.ALIB (ALIB_FUNCTION_REPORT_AC_DC_STATE, Local0) +} diff --git a/src/soc/amd/picasso/acpi/cpu.asl b/src/soc/amd/picasso/acpi/cpu.asl index 869602cc2715..b7395fcaca66 100644 --- a/src/soc/amd/picasso/acpi/cpu.asl +++ b/src/soc/amd/picasso/acpi/cpu.asl @@ -1,32 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ -#include - -/* - * Wrapper method that calls ALIB function 1 to report current AC/DC state. - */ -Method (WAL1) -{ - /* Send ALIB Function 1 the AC/DC state */ - Local0 = Buffer (0x03) {} - CreateWordField (Local0, 0, F1SZ) - CreateByteField (Local0, 2, F1DA) - - /* First argument is size i.e. 3 bytes */ - F1SZ = 3 - - /* - * Second argument is power state i.e. AC or DC. - * ALIB expects AC = 0, DC = 1. - * PWRS reports AC = 1, DC = 0. - * - * Hence, need to invert the state of PWRS. - */ - F1DA = \PWRS ^ 1 - - Printf ("ALIB call: func 1 params %o", Local0) - \_SB.ALIB (ALIB_FUNCTION_REPORT_AC_DC_STATE, Local0) -} +#include Method (PNOT) { diff --git a/src/soc/amd/picasso/acpi/sb_pci0_fch.asl b/src/soc/amd/picasso/acpi/sb_pci0_fch.asl index 0b253c9cdc7a..e948bca903bc 100644 --- a/src/soc/amd/picasso/acpi/sb_pci0_fch.asl +++ b/src/soc/amd/picasso/acpi/sb_pci0_fch.asl @@ -2,8 +2,6 @@ #include -External(\_SB.ALIB, MethodObj) - /* System Bus */ /* _SB.PCI0 */ -- cgit v1.2.3