summaryrefslogtreecommitdiff
path: root/src/arch/x86/acpigen.c
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-05-07 14:18:13 -0700
committerPatrick Georgi <pgeorgi@google.com>2018-05-11 09:00:33 +0000
commit3e7197a59edfb13c0dc8ffe47a67d744c7132c2a (patch)
treea26d3dee561564f1f134f391e31212d83d74aae3 /src/arch/x86/acpigen.c
parentbeb2af4e3512e2f1c8445417ab2fcc90ef481124 (diff)
acpi: Add support for writing ACPI _PLD structures
This commit adds support for writing ACPI _PLD structures that describe the physical location of a device to the OS. This can be used by any device with a physical connector, but is required when defining USB ports for the OS. A simple function is provided that generates a generic _PLD structure for USB ports based on the USB port type. Change-Id: Ic9cf1fd158eca80ead21b4725b37ab3c36b000f3 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/26171 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/arch/x86/acpigen.c')
-rw-r--r--src/arch/x86/acpigen.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index 867c809a45..6243d265ce 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -1236,6 +1236,17 @@ void acpigen_write_upc(enum acpi_upc_type type)
acpigen_pop_len();
}
+void acpigen_write_pld(const struct acpi_pld *pld)
+{
+ uint8_t buf[20];
+
+ if (acpi_pld_to_buffer(pld, buf, ARRAY_SIZE(buf)) < 0)
+ return;
+
+ acpigen_write_name("_PLD");
+ acpigen_write_byte_buffer(buf, ARRAY_SIZE(buf));
+}
+
void acpigen_write_dsm(const char *uuid, void (**callbacks)(void *),
size_t count, void *arg)
{