summaryrefslogtreecommitdiff
path: root/common/system.c
diff options
context:
space:
mode:
authorYilun Lin <yllin@google.com>2019-03-11 17:41:17 +0800
committerchrome-bot <chrome-bot@chromium.org>2019-04-18 19:52:06 -0700
commit2b452718a0b2e08fad8e0a830b443db862bf806c (patch)
tree43eb5a122ecdab194707e5fd8c7d2205d071ab31 /common/system.c
parent521db7dfbff864bf4fd2442a6129872b6b4ea873 (diff)
downloadchrome-ec-2b452718a0b2e08fad8e0a830b443db862bf806c.tar.gz
util/ectool, common/system: Share sysmbol reset_flag_desc.
There were two symbols reset_flag_desc and reset_flag_strings used in two separated places: host binary ectool and device. This CL combines these two symbols to reduce maintance efforts. TEST=make buildall -j BRANCH=None BUG=None Change-Id: I3b5731ab08804f46629d6e43466dce963bd86a69 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1514395 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r--common/system.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/common/system.c b/common/system.c
index 813c0b6399..458798357c 100644
--- a/common/system.c
+++ b/common/system.c
@@ -86,16 +86,6 @@ struct jump_data {
/* Jump data (at end of RAM, or preceding panic data) */
static struct jump_data *jdata;
-/*
- * Reset flag descriptions. Must be in same order as bits of RESET_FLAG_
- * constants.
- */
-static const char * const reset_flag_descs[] = {
- "other", "reset-pin", "brownout", "power-on", "watchdog", "soft",
- "hibernate", "rtc-alarm", "wake-pin", "low-battery", "sysjump",
- "hard", "ap-off", "preserved", "usb-resume", "rdd", "rbox",
- "security", "ap-watchdog" };
-
static uint32_t reset_flags;
static int jumped_to_image;
static int disable_jump; /* Disable ALL jumps if system is locked */
@@ -278,6 +268,9 @@ void system_print_reset_flags(void)
{
int count = 0;
int i;
+ static const char * const reset_flag_descs[] = {
+ #include "reset_flag_desc.inc"
+ };
if (!reset_flags) {
CPUTS("unknown");
@@ -292,6 +285,13 @@ void system_print_reset_flags(void)
CPUTS(reset_flag_descs[i]);
}
}
+
+ if (reset_flags >= BIT(i)) {
+ if (count)
+ CPUTS(" ");
+
+ CPUTS("no-desc");
+ }
}
int system_jumped_to_this_image(void)