summaryrefslogtreecommitdiff
path: root/src/arch/x86/include
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-12-01 17:14:35 -0800
committerDuncan Laurie <dlaurie@chromium.org>2018-12-04 22:50:15 +0000
commite1eca1d91cf05b8769e830b5ab59060a0ad5ff0c (patch)
tree6726ac337bac9263bbfb68c22f86a90f978b38f0 /src/arch/x86/include
parent1e64d2386a5f281c294666cec59b45f37c40338d (diff)
acpi_pld: Make it easier to define the ACPI USB device groups
The Linux kernel can use the ACPI _PLD group information to determine peer ports. Currently to define the group information the devicetree must provide a complete _PLD structure. This change pulls the group information into a separate structure that can be defined in devicetree. This makes it easier to set for USB devices in devicetree that do not need a full custom PLD. This was tested on a sarien board with the USB devices defined by verifying that the USB 2/3 ports are correctly identified with their peer in sysfs. Change-Id: Ifd4cadf0f6c901eb3832ad4e1395904f99c2f5a0 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://review.coreboot.org/c/29998 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/arch/x86/include')
-rw-r--r--src/arch/x86/include/arch/acpi_pld.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/arch/x86/include/arch/acpi_pld.h b/src/arch/x86/include/arch/acpi_pld.h
index ce279a00d5..1b4417d2da 100644
--- a/src/arch/x86/include/arch/acpi_pld.h
+++ b/src/arch/x86/include/arch/acpi_pld.h
@@ -75,6 +75,17 @@ enum acpi_pld_rotate {
PLD_ROTATE_315
};
+#define ACPI_PLD_GROUP(__token, __position) \
+ { \
+ .token = __token, \
+ .position = __position, \
+ }
+
+struct acpi_pld_group {
+ uint8_t token;
+ uint8_t position;
+};
+
struct acpi_pld {
/* Color field can be explicitly ignored */
bool ignore_color;
@@ -100,9 +111,8 @@ struct acpi_pld {
enum acpi_pld_rotate rotation;
/* Port grouping */
- enum acpi_pld_orientation group_orientation;
- uint8_t group_token;
- uint8_t group_position;
+ enum acpi_pld_orientation orientation;
+ struct acpi_pld_group group;
uint8_t draw_order;
uint8_t cabinet_number;
uint8_t card_cage_number;
@@ -112,7 +122,8 @@ struct acpi_pld {
};
/* Fill out PLD structure with defaults based on USB port type */
-int acpi_pld_fill_usb(struct acpi_pld *pld, enum acpi_upc_type type);
+int acpi_pld_fill_usb(struct acpi_pld *pld, enum acpi_upc_type type,
+ struct acpi_pld_group *group);
/* Turn PLD structure into a 20 byte ACPI buffer */
int acpi_pld_to_buffer(const struct acpi_pld *pld, uint8_t *buf, int buf_len);