From cf47edb173967775f325086f3f599cb9585f614b Mon Sep 17 00:00:00 2001 From: CoolStar Date: Sun, 26 Mar 2023 04:34:18 -0700 Subject: [PATCH] ec/google/wilco/acpi: Add UCSI port data Add UCSI port data/port location data which is required for Windows to use UCSI. Adjustments taken from EC ACPI on Dell 5400/7410 Windows devices. TEST=build/boot google/drallion, verify type-C ports functional under Windows 11. Change-Id: I04aa87ec10f320d1740cd3897864d154f2aea507 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/87489 Reviewed-by: Caveh Jalali Tested-by: build bot (Jenkins) --- src/ec/google/wilco/acpi/ucsi.asl | 72 +++++++++++++++++++ .../variants/drallion/include/variant/ec.h | 3 + 2 files changed, 75 insertions(+) diff --git a/src/ec/google/wilco/acpi/ucsi.asl b/src/ec/google/wilco/acpi/ucsi.asl index 043e1e7abc..7880f7fc8c 100644 --- a/src/ec/google/wilco/acpi/ucsi.asl +++ b/src/ec/google/wilco/acpi/ucsi.asl @@ -156,5 +156,77 @@ Scope (\_SB) ^CCI2 = R (^^UCI2) ^CCI3 = R (^^UCI3) } + + // GPLD: Generate Port Location Data (PLD) + Method (GPLD, 2, Serialized) + { + Name (PCKG, Package (0x01) + { + Buffer (0x10){} + }) + + // REV: Revision 0x02 for ACPI 5.0 + CreateField (DerefOf (PCKG[0]), 0, 0x07, REV) + REV = 0x02 + + // VISI: Port visibility to user per port + CreateField (DerefOf (PCKG[0]), 0x40, 1, VISI) + VISI = Arg0 + + CreateField (DerefOf (PCKG[0]), 0x57, 0x08, GPOS) + GPOS = Arg1 + + CreateField (DerefOf (PCKG[0]), 0x4A, 0x04, SHAP) + SHAP = 0x01 + + CreateField (DerefOf (PCKG[0]), 0x20, 0x10, WID) + WID = 0x08 + + CreateField (DerefOf (PCKG[0]), 0x30, 0x10, HGT) + HGT = 0x03 + Return (PCKG) + } + + Method (GUPC, 1, Serialized) + { + Name (PCKG, Package (0x04) + { + One, + Zero, + Zero, + Zero + }) + PCKG[1] = Arg0 + Return (PCKG) + } + + Device (TC01) + { + Name (_ADR, 0) // _ADR: Address + Method (_UPC, 0, NotSerialized) // _UPC: USB Port Capabilities + { + Return (GUPC (0x09)) + } + + Method (_PLD, 0, NotSerialized) // _PLD: Physical Location of Device + { + Return (GPLD (1, 1)) + } + } +#ifdef EC_BOARD_HAS_2ND_TYPEC_PORT + Device (TC02) + { + Name (_ADR, 1) // _ADR: Address + Method (_UPC, 0, NotSerialized) // _UPC: USB Port Capabilities + { + Return (GUPC (0x09)) + } + + Method (_PLD, 0, NotSerialized) // _PLD: Physical Location of Device + { + Return (GPLD (1, 2)) + } + } +#endif } } diff --git a/src/mainboard/google/drallion/variants/drallion/include/variant/ec.h b/src/mainboard/google/drallion/variants/drallion/include/variant/ec.h index ba9c01d8e8..0843d53a30 100644 --- a/src/mainboard/google/drallion/variants/drallion/include/variant/ec.h +++ b/src/mainboard/google/drallion/variants/drallion/include/variant/ec.h @@ -21,4 +21,7 @@ /* Enable privacy screen functionality */ #define EC_ENABLE_PRIVACY +/* Drallion has 2 type-C ports */ +#define EC_BOARD_HAS_2ND_TYPEC_PORT + #endif