summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2016-08-10 14:48:42 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-08-14 02:03:21 -0700
commite7bdf36f3476c736e4786b41d71a59ee21448dff (patch)
treee3b219c8bf62b7c6b81f776115922b6b572e9064
parent8e512d9d7d04f86138086b202265cd67cd4c7f9c (diff)
downloadchrome-ec-e7bdf36f3476c736e4786b41d71a59ee21448dff.tar.gz
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 <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/367880 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
-rw-r--r--board/cr50/board.c2
-rw-r--r--chip/g/idle.c4
2 files changed, 5 insertions, 1 deletions
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? */