From d96147688d6e71e8f2be4b5f70a16246a38eef9e Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 17 Mar 2020 12:49:11 -0600 Subject: [PATCH] Fix calculation of S3 power state, remove S4 power state --- .../system76/darp5/include/board/power.h | 2 -- src/board/system76/darp5/power.c | 23 +++++-------------- .../system76/galp3-c/include/board/power.h | 2 -- src/board/system76/galp3-c/power.c | 23 +++++-------------- .../system76/lemp9/include/board/power.h | 2 -- src/board/system76/lemp9/power.c | 23 +++++-------------- 6 files changed, 18 insertions(+), 57 deletions(-) diff --git a/src/board/system76/darp5/include/board/power.h b/src/board/system76/darp5/include/board/power.h index 029f12a..9c29f84 100644 --- a/src/board/system76/darp5/include/board/power.h +++ b/src/board/system76/darp5/include/board/power.h @@ -5,8 +5,6 @@ enum PowerState { POWER_STATE_DEFAULT, POWER_STATE_DS5, POWER_STATE_S5, - POWER_STATE_DS4, - POWER_STATE_S4, POWER_STATE_DS3, POWER_STATE_S3, POWER_STATE_S0, diff --git a/src/board/system76/darp5/power.c b/src/board/system76/darp5/power.c index aaf3a70..38b1b29 100644 --- a/src/board/system76/darp5/power.c +++ b/src/board/system76/darp5/power.c @@ -56,19 +56,14 @@ enum PowerState power_state = POWER_STATE_DEFAULT; enum PowerState calculate_power_state(void) { //TODO: Deep Sx states using SLP_SUS# - if (gpio_get(&BUF_PLT_RST_N)) { - // CPU powered + if (gpio_get(&SUSB_N_PCH)) { + // S3, S4, and S5 planes powered return POWER_STATE_S0; } - if (gpio_get(&SUSB_N_PCH)) { - // S3 plane powered - return POWER_STATE_S3; - } - if (gpio_get(&SUSC_N_PCH)) { - // S4 plane powered - return POWER_STATE_S4; + // S4 and S5 planes powered + return POWER_STATE_S3; } if (gpio_get(&EC_RSMRST_N)) { @@ -103,12 +98,6 @@ void update_power_state(void) { case POWER_STATE_S5: DEBUG("POWER_STATE_S5\n"); break; - case POWER_STATE_DS4: - DEBUG("POWER_STATE_DS4\n"); - break; - case POWER_STATE_S4: - DEBUG("POWER_STATE_S4\n"); - break; case POWER_STATE_DS3: DEBUG("POWER_STATE_DS3\n"); break; @@ -165,9 +154,9 @@ void power_on_s5(void) { // TODO - signal timing graph // See Figure 12-24 in Whiskey Lake Platform Design Guide // TODO - rail timing graph - + // TODO: Must have SL_SUS# set high by PCH - + // Enable VCCPRIM_* planes - must be enabled prior to USB power in order to // avoid leakage gpio_set(&VA_EC_EN, true); diff --git a/src/board/system76/galp3-c/include/board/power.h b/src/board/system76/galp3-c/include/board/power.h index 029f12a..9c29f84 100644 --- a/src/board/system76/galp3-c/include/board/power.h +++ b/src/board/system76/galp3-c/include/board/power.h @@ -5,8 +5,6 @@ enum PowerState { POWER_STATE_DEFAULT, POWER_STATE_DS5, POWER_STATE_S5, - POWER_STATE_DS4, - POWER_STATE_S4, POWER_STATE_DS3, POWER_STATE_S3, POWER_STATE_S0, diff --git a/src/board/system76/galp3-c/power.c b/src/board/system76/galp3-c/power.c index a9dc1d4..0af724a 100644 --- a/src/board/system76/galp3-c/power.c +++ b/src/board/system76/galp3-c/power.c @@ -55,19 +55,14 @@ enum PowerState power_state = POWER_STATE_DEFAULT; enum PowerState calculate_power_state(void) { //TODO: Deep Sx states using SLP_SUS# - if (gpio_get(&BUF_PLT_RST_N)) { - // CPU powered + if (gpio_get(&SUSB_N_PCH)) { + // S3, S4, and S5 planes powered return POWER_STATE_S0; } - if (gpio_get(&SUSB_N_PCH)) { - // S3 plane powered - return POWER_STATE_S3; - } - if (gpio_get(&SUSC_N_PCH)) { - // S4 plane powered - return POWER_STATE_S4; + // S4 and S5 planes powered + return POWER_STATE_S3; } if (gpio_get(&EC_RSMRST_N)) { @@ -102,12 +97,6 @@ void update_power_state(void) { case POWER_STATE_S5: DEBUG("POWER_STATE_S5\n"); break; - case POWER_STATE_DS4: - DEBUG("POWER_STATE_DS4\n"); - break; - case POWER_STATE_S4: - DEBUG("POWER_STATE_S4\n"); - break; case POWER_STATE_DS3: DEBUG("POWER_STATE_DS3\n"); break; @@ -164,9 +153,9 @@ void power_on_s5(void) { // TODO - signal timing graph // See Figure 12-24 in Whiskey Lake Platform Design Guide // TODO - rail timing graph - + // TODO: Must have SL_SUS# set high by PCH - + // Enable VCCPRIM_* planes - must be enabled prior to USB power in order to // avoid leakage gpio_set(&VA_EC_EN, true); diff --git a/src/board/system76/lemp9/include/board/power.h b/src/board/system76/lemp9/include/board/power.h index 029f12a..9c29f84 100644 --- a/src/board/system76/lemp9/include/board/power.h +++ b/src/board/system76/lemp9/include/board/power.h @@ -5,8 +5,6 @@ enum PowerState { POWER_STATE_DEFAULT, POWER_STATE_DS5, POWER_STATE_S5, - POWER_STATE_DS4, - POWER_STATE_S4, POWER_STATE_DS3, POWER_STATE_S3, POWER_STATE_S0, diff --git a/src/board/system76/lemp9/power.c b/src/board/system76/lemp9/power.c index a9dc1d4..0af724a 100644 --- a/src/board/system76/lemp9/power.c +++ b/src/board/system76/lemp9/power.c @@ -55,19 +55,14 @@ enum PowerState power_state = POWER_STATE_DEFAULT; enum PowerState calculate_power_state(void) { //TODO: Deep Sx states using SLP_SUS# - if (gpio_get(&BUF_PLT_RST_N)) { - // CPU powered + if (gpio_get(&SUSB_N_PCH)) { + // S3, S4, and S5 planes powered return POWER_STATE_S0; } - if (gpio_get(&SUSB_N_PCH)) { - // S3 plane powered - return POWER_STATE_S3; - } - if (gpio_get(&SUSC_N_PCH)) { - // S4 plane powered - return POWER_STATE_S4; + // S4 and S5 planes powered + return POWER_STATE_S3; } if (gpio_get(&EC_RSMRST_N)) { @@ -102,12 +97,6 @@ void update_power_state(void) { case POWER_STATE_S5: DEBUG("POWER_STATE_S5\n"); break; - case POWER_STATE_DS4: - DEBUG("POWER_STATE_DS4\n"); - break; - case POWER_STATE_S4: - DEBUG("POWER_STATE_S4\n"); - break; case POWER_STATE_DS3: DEBUG("POWER_STATE_DS3\n"); break; @@ -164,9 +153,9 @@ void power_on_s5(void) { // TODO - signal timing graph // See Figure 12-24 in Whiskey Lake Platform Design Guide // TODO - rail timing graph - + // TODO: Must have SL_SUS# set high by PCH - + // Enable VCCPRIM_* planes - must be enabled prior to USB power in order to // avoid leakage gpio_set(&VA_EC_EN, true);