mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
mec1322: Power state transition in case of apshutdown
In case of 'apshutdown', SOC loses power immediately while EC is waiting for SOC's PMC_SUSPWRDNACK signal forever. BUG=chrome-os-partner:43038 TEST=Cyan BRANCH=none Change-Id: I34321d00a89011e90222ea5916a42e9a51d4f4b0 Signed-off-by: Kyoung Kim <kyoung.il.kim@intel.com> Reviewed-on: https://chromium-review.googlesource.com/288203 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Divya Jyothi <divya.jyothi@intel.com>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
6eecf91b63
commit
4ff95401b5
@@ -51,6 +51,7 @@
|
||||
#define IN_ALL_S0 (IN_PGOOD_S0 | IN_ALL_PM_SLP_DEASSERTED)
|
||||
|
||||
static int throttle_cpu; /* Throttle CPU? */
|
||||
static int forcing_shutdown; /* Forced shutdown in progress? */
|
||||
|
||||
void chipset_force_shutdown(void)
|
||||
{
|
||||
@@ -62,6 +63,7 @@ void chipset_force_shutdown(void)
|
||||
*/
|
||||
gpio_set_level(GPIO_PCH_SYS_PWROK, 0);
|
||||
gpio_set_level(GPIO_PCH_RSMRST_L, 0);
|
||||
forcing_shutdown = 1;
|
||||
}
|
||||
|
||||
void chipset_reset(int cold_reset)
|
||||
@@ -279,6 +281,25 @@ enum power_state power_handle_state(enum power_state state)
|
||||
return power_get_pause_in_s5() ? POWER_S5 : POWER_S5G3;
|
||||
|
||||
case POWER_S5G3:
|
||||
/*
|
||||
* in case shutdown is already done by apshutdown
|
||||
* (or chipset_force_shutdown()), SOC already lost
|
||||
* power and can't assert PMC_SUSPWRDNACK any more.
|
||||
*/
|
||||
if (forcing_shutdown) {
|
||||
/* Config pins for SOC G3 */
|
||||
gpio_config_module(MODULE_GPIO, 1);
|
||||
#ifndef CONFIG_PMIC
|
||||
gpio_set_level(GPIO_SUSPWRDNACK_SOC_EC, 1);
|
||||
#endif
|
||||
|
||||
forcing_shutdown = 0;
|
||||
|
||||
CPRINTS("Enter SOC G3");
|
||||
|
||||
return POWER_G3;
|
||||
}
|
||||
|
||||
if (gpio_get_level(GPIO_PCH_SUSPWRDNACK) == 1) {
|
||||
/* Assert RSMRST# */
|
||||
gpio_set_level(GPIO_PCH_RSMRST_L, 0);
|
||||
|
||||
Reference in New Issue
Block a user