summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-09-13 14:05:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-09-14 12:08:23 -0700
commit17ad0ededbc33cd22324e622d7d01fac1fae3e3a (patch)
treeddeca1300b101491f3176e3e9d057c9d6e6f8901
parent1b78a4e99c0ab9642e708114e11c8d7ee10f148e (diff)
downloadchrome-ec-17ad0ededbc33cd22324e622d7d01fac1fae3e3a.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>
-rw-r--r--chip/npcx/system-npcx7.c14
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