From 74633b5580c7072262aa0aa753ce42d5b6c0d509 Mon Sep 17 00:00:00 2001 From: Tim Wawrzynczak Date: Thu, 11 Aug 2022 15:58:49 -0600 Subject: 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 Change-Id: I891aa14f120d58c45b8965038a9d2f2a417b3f3d Reviewed-on: https://review.coreboot.org/c/coreboot/+/66642 Tested-by: build bot (Jenkins) Reviewed-by: Cliff Huang Reviewed-by: Ivy Jian Reviewed-by: Eric Lai --- src/mainboard/google/brya/acpi/power.asl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mainboard') diff --git a/src/mainboard/google/brya/acpi/power.asl b/src/mainboard/google/brya/acpi/power.asl index 55f8dbda8f..618030b4fd 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 (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") } -- cgit v1.2.3