From cc3effb6a451e43ce69e0f9133e76476e7aa2c37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Kope=C4=87?= Date: Mon, 25 Jul 2022 15:48:11 +0200 Subject: [PATCH] board/system76/common: use SLP_S0# pin for modern standby detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, CPU_C10_GATE# was used for detecting entry into s0ix / Modern Standby. Intel documentation says that SLP_S0# should be used for s0ix detection instead, and CPU_C10_GATE# is intended for VCCSTG power gating, so switch the pin to improve s0ix detection reliability. Fixes https://github.com/system76/firmware-open/issues/199 References: - Intel docs #575570 rev 0.5, #607872 rev 2.2 - Chromium EC: https://chromium.googlesource.com/chromiumos/platform/ec/+/master/power/intel_x86.c#41 Signed-off-by: Michał Kopeć --- src/board/system76/common/peci.c | 4 ++-- src/board/system76/common/power.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/board/system76/common/peci.c b/src/board/system76/common/peci.c index dac2a13..0e2e922 100644 --- a/src/board/system76/common/peci.c +++ b/src/board/system76/common/peci.c @@ -127,8 +127,8 @@ uint8_t peci_get_fan_duty(void) { uint8_t duty; #if USE_S0IX - // Use PECI if CPU is not in C10 state - peci_on = gpio_get(&CPU_C10_GATE_N); + // Use PECI if platform is not in CS + peci_on = gpio_get(&SLP_S0_N); #else // USE_S0IX // Use PECI if in S0 state peci_on = power_state == POWER_STATE_S0; diff --git a/src/board/system76/common/power.c b/src/board/system76/common/power.c index 65fe840..5ba4624 100644 --- a/src/board/system76/common/power.c +++ b/src/board/system76/common/power.c @@ -318,7 +318,7 @@ void power_set_limit(void) { static bool last_power_limit_ac = true; // We don't use power_state because the latency needs to be low #if USE_S0IX - if (gpio_get(&CPU_C10_GATE_N)) { + if (gpio_get(&SLP_S0_N)) { #else if (gpio_get(&BUF_PLT_RST_N)) { #endif @@ -552,7 +552,7 @@ void power_event(void) { uint32_t time = time_get(); if (power_state == POWER_STATE_S0) { #if USE_S0IX - if (!gpio_get(&CPU_C10_GATE_N)) { + if (!gpio_get(&SLP_S0_N)) { // Modern suspend, flashing green light if ((time - last_time) >= 1000) { gpio_set(&LED_PWR, !gpio_get(&LED_PWR));