diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2016-09-21 11:21:15 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-09-21 19:37:17 -0700 |
commit | 0174d4f85bc83d9081c39de1d5399cab45c61a72 (patch) | |
tree | bcbd9a3b40e347822a7e864d23dd3e97f095bcef /chip/it83xx/system.c | |
parent | c5d03154ee5e5d49d6d1c731dd22a551e1e6c04c (diff) | |
download | chrome-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/system.c')
-rw-r--r-- | chip/it83xx/system.c | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/chip/it83xx/system.c b/chip/it83xx/system.c index 64d6c09157..fee95f2611 100644 --- a/chip/it83xx/system.c +++ b/chip/it83xx/system.c @@ -10,6 +10,7 @@ #include "ec2i_chip.h" #include "flash.h" #include "host_command.h" +#include "intc.h" #include "registers.h" #include "system.h" #include "task.h" @@ -17,23 +18,6 @@ #include "version.h" #include "watchdog.h" -void __no_hibernate(uint32_t seconds, uint32_t microseconds) -{ -#ifdef CONFIG_COMMON_RUNTIME - /* - * Hibernate not implemented on this platform. - * - * Until then, treat this as a request to hard-reboot. - */ - cprints(CC_SYSTEM, "hibernate not supported, so rebooting"); - cflush(); - system_reset(SYSTEM_RESET_HARD); -#endif -} - -void __enter_hibernate(uint32_t seconds, uint32_t microseconds) - __attribute__((weak, alias("__no_hibernate"))); - void system_hibernate(uint32_t seconds, uint32_t microseconds) { #ifdef CONFIG_HOSTCMD_PD @@ -142,6 +126,9 @@ void system_reset(int flags) else save_flags |= RESET_FLAG_SOFT; + if (clock_ec_wake_from_sleep()) + save_flags |= RESET_FLAG_HIBERNATE; + /* Store flags to battery backed RAM. */ BRAM_RESET_FLAGS = save_flags >> 24; BRAM_RESET_FLAGS1 = (save_flags >> 16) & 0xff; |