summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorDivya Jyothi <divya.jyothi@intel.com>2015-04-09 13:37:42 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-29 20:44:33 +0000
commit0086f8a7802fa9faddc2fda9c348fa88a47c291e (patch)
tree2f9ee1e07d3f1ed1985bca2795f0f872d0d1d37f /power
parent6fb50e909018e367b2a2d62d196b759c4f0b132e (diff)
downloadchrome-ec-0086f8a7802fa9faddc2fda9c348fa88a47c291e.tar.gz
braswell: Support added for suspend/resume and shutdown
The current power sequencing would shutdown the system when suspend command or reboot was initiated from the kernal. Proper transitions from S0-S3 and S3-S0 are handled. BUG=None BRANCH=None TEST=Tested on Braswell reference design. Issued commands from kernel:For shutdown - "shutdown -P now" and suspend - "powerd_dbus_suspend" Change-Id: I7cc734f29c0dca89f7d9564f175895467b405df0 Signed-off-by: Divya Jyothi <divya.jyothi@intel.com> Reviewed-on: https://chromium-review.googlesource.com/265091 Reviewed-by: Shawn N <shawnn@chromium.org> Commit-Queue: Eric Caruso <ejcaruso@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/braswell.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/power/braswell.c b/power/braswell.c
index 818c610f44..79b33b0d39 100644
--- a/power/braswell.c
+++ b/power/braswell.c
@@ -49,8 +49,7 @@
/* All PM_SLP signals from PCH deasserted */
#define IN_ALL_PM_SLP_DEASSERTED (IN_SLP_S3_DEASSERTED | IN_SLP_S4_DEASSERTED)
/* All inputs in the right state for S0 */
-#define IN_ALL_S0 (IN_PGOOD_ALWAYS_ON | IN_PGOOD_ALL_NONCORE | \
- IN_PGOOD_ALL_CORE | IN_ALL_PM_SLP_DEASSERTED)
+#define IN_ALL_S0 (IN_PGOOD_S0 | IN_ALL_PM_SLP_DEASSERTED)
static int throttle_cpu; /* Throttle CPU? */
static int pause_in_s5 = 1; /* Pause in S5 when shutting down? */
@@ -185,11 +184,11 @@ enum power_state power_handle_state(enum power_state state)
/*wireless_set_state(WIRELESS_ON);*/
- if (power_wait_signals(IN_PGOOD_S0)) {
+ if (!power_has_signals(IN_PGOOD_S3)) {
chipset_force_shutdown();
/*wireless_set_state(WIRELESS_OFF);*/
- return POWER_S3;
+ return POWER_S3S5;
}
/* Call hooks now that rails are up */
@@ -222,9 +221,8 @@ enum power_state power_handle_state(enum power_state state)
CPRINTS("power wait for PLTRST# to deassert");
while (lpc_get_pltrst_asserted()) {
usleep(MSEC);
-#ifndef STRAGO_PO
- i++;
-#endif
+
+ i++;
if (i >= 50) {
CPRINTS("power timeout on PLTRST#");
chipset_force_shutdown();
@@ -239,12 +237,15 @@ enum power_state power_handle_state(enum power_state state)
case POWER_S0:
- if (!power_has_signals(IN_PGOOD_S0)) {
- /* Required rail went away - Cold Reset? */
+
+ if (!power_has_signals(IN_PGOOD_ALWAYS_ON)) {
chipset_force_shutdown();
return POWER_S0S3;
- } else if (gpio_get_level(GPIO_PCH_SLP_S3_L) == 0) {
+ }
+
+ if (!power_has_signals(IN_ALL_S0)) {
/* Power down to next state */
+ gpio_set_level(GPIO_PCH_SYS_PWROK, 0);
return POWER_S0S3;
}