Skip to content

Commit 4481408

Browse files
Sue ChenCommit Bot
authored andcommitted
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 <[email protected]> Change-Id: I9bd4bfa945cb95d62fc104670089e51f7bbb40ae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3382598 Reviewed-by: Joe Tessler <[email protected]> Commit-Queue: Joe Tessler <[email protected]>
1 parent 034349a commit 4481408

File tree

4 files changed

+31
-1
lines changed

4 files changed

+31
-1
lines changed

board/scout/board.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,7 @@ void board_enable_s0_rails(int enable)
556556
* Toggle scaler power and its downstream USB devices.
557557
*/
558558
gpio_set_level(GPIO_EC_SCALER_EN, enable);
559+
gpio_set_level(GPIO_EC_IMX8_EN, enable);
559560
gpio_set_level(GPIO_PWR_CTRL, enable);
560561
gpio_set_level(GPIO_EC_MX8M_ONOFF, enable);
561562
gpio_set_level(GPIO_EC_CAM_V3P3_EN, enable);
@@ -565,6 +566,13 @@ void board_enable_s0_rails(int enable)
565566
gpio_set_level(GPIO_EN_LOAD_SWITCH, enable);
566567
}
567568

569+
__override void board_enable_s0ix_rails(int enable)
570+
{
571+
/* Turn off TPU power to reduce power consumption */
572+
gpio_set_level(GPIO_PP3300_TPU_A_EN, !enable);
573+
gpio_set_level(GPIO_EC_IMX8_EN, !enable);
574+
}
575+
568576
int ec_config_get_usb4_present(void)
569577
{
570578
return !(fw_config & EC_CFG_NO_USB4_MASK);

board/scout/gpio.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ GPIO(EN_IMVP8_VR, PIN(F, 4), GPIO_OUT_LOW)
8585
GPIO(EC_CAM_V3P3_EN, PIN(C, 6), GPIO_OUT_LOW)
8686
GPIO(EC_MX8M_ONOFF, PIN(9, 3), GPIO_OUT_LOW)
8787
GPIO(EC_SCALER_EN, PIN(E, 0), GPIO_OUT_LOW)
88+
GPIO(EC_IMX8_EN, PIN(C, 0), GPIO_OUT_LOW)
8889
GPIO(PP3300_TPU_A_EN, PIN(B, 0), GPIO_OUT_LOW)
8990
GPIO(PWR_CTRL, PIN(6, 2), GPIO_OUT_LOW)
9091
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
154155

155156
/* Unused pins */
156157
UNUSED(PIN(1, 3)) /* EC_GP_SEL1_ODL */
157-
UNUSED(PIN(C, 0)) /* FAN_PWM_2 */
158158
UNUSED(PIN(8, 0)) /* LED_BLUE_L */
159159
UNUSED(PIN(C, 2)) /* A12 NC */
160160
UNUSED(PIN(1, 2)) /* C6 NC */

include/power/cometlake-discrete.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ enum power_signal {
107107
*/
108108
void board_enable_s0_rails(int enable);
109109

110+
/*
111+
* Board-specific enable for any additional rails in S0ix
112+
*
113+
* Input 0 to turn off, 1 to turn on.
114+
*/
115+
__override_proto void board_enable_s0ix_rails(int enable);
116+
110117
/*
111118
* Board-specific flag for whether EN_S0_RAILS can be turned off when
112119
* CPU_C10_GATED is asserted by the PCH.

power/cometlake-discrete.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ static void shutdown_s5_rails(void)
207207
#endif
208208
}
209209

210+
__overridable void board_enable_s0ix_rails(int enable)
211+
{
212+
/* Board-specific enable for any additional rails in S0ix */
213+
}
214+
210215
void chipset_force_shutdown(enum chipset_shutdown_reason reason)
211216
{
212217
CPRINTS("%s(%d)", __func__, reason);
@@ -349,6 +354,16 @@ enum power_state power_handle_state(enum power_state state)
349354
shutdown_s0_rails();
350355
break;
351356

357+
#ifdef CONFIG_POWER_S0IX
358+
case POWER_S0ixS0:
359+
board_enable_s0ix_rails(0);
360+
break;
361+
362+
case POWER_S0S0ix:
363+
board_enable_s0ix_rails(1);
364+
break;
365+
#endif
366+
352367
case POWER_S5:
353368
/*
354369
* Return to G3 if S5 rails are not on, probably because of

0 commit comments

Comments
 (0)