From 646760bb20fde94683d3be2fa4b046d47933d85f Mon Sep 17 00:00:00 2001 From: Vijay Hiremath Date: Wed, 12 Aug 2015 18:39:45 -0700 Subject: Skylake: Add low power Pseudo G3 support BUG=none TEST=Used "shutdown -h now" Kernel console command to test on Kunimitsu. With only battery after 1 hour, device enters to Pseudo G3 and the V3p3A is off. With AC connected, device is in G3. BRANCH=none Change-Id: I955662eb69ac608e9b2d12bdcfbc1258ca83f3a5 Signed-off-by: Vijay Hiremath Reviewed-on: https://chromium-review.googlesource.com/292976 Reviewed-by: Aaron Durbin --- board/kunimitsu/board.h | 4 ++-- include/config.h | 3 --- power/skylake.c | 22 +++++++++++++++++++--- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/board/kunimitsu/board.h b/board/kunimitsu/board.h index 0aa33dd82f..013eb233d7 100644 --- a/board/kunimitsu/board.h +++ b/board/kunimitsu/board.h @@ -113,8 +113,8 @@ #undef CONFIG_CONSOLE_HISTORY #undef CONFIG_PECI -/* Enable sleep mode in G3 */ -#define CONFIG_G3_SLEEP +/* Enable Pseudo G3 */ +#define CONFIG_LOW_POWER_PSEUDO_G3 #ifndef __ASSEMBLER__ diff --git a/include/config.h b/include/config.h index b8d97d79c5..7172f54697 100644 --- a/include/config.h +++ b/include/config.h @@ -1146,9 +1146,6 @@ */ #undef CONFIG_LOW_POWER_S0 -/* Support G3 sleep mode */ -#undef CONFIG_G3_SLEEP - /* Support LPC interface */ #undef CONFIG_LPC diff --git a/power/skylake.c b/power/skylake.c index 343d230297..a766901e67 100644 --- a/power/skylake.c +++ b/power/skylake.c @@ -279,9 +279,6 @@ static enum power_state _power_handle_state(enum power_state state) return POWER_S5; case POWER_S5G3: -#ifdef CONFIG_G3_SLEEP - gpio_set_level(GPIO_G3_SLEEP_EN, 1); -#endif chipset_force_g3(); return POWER_G3; @@ -340,3 +337,22 @@ enum power_state power_handle_state(enum power_state state) return new_state; } + +#ifdef CONFIG_LOW_POWER_PSEUDO_G3 +void enter_pseudo_g3(void) +{ + CPRINTS("Enter Psuedo G3"); + + /* + * Clean up the UART buffer and prevent any unwanted garbage characters + * before power off and also ensure above debug message is printed. + */ + cflush(); + + gpio_set_level(GPIO_G3_SLEEP_EN, 1); + + /* Power to EC should shut down now */ + while (1) + ; +} +#endif -- cgit v1.2.1