acpi: Add support for generating ACPI _UPC
This commit adds support for writing ACPI _UPC structures that
help describe USB ports for the OS.
This is a simple structure format which indicates what type of
port it is and whether it is connectable. It should be paired
with an ACPI _PLD structure to define USB ports for the OS.
Change-Id: Ide3768f60f96e9ad7f919ad3fb11d91045dc174a
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://review.coreboot.org/26170
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index 10a4e1e..867c809 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -1221,6 +1221,21 @@
acpigen_write_string(arg);
}
+void acpigen_write_upc(enum acpi_upc_type type)
+{
+ acpigen_write_name("_UPC");
+ acpigen_write_package(4);
+ /* Connectable */
+ acpigen_write_byte(type == UPC_TYPE_UNUSED ? 0 : 0xff);
+ /* Type */
+ acpigen_write_byte(type);
+ /* Reserved0 */
+ acpigen_write_zero();
+ /* Reserved1 */
+ acpigen_write_zero();
+ acpigen_pop_len();
+}
+
void acpigen_write_dsm(const char *uuid, void (**callbacks)(void *),
size_t count, void *arg)
{