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>
This commit is contained in:
Duncan Laurie
2018-05-07 14:26:59 -07:00
committed by Patrick Georgi
parent bae9f85ddb
commit beb2af4e35
3 changed files with 40 additions and 0 deletions

View File

@@ -1221,6 +1221,21 @@ void acpigen_write_return_string(const char *arg)
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)
{