From c5127abeee78a4084188e6b51b7ef6129abaaad1 Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 22 Mar 2013 09:48:14 -0700 Subject: stm32: unimplemented hibernate hard-reboots instead of hanging This more closely emulates what LM4 does if it hibernates and then immediately wakes. Keeps the system from becoming silently unresponsive if a hibernate is triggered on STM32. BUG=chrome-os-partner:18371 BRANCH=none TEST=from ec console, 'hibernate' reboots instead of hanging Change-Id: I031f79239725d69ba054323e4fbf8f59133f2093 Signed-off-by: Randall Spangler Reviewed-on: https://gerrit.chromium.org/gerrit/46286 Reviewed-by: Vic Yang --- chip/stm32/system.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/chip/stm32/system.c b/chip/stm32/system.c index 56028ee923..4ee83ebaf4 100644 --- a/chip/stm32/system.c +++ b/chip/stm32/system.c @@ -5,6 +5,7 @@ /* System module for Chrome EC : hardware specific implementation */ +#include "console.h" #include "cpu.h" #include "registers.h" #include "system.h" @@ -104,8 +105,14 @@ static void check_reset_cause(void) void system_hibernate(uint32_t seconds, uint32_t microseconds) { - while (1) - /* NOT IMPLEMENTED */; + /* + * TODO: implement hibernate. + * + * Until then, treat this as a request to hard-reboot. + */ + cprintf(CC_SYSTEM, "[%T hibernate not supported, so rebooting]\n"); + cflush(); + system_reset(SYSTEM_RESET_HARD); } void system_pre_init(void) -- cgit v1.2.1