summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-05-07 18:46:36 +0200
committerFelix Held <felix-coreboot@felixheld.de>2021-05-08 17:56:10 +0000
commit95f1bb852525808a7b514745ebe3d19b6d2df7c4 (patch)
tree56195beca9a519060a693afb1bec08f44cf028ed
parent509b0a97f6a44ea85a8a37087a03526dd513a88f (diff)
downloadcoreboot-95f1bb852525808a7b514745ebe3d19b6d2df7c4.tar.gz
coreboot-95f1bb852525808a7b514745ebe3d19b6d2df7c4.tar.bz2
coreboot-95f1bb852525808a7b514745ebe3d19b6d2df7c4.zip
soc/amd: factor out ACPI ALIB function numbers to common code
The ACPI ALIB function numbers are defined in the AMD Generic Encapsulated Software Architecture (AGESA™) Interface Specification (document #55483). TEST=Timeless build stays the same for Mandolin (Picasso) and Gardenia (Stoneyridge). Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: I290ef0db32c65ebb2bbbe4f65db4df772b884161 Reviewed-on: https://review.coreboot.org/c/coreboot/+/53915 Reviewed-by: Raul Rangel <rrangel@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/soc/amd/common/block/include/amdblocks/alib.h9
-rw-r--r--src/soc/amd/picasso/acpi/cpu.asl4
-rw-r--r--src/soc/amd/picasso/root_complex.c4
-rw-r--r--src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl4
4 files changed, 17 insertions, 4 deletions
diff --git a/src/soc/amd/common/block/include/amdblocks/alib.h b/src/soc/amd/common/block/include/amdblocks/alib.h
new file mode 100644
index 000000000000..a59ba8b15361
--- /dev/null
+++ b/src/soc/amd/common/block/include/amdblocks/alib.h
@@ -0,0 +1,9 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef AMD_COMMON_ALIB_H
+#define AMD_COMMON_ALIB_H
+
+#define ALIB_FUNCTION_REPORT_AC_DC_STATE 0x1
+#define ALIB_FUNCTION_DYNAMIC_POWER_THERMAL_CONFIG 0xc
+
+#endif /* AMD_COMMON_ALIB_H */
diff --git a/src/soc/amd/picasso/acpi/cpu.asl b/src/soc/amd/picasso/acpi/cpu.asl
index 294d89f48143..869602cc2715 100644
--- a/src/soc/amd/picasso/acpi/cpu.asl
+++ b/src/soc/amd/picasso/acpi/cpu.asl
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <amdblocks/alib.h>
+
/*
* Wrapper method that calls ALIB function 1 to report current AC/DC state.
*/
@@ -23,7 +25,7 @@ Method (WAL1)
F1DA = \PWRS ^ 1
Printf ("ALIB call: func 1 params %o", Local0)
- \_SB.ALIB (1, Local0)
+ \_SB.ALIB (ALIB_FUNCTION_REPORT_AC_DC_STATE, Local0)
}
Method (PNOT)
diff --git a/src/soc/amd/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c
index 292ee20af857..47b3a43cd320 100644
--- a/src/soc/amd/picasso/root_complex.c
+++ b/src/soc/amd/picasso/root_complex.c
@@ -2,6 +2,7 @@
#include <acpi/acpigen.h>
#include <amdblocks/acpi.h>
+#include <amdblocks/alib.h>
#include <amdblocks/memmap.h>
#include <amdblocks/ioapic.h>
#include <arch/ioapic.h>
@@ -18,7 +19,6 @@
#include "chip.h"
enum {
- ALIB_DPTCI_FUNCTION_ID = 0xc,
THERMAL_CONTROL_LIMIT_ID = 0x3,
SUSTAINED_POWER_LIMIT_PARAM_ID = 0x5,
FAST_PPT_LIMIT_PARAM_ID = 0x6,
@@ -196,7 +196,7 @@ static void dptc_call_alib(const char *buf_name, uint8_t *buffer, size_t size)
/* \_SB.ALIB(0xc, buf_name) */
acpigen_emit_namestring("\\_SB.ALIB");
- acpigen_write_integer(ALIB_DPTCI_FUNCTION_ID);
+ acpigen_write_integer(ALIB_FUNCTION_DYNAMIC_POWER_THERMAL_CONFIG);
acpigen_emit_namestring(buf_name);
}
diff --git a/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl b/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl
index 4580b772f009..78ce889e5dfa 100644
--- a/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl
+++ b/src/soc/amd/stoneyridge/acpi/sb_pci0_fch.asl
@@ -1,5 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0-only */
+#include <amdblocks/alib.h>
+
External(\_SB.ALIB, MethodObj)
/* System Bus */
@@ -142,7 +144,7 @@ Method(_INI, 0, Serialized) {
F1SZ = 3
F1DA= \PWRS
- \_SB.ALIB(1, F1BF)
+ \_SB.ALIB(ALIB_FUNCTION_REPORT_AC_DC_STATE, F1BF)
} /* End Method(_SB._INI) */