summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2020-01-16 15:17:33 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-21 23:55:45 +0000
commit7616354e44fb36d2721bc6bdb6bd8d18697fd60b (patch)
tree0eed47614d1feaf7211825b16fa172d026639103
parent23b0af225ef6cc09d5725343a0b7ae211ad53f86 (diff)
downloadchrome-ec-7616354e44fb36d2721bc6bdb6bd8d18697fd60b.tar.gz
dedede: Add z-state support
Dedede has support for the new low power "Z-state". In this state. the EC and H1 are unpowered, but power will be restored to the EC once one of the wakeup events occurs. These events are ACOK, lid open, and a power button press. This commit simply enables the Z-state when the EC hibernates. BUG=b:147819424 BRANCH=None TEST=build and flash waddledoo, enter `hibernate`, verify that EC power is turned off and can be restored by pressing the power button or plugging in a charger. Change-Id: I4f93efd0632f457354f4bf6bf0274b19a9cd799c Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2006215 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
-rw-r--r--baseboard/dedede/baseboard.c9
-rw-r--r--chip/it83xx/clock.c7
-rw-r--r--chip/npcx/system.c6
3 files changed, 19 insertions, 3 deletions
diff --git a/baseboard/dedede/baseboard.c b/baseboard/dedede/baseboard.c
index c5b5f7ae7a..e68b955849 100644
--- a/baseboard/dedede/baseboard.c
+++ b/baseboard/dedede/baseboard.c
@@ -58,3 +58,12 @@ void baseboard_chipset_shutdown(void)
}
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, baseboard_chipset_shutdown,
HOOK_PRIO_DEFAULT);
+
+void board_hibernate_late(void)
+{
+ /*
+ * Turn on the Z state. This will not return as it will cut power to
+ * the EC.
+ */
+ gpio_set_level(GPIO_EN_SLP_Z, 1);
+}
diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c
index 7c679bffbe..0fd7335080 100644
--- a/chip/it83xx/clock.c
+++ b/chip/it83xx/clock.c
@@ -465,7 +465,12 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
}
/* bit5: watchdog is disabled. */
IT83XX_ETWD_ETWCTRL |= BIT(5);
- /* Setup GPIOs for hibernate */
+
+ /*
+ * Setup GPIOs for hibernate. On some boards, it's possible that this
+ * may not return at all. On those boards, power to the EC is likely
+ * being turn off entirely.
+ */
if (board_hibernate_late)
board_hibernate_late();
diff --git a/chip/npcx/system.c b/chip/npcx/system.c
index 10c42813cc..9ba374a857 100644
--- a/chip/npcx/system.c
+++ b/chip/npcx/system.c
@@ -509,8 +509,10 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
system_set_gpios_and_wakeup_inputs_hibernate();
/*
- * Give the board a chance to do any late stage hibernation work.
- * This is likely going to configure GPIOs for hibernation.
+ * Give the board a chance to do any late stage hibernation work. This
+ * is likely going to configure GPIOs for hibernation. On some boards,
+ * it's possible that this may not return at all. On those boards,
+ * power to the EC is likely being turn off entirely.
*/
if (board_hibernate_late)
board_hibernate_late();