summaryrefslogtreecommitdiff
path: root/chip/g/system.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2016-08-02 18:25:13 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-05 11:45:25 -0700
commitf1bd67dedcd9c81b965ac54b8d93828b98192dc5 (patch)
treebd45058cc7bbb16b5381599b29370265ea7668f5 /chip/g/system.c
parentcef1e7fa9a1b3a098994afcdcab0143dea890047 (diff)
downloadchrome-ec-f1bd67dedcd9c81b965ac54b8d93828b98192dc5.tar.gz
g: Decode more reasons for chip reset
There are few reasons why the SoC may reboot which we haven't been reporting (they just show up as "[Reset cause: other]"). This adds a bit of decoding to explain some of those "other" reasons. BUG=none BRANCH=none TEST=make buildall; try on Cr50 I tested one of the new reasons using "crash hang". It shows up correctly as "{Reset cause: security]". I haven't specifically tested all of the new reasons, but since this is basically just a change to console message they should work too. I'll double-check those cases once some blocking bugs are fixed. Change-Id: I46daed29d7e37bda9034a3486127bed0ea25f803 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/366400 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'chip/g/system.c')
-rw-r--r--chip/g/system.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/chip/g/system.c b/chip/g/system.c
index 7071e2680b..9bc3a26b8e 100644
--- a/chip/g/system.c
+++ b/chip/g/system.c
@@ -41,16 +41,12 @@ static void check_reset_cause(void)
if (g_exitpd & (GC_PMU_EXITPD_SRC_TIMELS0_PD_EXIT_TIMER0_MASK |
GC_PMU_EXITPD_SRC_TIMELS0_PD_EXIT_TIMER1_MASK))
flags |= RESET_FLAG_RTC_ALARM;
- /* Not yet sure what to do with these */
- if (g_exitpd & (GC_PMU_EXITPD_SRC_RDD0_PD_EXIT_TIMER_MASK |
- GC_PMU_EXITPD_SRC_RBOX_WAKEUP_MASK))
- flags |= RESET_FLAG_OTHER;
+ if (g_exitpd & GC_PMU_EXITPD_SRC_RDD0_PD_EXIT_TIMER_MASK)
+ flags |= RESET_FLAG_RDD;
+ if (g_exitpd & GC_PMU_EXITPD_SRC_RBOX_WAKEUP_MASK)
+ flags |= RESET_FLAG_RBOX;
}
- /* This bit doesn't work. See crosbug.com/p/47289. */
- if (g_rstsrc & GC_PMU_RSTSRC_WDOG_MASK)
- flags |= RESET_FLAG_WATCHDOG;
-
if (g_rstsrc & GC_PMU_RSTSRC_SOFTWARE_MASK)
flags |= RESET_FLAG_HARD;
@@ -60,6 +56,13 @@ static void check_reset_cause(void)
if (g_rstsrc & GC_PMU_RSTSRC_FST_BRNOUT_MASK)
flags |= RESET_FLAG_BROWNOUT;
+ /*
+ * GC_PMU_RSTSRC_WDOG and GC_PMU_RSTSRC_LOCKUP are considered security
+ * threats. They won't show up as a direct reset cause.
+ */
+ if (g_rstsrc & GC_PMU_RSTSRC_SEC_THREAT_MASK)
+ flags |= RESET_FLAG_SECURITY;
+
if (g_rstsrc && !flags)
flags |= RESET_FLAG_OTHER;