summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/dragonegg/gpio.inc4
-rw-r--r--board/tglrvpu_ite/gpio.inc16
-rw-r--r--board/volteer/gpio.inc3
-rw-r--r--power/icelake.c70
-rw-r--r--power/icelake.h1
5 files changed, 74 insertions, 20 deletions
diff --git a/board/dragonegg/gpio.inc b/board/dragonegg/gpio.inc
index 9b18d6f362..474bf49643 100644
--- a/board/dragonegg/gpio.inc
+++ b/board/dragonegg/gpio.inc
@@ -64,6 +64,10 @@ GPIO(EC_PCH_RSMRST_L, PIN(H, 0), GPIO_OUT_LOW)
GPIO(EC_PROCHOT_ODL, PIN(D, 0), GPIO_ODR_HIGH)
GPIO(PP5000_PG_OD, PIN(F, 0), GPIO_INPUT)
+/* SYS_PWROK generation is done by the Dialog power good IC */
+UNIMPLEMENTED(PG_EC_ALL_SYS_PWRGD)
+UNIMPLEMENTED(PCH_SYS_PWROK)
+
/* USB and USBC Signals */
GPIO(USB_OC_ODL, PIN(J, 6), GPIO_ODR_HIGH)
GPIO(EN_USB_A_5V, PIN(G, 6), GPIO_OUT_LOW)
diff --git a/board/tglrvpu_ite/gpio.inc b/board/tglrvpu_ite/gpio.inc
index d7acc76b92..d085647237 100644
--- a/board/tglrvpu_ite/gpio.inc
+++ b/board/tglrvpu_ite/gpio.inc
@@ -63,11 +63,25 @@ GPIO(SYS_RESET_L, PIN(B, 6), GPIO_ODR_HIGH)
GPIO(PCH_RSMRST_L, PIN(C, 6), GPIO_OUT_LOW)
GPIO(PCH_PWRBTN_L, PIN(D, 0), GPIO_ODR_HIGH)
GPIO(EC_SPI_OE_N, PIN(I, 2), GPIO_OUT_LOW)
-GPIO(PCH_SYS_PWROK, PIN(K, 4), GPIO_INPUT) /* Driven by Silego chip on RVP */
+/*
+ * PCH_SYS_PWROK is an input, driven by the Silego chip. The common x86
+ * power sequencing expects that PCH_SYS_PWROK is an output and will drive
+ * this signal if GPIO_PCH_SYS_PWROK is configured. Map this pin as no-connect
+ * so that state can be monitored using the console.
+ */
+GPIO(NC_PCH_SYS_PWROK, PIN(K, 4), GPIO_INPUT)
GPIO(EN_PP5000, PIN(L, 4), GPIO_OUT_LOW)
GPIO(EN_PP3300_A, PIN(K, 2), GPIO_OUT_LOW)
GPIO(EC_PCH_DSW_PWROK, PIN(L, 6), GPIO_OUT_LOW)
+/*
+ * SYS_PWROK driven directly to AP by Silego, EC not needed for generation.
+ * PCH_SYS_PWROK is routed to EC, but mark unimplemented to prevent common
+ * Ice Lake code from driving signal.
+ */
+UNIMPLEMENTED(PG_EC_ALL_SYS_PWRGD)
+UNIMPLEMENTED(PCH_SYS_PWROK)
+
/* Host communication GPIOs */
GPIO(PCH_WAKE_L, PIN(J, 0), GPIO_ODR_HIGH)
#ifndef CONFIG_HOSTCMD_ESPI
diff --git a/board/volteer/gpio.inc b/board/volteer/gpio.inc
index fee9e6f0c6..7f59cc0ab5 100644
--- a/board/volteer/gpio.inc
+++ b/board/volteer/gpio.inc
@@ -22,6 +22,7 @@ GPIO_INT(SLP_S3_L, PIN(A, 5), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(SLP_SUS_L, PIN(D, 7), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(PG_EC_RSMRST_ODL, PIN(E, 2), GPIO_INT_BOTH, power_signal_interrupt)
GPIO_INT(DSW_PWROK, PIN(C, 7), GPIO_INT_BOTH, power_signal_interrupt)
+GPIO_INT(PG_EC_ALL_SYS_PWRGD, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt)
/* Sensor Interrupts */
@@ -50,7 +51,7 @@ GPIO(EC_RST_ODL, PIN(0, 2), GPIO_INT_BOTH |
GPIO_LOCKED)
/* AP/PCH Signals */
-GPIO(EC_PCH_SYS_PWROK, PIN(3, 7), GPIO_OUT_LOW) /* TODO - b/140556273 - implement support with power sequencing */
+GPIO(EC_PCH_SYS_PWROK, PIN(3, 7), GPIO_OUT_LOW)
GPIO(EC_PCH_RSMRST_ODL, PIN(A, 6), GPIO_ODR_HIGH) /* TODO - b/140950085 - implement TGL sequencing requirement */
GPIO(EC_PCH_PWR_BTN_ODL, PIN(C, 1), GPIO_ODR_HIGH)
GPIO(EC_PCH_RTCRST, PIN(7, 6), GPIO_OUT_LOW)
diff --git a/power/icelake.c b/power/icelake.c
index 175a4269b3..66c7105ca6 100644
--- a/power/icelake.c
+++ b/power/icelake.c
@@ -25,34 +25,40 @@ static int forcing_shutdown; /* Forced shutdown in progress? */
/* Power signals list. Must match order of enum power_signal. */
const struct power_signal_info power_signal_list[] = {
[X86_SLP_S0_DEASSERTED] = {
- GPIO_PCH_SLP_S0_L,
- POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT,
- "SLP_S0_DEASSERTED",
+ .gpio = GPIO_PCH_SLP_S0_L,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH |
+ POWER_SIGNAL_DISABLE_AT_BOOT,
+ .name = "SLP_S0_DEASSERTED",
},
[X86_SLP_S3_DEASSERTED] = {
- SLP_S3_SIGNAL_L,
- POWER_SIGNAL_ACTIVE_HIGH,
- "SLP_S3_DEASSERTED",
+ .gpio = SLP_S3_SIGNAL_L,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "SLP_S3_DEASSERTED",
},
[X86_SLP_S4_DEASSERTED] = {
- SLP_S4_SIGNAL_L,
- POWER_SIGNAL_ACTIVE_HIGH,
- "SLP_S4_DEASSERTED",
+ .gpio = SLP_S4_SIGNAL_L,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "SLP_S4_DEASSERTED",
},
[X86_SLP_SUS_DEASSERTED] = {
- GPIO_SLP_SUS_L,
- POWER_SIGNAL_ACTIVE_HIGH,
- "SLP_SUS_DEASSERTED",
+ .gpio = GPIO_SLP_SUS_L,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "SLP_SUS_DEASSERTED",
},
[X86_RSMRST_L_PGOOD] = {
- GPIO_PG_EC_RSMRST_ODL,
- POWER_SIGNAL_ACTIVE_HIGH,
- "RSMRST_L_PGOOD",
+ .gpio = GPIO_PG_EC_RSMRST_ODL,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "RSMRST_L_PGOOD",
},
[X86_DSW_DPWROK] = {
- GPIO_PG_EC_DSW_PWROK,
- POWER_SIGNAL_ACTIVE_HIGH,
- "DSW_DPWROK",
+ .gpio = GPIO_PG_EC_DSW_PWROK,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "DSW_DPWROK",
+ },
+ [X86_ALL_SYS_PGOOD] = {
+ .gpio = GPIO_PG_EC_ALL_SYS_PWRGD,
+ .flags = POWER_SIGNAL_ACTIVE_HIGH,
+ .name = "ALL_SYS_PWRGD",
},
};
BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT);
@@ -117,10 +123,22 @@ enum power_state chipset_force_g3(void)
return POWER_G3;
}
+/*
+ * Ice Lake and Tiger Lake permit PCH_PWROK and SYS_PWROK signals coming
+ * up in any order. If the platform needs extra time for peripherals to come
+ * up, the board can override this function.
+ */
+__overridable void board_icl_tgl_all_sys_pwrgood(void)
+{
+
+}
+
enum power_state power_handle_state(enum power_state state)
{
int dswpwrok_in = gpio_get_level(GPIO_PG_EC_DSW_PWROK);
static int dswpwrok_out = -1;
+ int all_sys_pwrgd_in;
+ int all_sys_pwrgd_out;
/* Pass-through DSW_PWROK to ICL. */
if (dswpwrok_in != dswpwrok_out) {
@@ -189,6 +207,22 @@ enum power_state power_handle_state(enum power_state state)
return POWER_S5G3;
break;
+ case POWER_S0:
+ /*
+ * Check value of PG_EC_ALL_SYS_PWRGD to see if PCH_SYS_PWROK
+ * needs to be changed. If it's low->high transition, call board
+ * specific handling if provided.
+ */
+ all_sys_pwrgd_in = gpio_get_level(GPIO_PG_EC_ALL_SYS_PWRGD);
+ all_sys_pwrgd_out = gpio_get_level(GPIO_PCH_SYS_PWROK);
+
+ if (all_sys_pwrgd_in != all_sys_pwrgd_out) {
+ if (all_sys_pwrgd_in)
+ board_icl_tgl_all_sys_pwrgood();
+ gpio_set_level(GPIO_PCH_SYS_PWROK, all_sys_pwrgd_in);
+ }
+ break;
+
default:
break;
}
diff --git a/power/icelake.h b/power/icelake.h
index 5eeb3fb037..c051a2516a 100644
--- a/power/icelake.h
+++ b/power/icelake.h
@@ -34,6 +34,7 @@ enum power_signal {
X86_SLP_SUS_DEASSERTED,
X86_RSMRST_L_PGOOD,
X86_DSW_DPWROK,
+ X86_ALL_SYS_PGOOD,
/* Number of X86 signals */
POWER_SIGNAL_COUNT