From 3e7197a59edfb13c0dc8ffe47a67d744c7132c2a Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 7 May 2018 14:18:13 -0700 Subject: 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 Reviewed-on: https://review.coreboot.org/26171 Tested-by: build bot (Jenkins) Reviewed-by: Furquan Shaikh Reviewed-by: Paul Menzel --- src/arch/x86/acpigen.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/arch/x86/acpigen.c') 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) { -- cgit v1.2.3