From e7bdf36f3476c736e4786b41d71a59ee21448dff Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Wed, 10 Aug 2016 14:48:42 -0700 Subject: [PATCH] cr50: delay sleep for 3 minutes after resuming from sleep or after init Disable sleep for the first 3 minutes after initializing cr50 and disable sleep for 3 minutes after a wakepin interrupt has been received. BUG=none BRANCH=none TEST=manual on a development board pull up dioa3 and dioa12 then verify cr50 does goes to sleep after 3 minutes. on gru see sleep is delayed by 3 minutes when the wakeup interrupt is called. enable deep sleep and check cr50 does not go to sleep for 3 minutes after resuming. Change-Id: I28ec3c2f5f86326b926d403ad52ffb4fc108e7ec Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/367880 Reviewed-by: Vadim Bendebury --- board/cr50/board.c | 2 +- chip/g/idle.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/board/cr50/board.c b/board/cr50/board.c index 12b0c58773..f68a37543c 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -117,7 +117,7 @@ void pmu_wakeup_interrupt(void) * Delay sleep long enough for a SPI slave transaction to start * or for the system to be reset. */ - delay_sleep_by(3 * SECOND); + delay_sleep_by(3 * MINUTE); if (!gpio_get_level(GPIO_SYS_RST_L_IN)) sys_rst_asserted(GPIO_SYS_RST_L_IN); diff --git a/chip/g/idle.c b/chip/g/idle.c index 23524aae15..88a2c14eaa 100644 --- a/chip/g/idle.c +++ b/chip/g/idle.c @@ -4,6 +4,7 @@ */ #include "common.h" +#include "timer.h" #include "console.h" #include "rdd.h" #include "registers.h" @@ -172,6 +173,9 @@ void __idle(void) GREG32(PMU, PWRDN_SCRATCH17) = idle_action; } + /* Disable sleep until 3 minutes after init */ + delay_sleep_by(3 * MINUTE); + while (1) { /* Anyone still busy? */