From 89e915e98131249c7e1584e86c2efc3e482e214b Mon Sep 17 00:00:00 2001 From: CoolStar Date: Sun, 26 Mar 2023 02:35:43 -0700 Subject: [PATCH] ec/google/wilco/acpi: Fix S3/S4 support - Only run _REG on attach - Reinitialize on WAK to support S3 / Hibernate Adjustments taken from EC ACPI on Dell 5400/7410 Windows devices. TEST=build/boot google/drallion, verify S3 sleep works properly as well as S0ix. Change-Id: I162d02c7d3c81f1106ddc65a3804f7112dda66b2 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/87488 Reviewed-by: Caveh Jalali Reviewed-by: Boris Mittelberg Tested-by: build bot (Jenkins) --- src/ec/google/wilco/acpi/ec.asl | 4 ++++ src/ec/google/wilco/acpi/platform.asl | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/ec/google/wilco/acpi/ec.asl b/src/ec/google/wilco/acpi/ec.asl index 2e8432844b..806f6086d7 100644 --- a/src/ec/google/wilco/acpi/ec.asl +++ b/src/ec/google/wilco/acpi/ec.asl @@ -29,6 +29,10 @@ Device (EC0) OperationRegion (ERAM, EmbeddedControl, 0, 0xff) Method (_REG, 2) { + If (Arg1 != 1) { + Return () + } + /* Indicate region is registered */ EREG = Arg1 diff --git a/src/ec/google/wilco/acpi/platform.asl b/src/ec/google/wilco/acpi/platform.asl index f815a3533c..cd23512ef9 100644 --- a/src/ec/google/wilco/acpi/platform.asl +++ b/src/ec/google/wilco/acpi/platform.asl @@ -4,12 +4,30 @@ Method (PTS, 1, Serialized) { Printf ("EC _PTS") - W (FPTS, Arg0) + If (EREG){ + W (FPTS, Arg0) + } } /* Call from \_SB._WAK() */ Method (WAK, 1, Serialized) { Printf ("EC _WAK") - W (FWAK, Arg0) + If (EREG){ + W (FWAK, Arg0) + + /* Indicate to EC that OS is ready for queries */ + W (ERDY, 1) + + /* Indicate that the OS supports S0ix */ + W (CSOS, 1) + + /* Tell EC to stop emulating PS/2 mouse */ + W (PS2M, 0) + + /* Enable DPTF support if enabled in devicetree */ + If (\DPTE == 1) { + W (DWST, 1) + } + } }