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>
This commit is contained in:
Furquan Shaikh 2018-09-13 14:05:16 -07:00 committed by ChromeOS Commit Bot
parent 6923c89ca9
commit 7de15bc5ff
1 changed files with 14 additions and 0 deletions

View File

@ -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