aboutsummaryrefslogtreecommitdiff
path: root/src/arch/x86/acpi_pld.c
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/acpi_pld.c
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/acpi_pld.c')
-rw-r--r--src/arch/x86/acpi_pld.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/arch/x86/acpi_pld.c b/src/arch/x86/acpi_pld.c
index d399ea69dd..904e9f777f 100644
--- a/src/arch/x86/acpi_pld.c
+++ b/src/arch/x86/acpi_pld.c
@@ -18,7 +18,8 @@
#include <arch/acpi.h>
#include <arch/acpi_pld.h>
-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)
{
if (!pld)
return -1;
@@ -32,6 +33,8 @@ int acpi_pld_fill_usb(struct acpi_pld *pld, enum acpi_upc_type type)
pld->horizontal_position = PLD_HORIZONTAL_POSITION_CENTER;
pld->rotation = PLD_ROTATE_0;
pld->visible = 1;
+ pld->group.token = group->token;
+ pld->group.position = group->position;
/* Set the shape based on port type */
switch (type) {
@@ -114,16 +117,16 @@ int acpi_pld_to_buffer(const struct acpi_pld *pld, uint8_t *buf, int buf_len)
/* [77:74] Shape */
buf[9] |= (pld->shape & 0xf) << 2;
- /* [78] Group Orientation */
- buf[9] |= (pld->group_orientation & 0x1) << 6;
+ /* [78] Orientation */
+ buf[9] |= (pld->orientation & 0x1) << 6;
/* [86:79] Group Token (incorrectly defined as 1 bit in ACPI 6.2A) */
- buf[9] |= (pld->group_token & 0x1) << 7;
- buf[10] |= (pld->group_token >> 0x1) & 0x7f;
+ buf[9] |= (pld->group.token & 0x1) << 7;
+ buf[10] |= (pld->group.token >> 0x1) & 0x7f;
/* [94:87] Group Position */
- buf[10] |= (pld->group_position & 0x1) << 7;
- buf[11] |= (pld->group_position >> 0x1) & 0x7f;
+ buf[10] |= (pld->group.position & 0x1) << 7;
+ buf[11] |= (pld->group.position >> 0x1) & 0x7f;
/* [95] Bay */
buf[11] |= (pld->bay & 0x1) << 7;