mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-08 16:41:55 +00:00
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>
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user