summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block/acpi/alib.c
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2021-05-08 01:30:30 +0200
committerMartin Roth <martinroth@google.com>2021-05-10 04:21:18 +0000
commit18b51e93ac5a772e60a46d7dd6236e70429a1e91 (patch)
tree22ee1d33dc0926543d1f4c92e6abe469c791025f /src/soc/amd/common/block/acpi/alib.c
parentdcec409e95703b7a99600187e4b56c0b458114eb (diff)
soc/amd/picasso: move acpigen_dptc_call_alib to new common alib
Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ib0f7da12429b6278d1e4bc5d6650c7ee0f3b5209 Reviewed-on: https://review.coreboot.org/c/coreboot/+/53940 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/soc/amd/common/block/acpi/alib.c')
-rw-r--r--src/soc/amd/common/block/acpi/alib.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/acpi/alib.c b/src/soc/amd/common/block/acpi/alib.c
new file mode 100644
index 0000000000..5e1e8fb443
--- /dev/null
+++ b/src/soc/amd/common/block/acpi/alib.c
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#include <acpi/acpigen.h>
+#include <amdblocks/alib.h>
+#include <types.h>
+
+void acpigen_dptc_call_alib(const char *buf_name, uint8_t *buffer, size_t size)
+{
+ /* Name (buf_name, Buffer(size) {...} */
+ acpigen_write_name(buf_name);
+ acpigen_write_byte_buffer(buffer, size);
+
+ /* \_SB.ALIB(0xc, buf_name) */
+ acpigen_emit_namestring("\\_SB.ALIB");
+ acpigen_write_integer(ALIB_FUNCTION_DYNAMIC_POWER_THERMAL_CONFIG);
+ acpigen_emit_namestring(buf_name);
+}