summaryrefslogtreecommitdiff
path: root/chip/it83xx/watchdog.c
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2016-09-21 11:21:15 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-09-21 19:37:17 -0700
commit0174d4f85bc83d9081c39de1d5399cab45c61a72 (patch)
treebcbd9a3b40e347822a7e864d23dd3e97f095bcef /chip/it83xx/watchdog.c
parentc5d03154ee5e5d49d6d1c731dd22a551e1e6c04c (diff)
downloadchrome-ec-0174d4f85bc83d9081c39de1d5399cab45c61a72.tar.gz
it83xx: EC sleep mode for system hibernate
The typical power consumption in sleep mode is 65uA. IT83xx uses deep doze mode for low power idle task. The typical power consumption in this state is 280uA (depends on EC tasks, it should be more) and the wake up time is in microsecond. We are using deep doze mode for low power idle task instead of sleep mode is because the wake up time will be 6ms more. While in system hibernate (EC sleep mode), EC won't wake up frequently so we can keep the power consumption at 65uA. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=- hibernate 0 [1|999999] - hibernate [1|5|10|600] - hibernate then press power button. - hibernate then lid open. Change-Id: I94884c010264f01ede4950c6bb1b0a444d7b1e6d Reviewed-on: https://chromium-review.googlesource.com/383332 Commit-Ready: Dino Li <dino0303@gmail.com> Tested-by: Dino Li <dino0303@gmail.com> Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'chip/it83xx/watchdog.c')
-rw-r--r--chip/it83xx/watchdog.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/it83xx/watchdog.c b/chip/it83xx/watchdog.c
index 6c15afc60a..1bbba6ceb3 100644
--- a/chip/it83xx/watchdog.c
+++ b/chip/it83xx/watchdog.c
@@ -63,8 +63,13 @@ int watchdog_init(void)
/* Set WDT key match enabled and WDT clock to use ET1PSR. */
IT83XX_ETWD_ETWCFG = 0x30;
+#ifdef CONFIG_HIBERNATE
+ /* bit4: watchdog can be stopped. */
+ IT83XX_ETWD_ETWCTRL |= (1 << 4);
+#else
/* Specify that watchdog cannot be stopped. */
IT83XX_ETWD_ETWCTRL = 0x00;
+#endif
/* Start WDT_EXT_TIMER (CONFIG_AUX_TIMER_PERIOD_MS ms). */
ext_timer_ms(WDT_EXT_TIMER, EXT_PSR_32P768K_HZ, 1, 1,