summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSue Chen <sue.chen@quanta.corp-partner.google.com>2022-01-12 14:36:11 +0800
committerCommit Bot <commit-bot@chromium.org>2022-03-22 07:56:36 +0000
commit4481408005a325a7246cefe15d305eb1975c8fac (patch)
treef6c6c4d426796f6de0f9bde550cd9dc22693b756
parent034349a6adec58a3290a4253c5178b69a5e0698c (diff)
downloadchrome-ec-4481408005a325a7246cefe15d305eb1975c8fac.tar.gz
Scout: Power off TPU and IMX8 in S0ix
Turn off PP3300_TPU_A_EN and EC_IMX8_EN in S0ix. EC_IMX8_EN is for PP5000_MX8M. BUG=b:200923497 BRANCH=puff TEST=check power consumption in suspend. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I9bd4bfa945cb95d62fc104670089e51f7bbb40ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3382598 Reviewed-by: Joe Tessler <jrt@chromium.org> Commit-Queue: Joe Tessler <jrt@chromium.org>
-rw-r--r--board/scout/board.c8
-rw-r--r--board/scout/gpio.inc2
-rw-r--r--include/power/cometlake-discrete.h7
-rw-r--r--power/cometlake-discrete.c15
4 files changed, 31 insertions, 1 deletions
diff --git a/board/scout/board.c b/board/scout/board.c
index 9489982f75..2abbf92c54 100644
--- a/board/scout/board.c
+++ b/board/scout/board.c
@@ -556,6 +556,7 @@ void board_enable_s0_rails(int enable)
* Toggle scaler power and its downstream USB devices.
*/
gpio_set_level(GPIO_EC_SCALER_EN, enable);
+ gpio_set_level(GPIO_EC_IMX8_EN, enable);
gpio_set_level(GPIO_PWR_CTRL, enable);
gpio_set_level(GPIO_EC_MX8M_ONOFF, enable);
gpio_set_level(GPIO_EC_CAM_V3P3_EN, enable);
@@ -565,6 +566,13 @@ void board_enable_s0_rails(int enable)
gpio_set_level(GPIO_EN_LOAD_SWITCH, enable);
}
+__override void board_enable_s0ix_rails(int enable)
+{
+ /* Turn off TPU power to reduce power consumption */
+ gpio_set_level(GPIO_PP3300_TPU_A_EN, !enable);
+ gpio_set_level(GPIO_EC_IMX8_EN, !enable);
+}
+
int ec_config_get_usb4_present(void)
{
return !(fw_config & EC_CFG_NO_USB4_MASK);
diff --git a/board/scout/gpio.inc b/board/scout/gpio.inc
index 364d31c349..914dbe8639 100644
--- a/board/scout/gpio.inc
+++ b/board/scout/gpio.inc
@@ -85,6 +85,7 @@ GPIO(EN_IMVP8_VR, PIN(F, 4), GPIO_OUT_LOW)
GPIO(EC_CAM_V3P3_EN, PIN(C, 6), GPIO_OUT_LOW)
GPIO(EC_MX8M_ONOFF, PIN(9, 3), GPIO_OUT_LOW)
GPIO(EC_SCALER_EN, PIN(E, 0), GPIO_OUT_LOW)
+GPIO(EC_IMX8_EN, PIN(C, 0), GPIO_OUT_LOW)
GPIO(PP3300_TPU_A_EN, PIN(B, 0), GPIO_OUT_LOW)
GPIO(PWR_CTRL, PIN(6, 2), GPIO_OUT_LOW)
GPIO(EN_LOAD_SWITCH, PIN(4, 2), GPIO_OUT_LOW)
@@ -154,7 +155,6 @@ ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART from EC
/* Unused pins */
UNUSED(PIN(1, 3)) /* EC_GP_SEL1_ODL */
-UNUSED(PIN(C, 0)) /* FAN_PWM_2 */
UNUSED(PIN(8, 0)) /* LED_BLUE_L */
UNUSED(PIN(C, 2)) /* A12 NC */
UNUSED(PIN(1, 2)) /* C6 NC */
diff --git a/include/power/cometlake-discrete.h b/include/power/cometlake-discrete.h
index ae1d51c32b..c767ddf00b 100644
--- a/include/power/cometlake-discrete.h
+++ b/include/power/cometlake-discrete.h
@@ -108,6 +108,13 @@ enum power_signal {
void board_enable_s0_rails(int enable);
/*
+ * Board-specific enable for any additional rails in S0ix
+ *
+ * Input 0 to turn off, 1 to turn on.
+ */
+__override_proto void board_enable_s0ix_rails(int enable);
+
+/*
* Board-specific flag for whether EN_S0_RAILS can be turned off when
* CPU_C10_GATED is asserted by the PCH.
*
diff --git a/power/cometlake-discrete.c b/power/cometlake-discrete.c
index a22e32a69f..d53c3e7154 100644
--- a/power/cometlake-discrete.c
+++ b/power/cometlake-discrete.c
@@ -207,6 +207,11 @@ static void shutdown_s5_rails(void)
#endif
}
+__overridable void board_enable_s0ix_rails(int enable)
+{
+ /* Board-specific enable for any additional rails in S0ix */
+}
+
void chipset_force_shutdown(enum chipset_shutdown_reason reason)
{
CPRINTS("%s(%d)", __func__, reason);
@@ -349,6 +354,16 @@ enum power_state power_handle_state(enum power_state state)
shutdown_s0_rails();
break;
+#ifdef CONFIG_POWER_S0IX
+ case POWER_S0ixS0:
+ board_enable_s0ix_rails(0);
+ break;
+
+ case POWER_S0S0ix:
+ board_enable_s0ix_rails(1);
+ break;
+#endif
+
case POWER_S5:
/*
* Return to G3 if S5 rails are not on, probably because of