board/system76/common: use SLP_S0# pin for modern standby detection

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ć <michal.kopec@3mdeb.com>
This commit is contained in:
Michał Kopeć
2022-07-25 15:48:11 +02:00
committed by Tim Crawford
parent 49abf83c08
commit cc3effb6a4
2 changed files with 4 additions and 4 deletions

View File

@ -127,8 +127,8 @@ uint8_t peci_get_fan_duty(void) {
uint8_t duty; uint8_t duty;
#if USE_S0IX #if USE_S0IX
// Use PECI if CPU is not in C10 state // Use PECI if platform is not in CS
peci_on = gpio_get(&CPU_C10_GATE_N); peci_on = gpio_get(&SLP_S0_N);
#else // USE_S0IX #else // USE_S0IX
// Use PECI if in S0 state // Use PECI if in S0 state
peci_on = power_state == POWER_STATE_S0; peci_on = power_state == POWER_STATE_S0;

View File

@ -318,7 +318,7 @@ void power_set_limit(void) {
static bool last_power_limit_ac = true; static bool last_power_limit_ac = true;
// We don't use power_state because the latency needs to be low // We don't use power_state because the latency needs to be low
#if USE_S0IX #if USE_S0IX
if (gpio_get(&CPU_C10_GATE_N)) { if (gpio_get(&SLP_S0_N)) {
#else #else
if (gpio_get(&BUF_PLT_RST_N)) { if (gpio_get(&BUF_PLT_RST_N)) {
#endif #endif
@ -552,7 +552,7 @@ void power_event(void) {
uint32_t time = time_get(); uint32_t time = time_get();
if (power_state == POWER_STATE_S0) { if (power_state == POWER_STATE_S0) {
#if USE_S0IX #if USE_S0IX
if (!gpio_get(&CPU_C10_GATE_N)) { if (!gpio_get(&SLP_S0_N)) {
// Modern suspend, flashing green light // Modern suspend, flashing green light
if ((time - last_time) >= 1000) { if ((time - last_time) >= 1000) {
gpio_set(&LED_PWR, !gpio_get(&LED_PWR)); gpio_set(&LED_PWR, !gpio_get(&LED_PWR));