diff options
Diffstat (limited to 'chip')
-rw-r--r-- | chip/mec1322/system.c | 7 | ||||
-rw-r--r-- | chip/stm32/system.c | 8 |
2 files changed, 15 insertions, 0 deletions
diff --git a/chip/mec1322/system.c b/chip/mec1322/system.c index fe68777241..071cb96e80 100644 --- a/chip/mec1322/system.c +++ b/chip/mec1322/system.c @@ -281,6 +281,13 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) uint32_t nvic_status[3]; char *backup_gpio_ctl; +#ifdef CONFIG_HOSTCMD_PD + /* Inform the PD MCU that we are going to hibernate. */ + host_command_pd_request_hibernate(); + /* Wait to ensure exchange with PD before hibernating. */ + msleep(100); +#endif + cflush(); /* Disable interrupts */ diff --git a/chip/stm32/system.c b/chip/stm32/system.c index 5e486ea20b..b1daf1ce4c 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -9,6 +9,7 @@ #include "console.h" #include "cpu.h" #include "flash.h" +#include "host_command.h" #include "registers.h" #include "panic.h" #include "system.h" @@ -104,6 +105,13 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds) void system_hibernate(uint32_t seconds, uint32_t microseconds) { +#ifdef CONFIG_HOSTCMD_PD + /* Inform the PD MCU that we are going to hibernate. */ + host_command_pd_request_hibernate(); + /* Wait to ensure exchange with PD before hibernating. */ + msleep(100); +#endif + /* Flush console before hibernating */ cflush(); /* chip specific standby mode */ |