diff options
author | Randall Spangler <rspangler@chromium.org> | 2012-08-03 12:41:08 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-03 16:51:14 -0700 |
commit | cf20b3e4f0852ff3d467ee1c4553bbd5a0cf6f09 (patch) | |
tree | 97ad980a649d8ec3c10ed37288d2bea6053015f4 | |
parent | 5e996478c9b41396771b97b0e2228d23f070ab45 (diff) | |
download | chrome-ec-cf20b3e4f0852ff3d467ee1c4553bbd5a0cf6f09.tar.gz |
Add x86indebug command
Prints all x86 signal power state transitions at interrupt level, so
we can see lines toggle more precisely.
BUG=chrome-os-partner:12229
TEST=manual
1. power on system
2. no debug output that looks like [501.001742 x86 in 0x563f]
3. reboot
4. x86indebug 0xffff
5. power on system
6. should see lots of lines that look like [501.001742 x86 in 0x563f]
Change-Id: Ie3b346ee4d4beee3f13ac1245f1eb022b48dabf4
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/29192
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
-rw-r--r-- | common/x86_power.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/common/x86_power.c b/common/x86_power.c index eb127c55ad..4d4e0fef5d 100644 --- a/common/x86_power.c +++ b/common/x86_power.c @@ -98,6 +98,7 @@ static const char * const state_names[] = { static enum x86_state state = X86_G3; /* Current state */ static uint32_t in_signals; /* Current input signal states (IN_PGOOD_*) */ static uint32_t in_want; /* Input signal state we're waiting for */ +static uint32_t in_debug; /* Signal values which print debug output */ static int want_g3_exit; /* Should we exit the G3 state? */ static int throttle_cpu; /* Throttle CPU? */ @@ -146,6 +147,9 @@ static void update_in_signals(void) /* Copy SUSWARN# signal from PCH to SUSACK# */ gpio_set_level(GPIO_PCH_SUSACKn, v); + if ((in_signals & in_debug) != (inew & in_debug)) + CPRINTF("[%T x86 in 0x%04x]\n", inew); + in_signals = inew; } @@ -675,6 +679,29 @@ DECLARE_CONSOLE_COMMAND(x86shutdown, command_x86shutdown, "Force x86 shutdown", NULL); +static int command_x86indebug(int argc, char **argv) +{ + char *e; + + /* If one arg, set the mask */ + if (argc == 2) { + int m = strtoi(argv[1], &e, 0); + if (*e) + return EC_ERROR_PARAM1; + + in_debug = m; + } + + /* Print the mask */ + ccprintf("x86 in: 0x%04x\n", in_signals); + ccprintf("debug mask: 0x%04x\n", in_debug); + return EC_SUCCESS; +}; +DECLARE_CONSOLE_COMMAND(x86indebug, command_x86indebug, + "[mask]", + "Get/set x86 input debug mask", + NULL); + /*****************************************************************************/ /* Host commands */ |