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>
This commit is contained in:
Tim Wawrzynczak 2022-08-11 15:58:49 -06:00
parent 57acfad0bc
commit 74633b5580
1 changed files with 15 additions and 0 deletions

View File

@ -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 (DFEN, 0)
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 @@ Method (PGON, 0, Serialized)
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 @@ Method (PGOF, 0, Serialized)
\_SB.PCI0.CTXS (GPIO_1V8_PWR_EN)
GPPL (GPIO_1V8_PG, 0, 20)
GCOT = Timer
GPPS = GPU_POWER_STATE_OFF
Printf ("GPU sequenced off")
}