Add config for using S0ix
S0ix does not require eSPI, and eSPI does not mandate S0ix. Enable S0ix for: - darp7 (TGL-U) - darp8 (ADL-P) - galp5 (TGL-U) - galp6 (ADL-P) - lemp10 (TGL-U) - lemp11 (ADL-U) It is also currently enabled on ADL-H due to a bug with S3: - gaze17-3050 - gaze17-3060-b - oryp9 Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Tim Crawford
parent
b78631e316
commit
49abf83c08
@ -10,6 +10,10 @@
|
||||
#include <ec/gpio.h>
|
||||
#include <ec/pwm.h>
|
||||
|
||||
#ifndef USE_S0IX
|
||||
#define USE_S0IX 0
|
||||
#endif
|
||||
|
||||
// Fan speed is the lowest requested over HEATUP seconds
|
||||
#ifndef BOARD_HEATUP
|
||||
#define BOARD_HEATUP 4
|
||||
@ -122,13 +126,13 @@ int16_t peci_wr_pkg_config(uint8_t index, uint16_t param, uint32_t data) {
|
||||
uint8_t peci_get_fan_duty(void) {
|
||||
uint8_t duty;
|
||||
|
||||
#if EC_ESPI
|
||||
#if USE_S0IX
|
||||
// Use PECI if CPU is not in C10 state
|
||||
peci_on = gpio_get(&CPU_C10_GATE_N);
|
||||
#else // EC_ESPI
|
||||
#else // USE_S0IX
|
||||
// Use PECI if in S0 state
|
||||
peci_on = power_state == POWER_STATE_S0;
|
||||
#endif // EC_ESPI
|
||||
#endif // USE_S0IX
|
||||
|
||||
if (peci_on) {
|
||||
// Wait for completion
|
||||
|
@ -21,6 +21,10 @@
|
||||
#include <board/espi.h>
|
||||
#endif
|
||||
|
||||
#ifndef USE_S0IX
|
||||
#define USE_S0IX 0
|
||||
#endif
|
||||
|
||||
#define GPIO_SET_DEBUG(G, V) { \
|
||||
DEBUG("%s = %s\n", #G, V ? "true" : "false"); \
|
||||
gpio_set(&G, V); \
|
||||
@ -313,7 +317,7 @@ static bool power_peci_limit(bool ac) {
|
||||
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 EC_ESPI
|
||||
#if USE_S0IX
|
||||
if (gpio_get(&CPU_C10_GATE_N)) {
|
||||
#else
|
||||
if (gpio_get(&BUF_PLT_RST_N)) {
|
||||
@ -547,7 +551,7 @@ void power_event(void) {
|
||||
static uint32_t last_time = 0;
|
||||
uint32_t time = time_get();
|
||||
if (power_state == POWER_STATE_S0) {
|
||||
#if EC_ESPI
|
||||
#if USE_S0IX
|
||||
if (!gpio_get(&CPU_C10_GATE_N)) {
|
||||
// Modern suspend, flashing green light
|
||||
if ((time - last_time) >= 1000) {
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# Use S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=15in_102
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# Use S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=15in_102
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# Use S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=14in_83
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# Use S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=14in_83
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# FIXME: Use S3 instead of S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=15in_102
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# FIXME: Use S3 instead of S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=15in_102
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# Use S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=14in_83
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# Use S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=14in_83
|
||||
|
||||
|
@ -5,6 +5,9 @@ EC=it5570e
|
||||
# Enable eSPI
|
||||
CFLAGS+=-DEC_ESPI=1
|
||||
|
||||
# FIXME: Use S3 instead of S0ix
|
||||
CFLAGS+=-DUSE_S0IX=1
|
||||
|
||||
# Include keyboard
|
||||
KEYBOARD=15in_102
|
||||
|
||||
|
Reference in New Issue
Block a user