diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-10-22 16:56:10 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-29 04:15:05 -0700 |
commit | 51a6070f845ed670c5a198a7045af3d3bb3bbdd4 (patch) | |
tree | a247c66e5299aae1d9a657fdd695c3759063ec40 /power/mt8183.c | |
parent | 149190dd3a823d835be71ec4b4e4ae9e5120c774 (diff) | |
download | chrome-ec-51a6070f845ed670c5a198a7045af3d3bb3bbdd4.tar.gz |
system: Remember if reset was due to AP watchdog triggering
On MT8183, when EC detects a watchdog reset, EC needs to reboot
itself in preparation for the next boot. This means that AP loses
the reset cause (as AP system reset is toggled), and, therefore,
we need to save the reset reason in the EC.
BRANCH=none
BUG=b:109900671
TEST=apshutdown, powerb, see that reset reason is: reset-pin
TEST=Use test-wd from bug. Reset reason: reset-pin ap-watchdog
Change-Id: I2e30306db5727a22de930f00dc30de40b9695bef
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1295890
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'power/mt8183.c')
-rw-r--r-- | power/mt8183.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/power/mt8183.c b/power/mt8183.c index 631f2f3c7f..ff842ba01c 100644 --- a/power/mt8183.c +++ b/power/mt8183.c @@ -140,11 +140,16 @@ DECLARE_DEFERRED(chipset_force_shutdown_button); /* If chipset needs to be reset, EC also reboots to RO. */ void chipset_reset(enum chipset_reset_reason reason) { + int flags = SYSTEM_RESET_HARD; + CPRINTS("%s: %d", __func__, reason); report_ap_reset(reason); cflush(); - system_reset(SYSTEM_RESET_HARD); + if (reason == CHIPSET_RESET_AP_WATCHDOG) + flags |= SYSTEM_RESET_AP_WATCHDOG; + + system_reset(flags); /* This should not be reachable. */ while (1) |