summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2017-03-30 13:55:20 -0700
committerchrome-bot <chrome-bot@chromium.org>2017-04-06 17:59:04 -0700
commit2ecca6507d27482d6f8bee99af71d64897423b30 (patch)
tree9e198e6434a4f72af11a8669929063785304825c
parentca0e82685989a08c6adaa52fc8d33546cd3bb1a2 (diff)
downloadchrome-ec-2ecca6507d27482d6f8bee99af71d64897423b30.tar.gz
cr50: print '.' every time cr50 resumes from sleep
Right now there is no way to verify cr50 is asleep just by looking at the UART output. You can check by running taskinfo and seeing that the GC_IRQNUM_PMU_INTR_WAKEUP_INT irq count has increased or by measuring cr50 power. In the past we have had Cr50 issues that we think are related to sleep. Devices like poppy will have the Cr50 uart connected to servo, so we can capture the Cr50 console output. It would be helpful if there was an easy way to tell that cr50 is asleep from the UART output to more easily confirm issues might be related to sleep. This change will print '.' every time Cr50 resumes from sleep. Cr50 wakes up every half second for HOOK_TICK, so with this change '.' prints every half second while cr50 is asleep. BUG=none BRANCH=none TEST=boot a device, wait a while, and verify cr50 starts printing '.' every half second. Turn off the device and verify the '.'s stop. Change-Id: I94a82db00076062dbba2c3bc273cbe0731430520 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/463990 Reviewed-by: Scott Collyer <scollyer@chromium.org>
-rw-r--r--board/cr50/board.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c
index 81b9c2c22e..408cd55c9e 100644
--- a/board/cr50/board.c
+++ b/board/cr50/board.c
@@ -345,6 +345,7 @@ static void init_pmu(void)
void pmu_wakeup_interrupt(void)
{
int exiten, wakeup_src;
+ static int count;
delay_sleep_by(1 * MSEC);
@@ -356,6 +357,16 @@ void pmu_wakeup_interrupt(void)
/* Clear pmu reset */
GWRITE(PMU, CLRRST, 1);
+ /*
+ * This will print '.' every time cr50 resumes from regular sleep.
+ * During sleep Cr50 wakes up every half second for HOOK_TICK, so that
+ * is around the rate cr50 will print '.' while it is idle.
+ */
+ ccprintf(".");
+ if (!(count % 50))
+ ccprintf("\n");
+ count++;
+
if (wakeup_src & GC_PMU_EXITPD_SRC_PIN_PD_EXIT_MASK) {
/*
* If any wake pins are edge triggered, the pad logic latches