summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/arch/x86/acpigen.c15
-rw-r--r--src/arch/x86/include/arch/acpi.h24
-rw-r--r--src/arch/x86/include/arch/acpigen.h1
3 files changed, 40 insertions, 0 deletions
diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index 10a4e1ee8f..867c809a45 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -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)
{
diff --git a/src/arch/x86/include/arch/acpi.h b/src/arch/x86/include/arch/acpi.h
index 586a0851ad..5480834eb2 100644
--- a/src/arch/x86/include/arch/acpi.h
+++ b/src/arch/x86/include/arch/acpi.h
@@ -636,6 +636,30 @@ typedef struct acpi_tstate {
u32 status;
} __packed acpi_tstate_t;
+/* Port types for ACPI _UPC object */
+enum acpi_upc_type {
+ /* These types are defined in ACPI 6.2 section 9.14 */
+ UPC_TYPE_A,
+ UPC_TYPE_MINI_AB,
+ UPC_TYPE_EXPRESSCARD,
+ UPC_TYPE_USB3_A,
+ UPC_TYPE_USB3_B,
+ UPC_TYPE_USB3_MICRO_B,
+ UPC_TYPE_USB3_MICRO_AB,
+ UPC_TYPE_USB3_POWER_B,
+ UPC_TYPE_C_USB2_ONLY,
+ UPC_TYPE_C_USB2_SS_SWITCH,
+ UPC_TYPE_C_USB2_SS,
+ UPC_TYPE_PROPRIETARY = 0xff,
+ /*
+ * The following types are not directly defined in the ACPI
+ * spec but are used by coreboot to identify a USB device type.
+ */
+ UPC_TYPE_INTERNAL = 0xff,
+ UPC_TYPE_UNUSED,
+ UPC_TYPE_HUB
+};
+
unsigned long fw_cfg_acpi_tables(unsigned long start);
/* These are implemented by the target port or north/southbridge. */
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index 216e75fce6..250c0b73c9 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -255,6 +255,7 @@ void acpigen_write_byte_buffer(uint8_t *arr, size_t size);
void acpigen_write_return_byte_buffer(uint8_t *arr, size_t size);
void acpigen_write_return_singleton_buffer(uint8_t arg);
void acpigen_write_return_byte(uint8_t arg);
+void acpigen_write_upc(enum acpi_upc_type type);
/*
* Generate ACPI AML code for _DSM method.
* This function takes as input uuid for the device, set of callbacks and