summaryrefslogtreecommitdiff
path: root/chip/stm32
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2018-05-24 12:01:24 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-05-30 01:02:36 -0700
commit0de5b8ed695a420728ec7b606b218284b0241006 (patch)
tree5b9c1d87e035bb2a5494de75fcb1e5fb878a847f /chip/stm32
parent628c9a924cfde28b2c77707bd71e04cafdf7dc9c (diff)
downloadchrome-ec-0de5b8ed695a420728ec7b606b218284b0241006.tar.gz
system: Enable/Disable low power idle in run time
We have enable_sleep()/disable_sleep() to enable/disable EC deep sleep mode in runtime. Here we introduce similar interfaces to enable/disable EC idle (sleep) mode. BUG=b:78792296 BRANCH=scarlet TEST=Confirm idle mode is enabled/disabled when enable_idle() and disable_idle() are called. Change-Id: I2484f08a066523441064968da99c47de9342ecf0 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1072370 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org> (cherry picked from commit c6b6626cdccef04b0ff203aaed0d84dbdcecf8b7) Reviewed-on: https://chromium-review.googlesource.com/1076708 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Diffstat (limited to 'chip/stm32')
-rw-r--r--chip/stm32/clock-stm32f0.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/chip/stm32/clock-stm32f0.c b/chip/stm32/clock-stm32f0.c
index 2db0244cf9..d324e8bab5 100644
--- a/chip/stm32/clock-stm32f0.c
+++ b/chip/stm32/clock-stm32f0.c
@@ -322,6 +322,11 @@ void __idle(void)
t0 = get_time();
next_delay = __hw_clock_event_get() - t0.le.lo;
+#ifdef CONFIG_LOW_POWER_IDLE_LIMITED
+ if (idle_is_disabled())
+ goto en_int;
+#endif
+
if (DEEP_SLEEP_ALLOWED &&
#ifdef CONFIG_HOSTCMD_RTC
/*
@@ -381,6 +386,9 @@ void __idle(void)
/* normal idle : only CPU clock stopped */
asm("wfi");
}
+#ifdef CONFIG_LOW_POWER_IDLE_LIMITED
+en_int:
+#endif
asm volatile("cpsie i");
}
}