From b832955161e978e7587e36feb01de354d5d14d6f Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Thu, 10 Feb 2022 16:17:48 +0530 Subject: [PATCH] acpi: Use ACPI macros to configure USB port _PLD object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch adds two ACPI macros for USB port A and C _PLD object configuration as: 1. ACPI_PLD_TYPE_A 2. ACPI_PLD_TYPE_C The configurable parameters are - Panel, Port is exposed on which face of a panel. - Horizontal, Horizontal position on the panel where the device connection point resides. - Group - Token, Unique numerical value identifying a group. - Position, Identifies this device connection point’s position in the group (i.e. 1st, 2nd). BUG=b:216490477 TEST=emerge-brya coreboot Signed-off-by: Subrata Banik Change-Id: I245b17019b6d3c5e380c16cb3c9f4edc4dd10cc6 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61801 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak Reviewed-by: Nick Vaccaro Reviewed-by: EricR Lai --- src/include/acpi/acpi_pld.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/include/acpi/acpi_pld.h b/src/include/acpi/acpi_pld.h index 5a7663c177..f89a68054e 100644 --- a/src/include/acpi/acpi_pld.h +++ b/src/include/acpi/acpi_pld.h @@ -68,6 +68,33 @@ enum acpi_pld_rotate { .position = __position, \ } +/* + * ACPI specification 6.3 third paragraph of section 6.1.8: + * All Panel references (Top, Bottom, Right, Left, etc.) are interpreted + * as though the user is facing the front of the system. + * + * A `_PLD` describes the offset and rotation of a single device connection point + * from an `origin` that resides in the lower left hand corner of its Panel. + */ + +#define ACPI_PLD_TYPE_A(__panel, __horiz, __grp) \ + { \ + .visible = true, \ + .panel = PLD_PANEL_##__panel, \ + .shape = PLD_SHAPE_HORIZONTAL_RECTANGLE, \ + .horizontal_position = PLD_HORIZONTAL_POSITION_##__horiz, \ + .group = __grp, \ + } + +#define ACPI_PLD_TYPE_C(__panel, __horiz, __grp) \ + { \ + .visible = true, \ + .panel = PLD_PANEL_##__panel, \ + .shape = PLD_SHAPE_OVAL, \ + .horizontal_position = PLD_HORIZONTAL_POSITION_##__horiz, \ + .group = __grp, \ + } + struct acpi_pld_group { uint8_t token; uint8_t position;