mb/google/brya/acpi: Add minimum off timer for GCOFF
By moving the large wait for FBVDD discharge from PGOF
to PGON, the whole time may be avoided if enough time has
elapsed between the successive calls.
BUG=b:239719056
TEST=With Nvidia test software, verify ACPI prints
Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Change-Id: I891aa14f120d58c45b8965038a9d2f2a417b3f3d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66642
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Cliff Huang <cliff.huang@intel.com>
Reviewed-by: Ivy Jian <ivy.jian@quanta.corp-partner.google.com>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/mainboard/google/brya/acpi/power.asl b/src/mainboard/google/brya/acpi/power.asl
index 55f8dbd..618030b 100644
--- a/src/mainboard/google/brya/acpi/power.asl
+++ b/src/mainboard/google/brya/acpi/power.asl
@@ -19,6 +19,9 @@
#define GC6_DEFER_TYPE_EXIT_GC6 3
+/* 250ms in "Timer" units (i.e. 100ns increments) */
+#define MIN_OFF_TIME_TIMERS 2500000
+
/* Optimus Power Control State */
Name (OPCS, OPTIMUS_POWER_CONTROL_DISABLE)
@@ -45,6 +48,8 @@
Name (DFCI, 0)
/* Deferred GC6 Exit control */
Name (DFCO, 0)
+/* GCOFF Timer */
+Name (GCOT, 0)
/* "GC6 In", i.e. GC6 Entry Sequence */
Method (GC6I, 0, Serialized)
@@ -115,6 +120,14 @@
Return
}
+ Local0 = Timer - GCOT
+ If (Local0 < MIN_OFF_TIME_TIMERS)
+ {
+ Local1 = (MIN_OFF_TIME_TIMERS - Local0) / 10000
+ Printf("Sleeping %o to ensure min GCOFF time", Local1)
+ Sleep (Local1)
+ }
+
/* Assert PERST# */
\_SB.PCI0.CTXS (GPIO_GPU_PERST_L)
@@ -189,6 +202,8 @@
\_SB.PCI0.CTXS (GPIO_1V8_PWR_EN)
GPPL (GPIO_1V8_PG, 0, 20)
+ GCOT = Timer
+
GPPS = GPU_POWER_STATE_OFF
Printf ("GPU sequenced off")
}