diff options
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; |