summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoolStar <coolstarorganization@gmail.com>2023-03-26 03:52:54 -0700
committerMartin L Roth <gaumless@gmail.com>2023-08-21 23:17:59 +0000
commit4a587b8e96e758b22cfb7e60e2a85c03aae98e3a (patch)
tree8da29e786740d2f090d51f35a7006772511e2390
parent23c718c93a25cf97a1d1c88c7d75d11780565d0e (diff)
ec/google/wilco: Correct scope of UCSI ACPI device
Set the USCI device scope to _SB and set HID to USBC000 so Windows driver attaches. This matches the ACPI used by the non-Chromebook version of the Dell Latittude 7410 (which uses the same EC). TEST=build/boot Win11 on google/drallion Change-Id: If482fa4a4856c7bc085795bc72b35ebefe2f15c4 Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/77281 Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: CoolStar <coolstarorganization@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/ec/google/wilco/acpi/ec.asl2
-rw-r--r--src/ec/google/wilco/acpi/ec_ram.asl106
-rw-r--r--src/ec/google/wilco/acpi/event.asl2
-rw-r--r--src/ec/google/wilco/acpi/ucsi.asl260
-rw-r--r--src/ec/google/wilco/chip.c2
5 files changed, 195 insertions, 177 deletions
diff --git a/src/ec/google/wilco/acpi/ec.asl b/src/ec/google/wilco/acpi/ec.asl
index 7b41ef2e3f..2e8432844b 100644
--- a/src/ec/google/wilco/acpi/ec.asl
+++ b/src/ec/google/wilco/acpi/ec.asl
@@ -50,7 +50,7 @@ Device (EC0)
}
/* Initialize UCSI */
- ^UCSI.INIT ()
+ \_SB.UCSI.INIT ()
// Initialize LID switch state
\LIDS = R (P1LC)
diff --git a/src/ec/google/wilco/acpi/ec_ram.asl b/src/ec/google/wilco/acpi/ec_ram.asl
index 665fa1b481..5d44629cf1 100644
--- a/src/ec/google/wilco/acpi/ec_ram.asl
+++ b/src/ec/google/wilco/acpi/ec_ram.asl
@@ -131,53 +131,59 @@ Name (DWTQ, Package () { 0x38, 0xff, WR }) /* DPTF: Write Trip Query */
Name (CSOS, Package () { 0xb8, 0xff, WR }) /* OS support for S0ix */
Name (CSEX, Package () { 0xb9, 0xff, WR }) /* OS enter(1)/exit(0) S0ix */
-/*
- * EC UCSI
- */
-Name (UVR0, Package () { 0x80, 0xff, RD }) /* UCSI Version */
-Name (UVR1, Package () { 0x81, 0xff, RD }) /* UCSI Version */
-Name (UCI0, Package () { 0x84, 0xff, RD }) /* UCSI Change Indicator */
-Name (UCI1, Package () { 0x85, 0xff, RD }) /* UCSI Change Indicator */
-Name (UCI2, Package () { 0x86, 0xff, RD }) /* UCSI Change Indicator */
-Name (UCI3, Package () { 0x87, 0xff, RD }) /* UCSI Change Indicator */
-Name (UCL0, Package () { 0x88, 0xff, WR }) /* UCSI Control */
-Name (UCL1, Package () { 0x89, 0xff, WR }) /* UCSI Control */
-Name (UCL2, Package () { 0x8a, 0xff, WR }) /* UCSI Control */
-Name (UCL3, Package () { 0x8b, 0xff, WR }) /* UCSI Control */
-Name (UCL4, Package () { 0x8c, 0xff, WR }) /* UCSI Control */
-Name (UCL5, Package () { 0x8d, 0xff, WR }) /* UCSI Control */
-Name (UCL6, Package () { 0x8e, 0xff, WR }) /* UCSI Control */
-Name (UCL7, Package () { 0x8f, 0xff, WR }) /* UCSI Control */
-Name (UMI0, Package () { 0x90, 0xff, RD }) /* UCSI Message In */
-Name (UMI1, Package () { 0x91, 0xff, RD }) /* UCSI Message In */
-Name (UMI2, Package () { 0x92, 0xff, RD }) /* UCSI Message In */
-Name (UMI3, Package () { 0x93, 0xff, RD }) /* UCSI Message In */
-Name (UMI4, Package () { 0x94, 0xff, RD }) /* UCSI Message In */
-Name (UMI5, Package () { 0x95, 0xff, RD }) /* UCSI Message In */
-Name (UMI6, Package () { 0x96, 0xff, RD }) /* UCSI Message In */
-Name (UMI7, Package () { 0x97, 0xff, RD }) /* UCSI Message In */
-Name (UMI8, Package () { 0x98, 0xff, RD }) /* UCSI Message In */
-Name (UMI9, Package () { 0x99, 0xff, RD }) /* UCSI Message In */
-Name (UMIA, Package () { 0x9a, 0xff, RD }) /* UCSI Message In */
-Name (UMIB, Package () { 0x9b, 0xff, RD }) /* UCSI Message In */
-Name (UMIC, Package () { 0x9c, 0xff, RD }) /* UCSI Message In */
-Name (UMID, Package () { 0x9d, 0xff, RD }) /* UCSI Message In */
-Name (UMIE, Package () { 0x9e, 0xff, RD }) /* UCSI Message In */
-Name (UMIF, Package () { 0x9f, 0xff, RD }) /* UCSI Message In */
-Name (UMO0, Package () { 0xa0, 0xff, WR }) /* UCSI Message Out */
-Name (UMO1, Package () { 0xa1, 0xff, WR }) /* UCSI Message Out */
-Name (UMO2, Package () { 0xa2, 0xff, WR }) /* UCSI Message Out */
-Name (UMO3, Package () { 0xa3, 0xff, WR }) /* UCSI Message Out */
-Name (UMO4, Package () { 0xa4, 0xff, WR }) /* UCSI Message Out */
-Name (UMO5, Package () { 0xa5, 0xff, WR }) /* UCSI Message Out */
-Name (UMO6, Package () { 0xa6, 0xff, WR }) /* UCSI Message Out */
-Name (UMO7, Package () { 0xa7, 0xff, WR }) /* UCSI Message Out */
-Name (UMO8, Package () { 0xa8, 0xff, WR }) /* UCSI Message Out */
-Name (UMO9, Package () { 0xa9, 0xff, WR }) /* UCSI Message Out */
-Name (UMOA, Package () { 0xaa, 0xff, WR }) /* UCSI Message Out */
-Name (UMOB, Package () { 0xab, 0xff, WR }) /* UCSI Message Out */
-Name (UMOC, Package () { 0xac, 0xff, WR }) /* UCSI Message Out */
-Name (UMOD, Package () { 0xad, 0xff, WR }) /* UCSI Message Out */
-Name (UMOE, Package () { 0xae, 0xff, WR }) /* UCSI Message Out */
-Name (UMOF, Package () { 0xaf, 0xff, WR }) /* UCSI Message Out */
-Name (UCTL, Package () { 0xb0, 0xff, WR }) /* UCSI Control Register */
+Scope (\_SB)
+{
+ Name (RD, 0)
+ Name (WR, 1)
+
+ /*
+ * EC UCSI
+ */
+ Name (UVR0, Package () { 0x80, 0xff, RD }) /* UCSI Version */
+ Name (UVR1, Package () { 0x81, 0xff, RD }) /* UCSI Version */
+ Name (UCI0, Package () { 0x84, 0xff, RD }) /* UCSI Change Indicator */
+ Name (UCI1, Package () { 0x85, 0xff, RD }) /* UCSI Change Indicator */
+ Name (UCI2, Package () { 0x86, 0xff, RD }) /* UCSI Change Indicator */
+ Name (UCI3, Package () { 0x87, 0xff, RD }) /* UCSI Change Indicator */
+ Name (UCL0, Package () { 0x88, 0xff, WR }) /* UCSI Control */
+ Name (UCL1, Package () { 0x89, 0xff, WR }) /* UCSI Control */
+ Name (UCL2, Package () { 0x8a, 0xff, WR }) /* UCSI Control */
+ Name (UCL3, Package () { 0x8b, 0xff, WR }) /* UCSI Control */
+ Name (UCL4, Package () { 0x8c, 0xff, WR }) /* UCSI Control */
+ Name (UCL5, Package () { 0x8d, 0xff, WR }) /* UCSI Control */
+ Name (UCL6, Package () { 0x8e, 0xff, WR }) /* UCSI Control */
+ Name (UCL7, Package () { 0x8f, 0xff, WR }) /* UCSI Control */
+ Name (UMI0, Package () { 0x90, 0xff, RD }) /* UCSI Message In */
+ Name (UMI1, Package () { 0x91, 0xff, RD }) /* UCSI Message In */
+ Name (UMI2, Package () { 0x92, 0xff, RD }) /* UCSI Message In */
+ Name (UMI3, Package () { 0x93, 0xff, RD }) /* UCSI Message In */
+ Name (UMI4, Package () { 0x94, 0xff, RD }) /* UCSI Message In */
+ Name (UMI5, Package () { 0x95, 0xff, RD }) /* UCSI Message In */
+ Name (UMI6, Package () { 0x96, 0xff, RD }) /* UCSI Message In */
+ Name (UMI7, Package () { 0x97, 0xff, RD }) /* UCSI Message In */
+ Name (UMI8, Package () { 0x98, 0xff, RD }) /* UCSI Message In */
+ Name (UMI9, Package () { 0x99, 0xff, RD }) /* UCSI Message In */
+ Name (UMIA, Package () { 0x9a, 0xff, RD }) /* UCSI Message In */
+ Name (UMIB, Package () { 0x9b, 0xff, RD }) /* UCSI Message In */
+ Name (UMIC, Package () { 0x9c, 0xff, RD }) /* UCSI Message In */
+ Name (UMID, Package () { 0x9d, 0xff, RD }) /* UCSI Message In */
+ Name (UMIE, Package () { 0x9e, 0xff, RD }) /* UCSI Message In */
+ Name (UMIF, Package () { 0x9f, 0xff, RD }) /* UCSI Message In */
+ Name (UMO0, Package () { 0xa0, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO1, Package () { 0xa1, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO2, Package () { 0xa2, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO3, Package () { 0xa3, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO4, Package () { 0xa4, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO5, Package () { 0xa5, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO6, Package () { 0xa6, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO7, Package () { 0xa7, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO8, Package () { 0xa8, 0xff, WR }) /* UCSI Message Out */
+ Name (UMO9, Package () { 0xa9, 0xff, WR }) /* UCSI Message Out */
+ Name (UMOA, Package () { 0xaa, 0xff, WR }) /* UCSI Message Out */
+ Name (UMOB, Package () { 0xab, 0xff, WR }) /* UCSI Message Out */
+ Name (UMOC, Package () { 0xac, 0xff, WR }) /* UCSI Message Out */
+ Name (UMOD, Package () { 0xad, 0xff, WR }) /* UCSI Message Out */
+ Name (UMOE, Package () { 0xae, 0xff, WR }) /* UCSI Message Out */
+ Name (UMOF, Package () { 0xaf, 0xff, WR }) /* UCSI Message Out */
+ Name (UCTL, Package () { 0xb0, 0xff, WR }) /* UCSI Control Register */
+}
diff --git a/src/ec/google/wilco/acpi/event.asl b/src/ec/google/wilco/acpi/event.asl
index 3f59946817..e611ab0e22 100644
--- a/src/ec/google/wilco/acpi/event.asl
+++ b/src/ec/google/wilco/acpi/event.asl
@@ -141,7 +141,7 @@ Method (_Q79, 0, Serialized)
{
If (ISSX == 0) {
Printf ("EC _Q79 UCSI Event")
- Notify (^UCSI, 0x80)
+ Notify (\_SB.UCSI, 0x80)
^UCEP = 0
} Else {
Printf ("EC _Q79 UCSI Event Masked in S0ix")
diff --git a/src/ec/google/wilco/acpi/ucsi.asl b/src/ec/google/wilco/acpi/ucsi.asl
index 97e153b23a..a3f9750130 100644
--- a/src/ec/google/wilco/acpi/ucsi.asl
+++ b/src/ec/google/wilco/acpi/ucsi.asl
@@ -1,143 +1,155 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-Device (UCSI)
+Scope (\_SB)
{
- Name (_HID, "GOOG000E")
- Name (_CID, EisaId ("PNP0CA0"))
- Name (_DDN, "Wilco EC UCSI")
- Name (_UID, 1)
- Name (_STA, 0xb)
+ Device (UCSI)
+ {
+ Name (_HID, EisaId("USBC000"))
+ Name (_CID, Package { "GOOG000E", EisaId ("PNP0CA0") })
+ Name (_DDN, "Wilco EC UCSI")
+ Name (_UID, 1)
+ Name (_STA, 0xf)
- /* Value written to EC control register to start UCSI command */
- Name (UCMD, 0xE0)
+ /* Value written to EC control register to start UCSI command */
+ Name (UCMD, 0xE0)
- /* Shared memory fields are defined in the SSDT */
- External (VER0, FieldUnitObj)
- External (VER1, FieldUnitObj)
- External (CCI0, FieldUnitObj)
- External (CCI1, FieldUnitObj)
- External (CCI2, FieldUnitObj)
- External (CCI3, FieldUnitObj)
- External (CTL0, FieldUnitObj)
- External (CTL1, FieldUnitObj)
- External (CTL2, FieldUnitObj)
- External (CTL3, FieldUnitObj)
- External (CTL4, FieldUnitObj)
- External (CTL5, FieldUnitObj)
- External (CTL6, FieldUnitObj)
- External (CTL7, FieldUnitObj)
- External (MGI0, FieldUnitObj)
- External (MGI1, FieldUnitObj)
- External (MGI2, FieldUnitObj)
- External (MGI3, FieldUnitObj)
- External (MGI4, FieldUnitObj)
- External (MGI5, FieldUnitObj)
- External (MGI6, FieldUnitObj)
- External (MGI7, FieldUnitObj)
- External (MGI8, FieldUnitObj)
- External (MGI9, FieldUnitObj)
- External (MGIA, FieldUnitObj)
- External (MGIB, FieldUnitObj)
- External (MGIC, FieldUnitObj)
- External (MGID, FieldUnitObj)
- External (MGIE, FieldUnitObj)
- External (MGIF, FieldUnitObj)
- External (MGO0, FieldUnitObj)
- External (MGO1, FieldUnitObj)
- External (MGO2, FieldUnitObj)
- External (MGO3, FieldUnitObj)
- External (MGO4, FieldUnitObj)
- External (MGO5, FieldUnitObj)
- External (MGO6, FieldUnitObj)
- External (MGO7, FieldUnitObj)
- External (MGO8, FieldUnitObj)
- External (MGO9, FieldUnitObj)
- External (MGOA, FieldUnitObj)
- External (MGOB, FieldUnitObj)
- External (MGOC, FieldUnitObj)
- External (MGOD, FieldUnitObj)
- External (MGOE, FieldUnitObj)
- External (MGOF, FieldUnitObj)
+ /* Shared memory fields are defined in the SSDT */
+ External (VER0, FieldUnitObj)
+ External (VER1, FieldUnitObj)
+ External (CCI0, FieldUnitObj)
+ External (CCI1, FieldUnitObj)
+ External (CCI2, FieldUnitObj)
+ External (CCI3, FieldUnitObj)
+ External (CTL0, FieldUnitObj)
+ External (CTL1, FieldUnitObj)
+ External (CTL2, FieldUnitObj)
+ External (CTL3, FieldUnitObj)
+ External (CTL4, FieldUnitObj)
+ External (CTL5, FieldUnitObj)
+ External (CTL6, FieldUnitObj)
+ External (CTL7, FieldUnitObj)
+ External (MGI0, FieldUnitObj)
+ External (MGI1, FieldUnitObj)
+ External (MGI2, FieldUnitObj)
+ External (MGI3, FieldUnitObj)
+ External (MGI4, FieldUnitObj)
+ External (MGI5, FieldUnitObj)
+ External (MGI6, FieldUnitObj)
+ External (MGI7, FieldUnitObj)
+ External (MGI8, FieldUnitObj)
+ External (MGI9, FieldUnitObj)
+ External (MGIA, FieldUnitObj)
+ External (MGIB, FieldUnitObj)
+ External (MGIC, FieldUnitObj)
+ External (MGID, FieldUnitObj)
+ External (MGIE, FieldUnitObj)
+ External (MGIF, FieldUnitObj)
+ External (MGO0, FieldUnitObj)
+ External (MGO1, FieldUnitObj)
+ External (MGO2, FieldUnitObj)
+ External (MGO3, FieldUnitObj)
+ External (MGO4, FieldUnitObj)
+ External (MGO5, FieldUnitObj)
+ External (MGO6, FieldUnitObj)
+ External (MGO7, FieldUnitObj)
+ External (MGO8, FieldUnitObj)
+ External (MGO9, FieldUnitObj)
+ External (MGOA, FieldUnitObj)
+ External (MGOB, FieldUnitObj)
+ External (MGOC, FieldUnitObj)
+ External (MGOD, FieldUnitObj)
+ External (MGOE, FieldUnitObj)
+ External (MGOF, FieldUnitObj)
- Method (INIT)
- {
- /* Read UCSI version from EC into shared memory */
- ^VER0 = R (^^UVR0)
- ^VER1 = R (^^UVR1)
- }
+ Method (INIT)
+ {
+ /* Read UCSI version from EC into shared memory */
+ ^VER0 = R (^^UVR0)
+ ^VER1 = R (^^UVR1)
+ }
- Method (_DSM, 4, Serialized)
- {
- If (Arg0 != ToUUID ("6f8398c2-7ca4-11e4-ad36-631042b5008f")) {
- Return (Buffer (1) { 0 })
+ Method (R, 1, Serialized, 2){
+ Local0 = \_SB.PCI0.LPCB.EC0.R(Arg0)
+ Return (Local0)
}
- Switch (ToInteger (Arg2))
+ Method (W, 2, Serialized, 2){
+ \_SB.PCI0.LPCB.EC0.W(Arg0, Arg1)
+ }
+
+ Method (_DSM, 4, Serialized)
{
- Case (0)
- {
- Return (Buffer (1) { 0x07 })
+ If (Arg0 != ToUUID ("6f8398c2-7ca4-11e4-ad36-631042b5008f")) {
+ Return (Buffer (1) { 0 })
}
- Case (1)
+
+ Switch (ToInteger (Arg2))
{
- /* Write Message Out */
- W (^^UMO0, ^MGO0)
- W (^^UMO1, ^MGO1)
- W (^^UMO2, ^MGO2)
- W (^^UMO3, ^MGO3)
- W (^^UMO4, ^MGO4)
- W (^^UMO5, ^MGO5)
- W (^^UMO6, ^MGO6)
- W (^^UMO7, ^MGO7)
- W (^^UMO8, ^MGO8)
- W (^^UMO9, ^MGO9)
- W (^^UMOA, ^MGOA)
- W (^^UMOB, ^MGOB)
- W (^^UMOC, ^MGOC)
- W (^^UMOD, ^MGOD)
- W (^^UMOE, ^MGOE)
- W (^^UMOF, ^MGOF)
+ Case (0)
+ {
+ Return (Buffer (1) { 0x07 })
+ }
+ Case (1)
+ {
+ /* Write Message Out */
+ W (^^UMO0, ^MGO0)
+ W (^^UMO1, ^MGO1)
+ W (^^UMO2, ^MGO2)
+ W (^^UMO3, ^MGO3)
+ W (^^UMO4, ^MGO4)
+ W (^^UMO5, ^MGO5)
+ W (^^UMO6, ^MGO6)
+ W (^^UMO7, ^MGO7)
+ W (^^UMO8, ^MGO8)
+ W (^^UMO9, ^MGO9)
+ W (^^UMOA, ^MGOA)
+ W (^^UMOB, ^MGOB)
+ W (^^UMOC, ^MGOC)
+ W (^^UMOD, ^MGOD)
+ W (^^UMOE, ^MGOE)
+ W (^^UMOF, ^MGOF)
- /* Write Control */
- W (^^UCL0, ^CTL0)
- W (^^UCL1, ^CTL1)
- W (^^UCL2, ^CTL2)
- W (^^UCL3, ^CTL3)
- W (^^UCL4, ^CTL4)
- W (^^UCL5, ^CTL5)
- W (^^UCL6, ^CTL6)
- W (^^UCL7, ^CTL7)
+ /* Write Control */
+ W (^^UCL0, ^CTL0)
+ W (^^UCL1, ^CTL1)
+ W (^^UCL2, ^CTL2)
+ W (^^UCL3, ^CTL3)
+ W (^^UCL4, ^CTL4)
+ W (^^UCL5, ^CTL5)
+ W (^^UCL6, ^CTL6)
+ W (^^UCL7, ^CTL7)
- /* Start EC Command */
- W (^^UCTL, ^UCMD)
- }
- Case (2)
- {
- /* Read Message In */
- ^MGI0 = R (^^UMI0)
- ^MGI1 = R (^^UMI1)
- ^MGI2 = R (^^UMI2)
- ^MGI3 = R (^^UMI3)
- ^MGI4 = R (^^UMI4)
- ^MGI5 = R (^^UMI5)
- ^MGI6 = R (^^UMI6)
- ^MGI7 = R (^^UMI7)
- ^MGI8 = R (^^UMI8)
- ^MGI9 = R (^^UMI9)
- ^MGIA = R (^^UMIA)
- ^MGIB = R (^^UMIB)
- ^MGIC = R (^^UMIC)
- ^MGID = R (^^UMID)
- ^MGIE = R (^^UMIE)
- ^MGIF = R (^^UMIF)
+ /* Start EC Command */
+ W (^^UCTL, ^UCMD)
+ }
+ Case (2)
+ {
+ /* Read Message In */
+ ^MGI0 = R (^^UMI0)
+ ^MGI1 = R (^^UMI1)
+ ^MGI2 = R (^^UMI2)
+ ^MGI3 = R (^^UMI3)
+ ^MGI4 = R (^^UMI4)
+ ^MGI5 = R (^^UMI5)
+ ^MGI6 = R (^^UMI6)
+ ^MGI7 = R (^^UMI7)
+ ^MGI8 = R (^^UMI8)
+ ^MGI9 = R (^^UMI9)
+ ^MGIA = R (^^UMIA)
+ ^MGIB = R (^^UMIB)
+ ^MGIC = R (^^UMIC)
+ ^MGID = R (^^UMID)
+ ^MGIE = R (^^UMIE)
+ ^MGIF = R (^^UMIF)
- /* Read Status */
- ^CCI0 = R (^^UCI0)
- ^CCI1 = R (^^UCI1)
- ^CCI2 = R (^^UCI2)
- ^CCI3 = R (^^UCI3)
+ /* Read Status */
+ ^CCI0 = R (^^UCI0)
+ ^CCI1 = R (^^UCI1)
+ ^CCI2 = R (^^UCI2)
+ ^CCI3 = R (^^UCI3)
+ }
}
+ Return (Buffer (1) { 0 })
}
- Return (Buffer (1) { 0 })
}
}
diff --git a/src/ec/google/wilco/chip.c b/src/ec/google/wilco/chip.c
index 7d85c6fe0f..88d416da24 100644
--- a/src/ec/google/wilco/chip.c
+++ b/src/ec/google/wilco/chip.c
@@ -196,7 +196,7 @@ static void wilco_ec_fill_ssdt_generator(const struct device *dev)
opreg.regionoffset = (uintptr_t)region_ptr;
opreg.regionlen = ucsi_alloc_region_len;
- acpigen_write_scope(acpi_device_path_join(dev, "UCSI"));
+ acpigen_write_scope("\\_SB.UCSI");
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
acpigen_write_mem32fixed(1, (uintptr_t)region_ptr, ucsi_region_len);