diff options
author | Furquan Shaikh <furquan@google.com> | 2018-09-13 14:05:16 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-09-18 15:38:17 +0000 |
commit | 7de15bc5ff5e788fcd6c7288b48c466dab956139 (patch) | |
tree | d9645e45181c311129f918f0d63dd83efdb8218b /chip | |
parent | 6923c89ca94ad60afb3553361a9096ee2548f7a0 (diff) | |
download | chrome-ec-7de15bc5ff5e788fcd6c7288b48c466dab956139.tar.gz |
npcx7: Report PSL_CTS on wake from hibernate
This is useful when debugging random wake issues from PSL hibernate to
identify the actual cause of wake.
BUG=b:115664415
BRANCH=None
TEST=make -j buildall
Change-Id: Id35be96aef2d73426781d0bf88bf5f6268bc3b6b
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1225353
Commit-Ready: Jett Rink <jettrink@chromium.org>
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1230994
Reviewed-by: Martin Roth <martinroth@chromium.org>
Commit-Queue: Martin Roth <martinroth@chromium.org>
Tested-by: Martin Roth <martinroth@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/npcx/system-npcx7.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chip/npcx/system-npcx7.c b/chip/npcx/system-npcx7.c index 4651e425e1..579b2a1321 100644 --- a/chip/npcx/system-npcx7.c +++ b/chip/npcx/system-npcx7.c @@ -7,6 +7,7 @@ #include "common.h" #include "console.h" #include "cpu.h" +#include "hooks.h" #include "registers.h" #include "system.h" #include "task.h" @@ -16,6 +17,9 @@ #include "system_chip.h" #include "rom_chip.h" +#define CPRINTS(format, args...) cprints(CC_SYSTEM, format, ## args) +#define CPRINTF(format, args...) cprintf(CC_SYSTEM, format, ## args) + /* Macros for last 32K ram block */ #define LAST_RAM_BLK ((NPCX_RAM_SIZE / (32 * 1024)) - 1) #define RAM_PD_MASK (~(1 << LAST_RAM_BLK)) @@ -158,3 +162,13 @@ void __hibernate_npcx_series(void) #endif } +#if defined(CONFIG_HIBERNATE_PSL) +static void report_psl_wake_source(void) +{ + if (!(system_get_reset_flags() & RESET_FLAG_HIBERNATE)) + return; + + CPRINTS("PSL_CTS: 0x%x", NPCX_GLUE_PSL_CTS & 0xf); +} +DECLARE_HOOK(HOOK_INIT, report_psl_wake_source, HOOK_PRIO_DEFAULT); +#endif |