summaryrefslogtreecommitdiff
path: root/chip/stm32/clock-stm32f.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2013-10-14 17:55:42 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-21 23:59:38 +0000
commit10bd1db6d73e21619e789d73c8233dea2c493510 (patch)
treedfc03ce44ce9ef3697cb707d2f160861697628b4 /chip/stm32/clock-stm32f.c
parent1d6687429c1ea236bf09ac32d4936888a36730e6 (diff)
downloadchrome-ec-10bd1db6d73e21619e789d73c8233dea2c493510.tar.gz
lm4: Use low speed clock in deep sleep.
Changed the low power idle task to use the low speed clock in deep sleep. The low power idle task is currently only enabled for Peppy, Slippy, and Falco. This change decreases power consumption when the AP is not running. Note that the low speed clock is slow enough that the JTAG cannot be used and the EC console UART cannot be used. To work around that, this commit detects when the JTAG is in use and when the EC console is in use, and will not use the low speed clock if either is in use. The JTAG in use never clears after being set and the console in use clears after a fixed timeout period. BUG=None BRANCH=None TEST=Passes all unit tests. Tested that the EC console works when in deep sleep. Tested that it is possible to run flash_ec when in deep sleep and using the low speed clock. Change-Id: Ia65997eb8e607a5df9b2c7d68e4826bfb1e0194c Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/173326 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/stm32/clock-stm32f.c')
-rw-r--r--chip/stm32/clock-stm32f.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/chip/stm32/clock-stm32f.c b/chip/stm32/clock-stm32f.c
index 23db9f1f44..11b426a42f 100644
--- a/chip/stm32/clock-stm32f.c
+++ b/chip/stm32/clock-stm32f.c
@@ -177,6 +177,10 @@ void __enter_hibernate(uint32_t seconds, uint32_t microseconds)
#ifdef CONFIG_LOW_POWER_IDLE
+void clock_refresh_console_in_use(void)
+{
+}
+
#ifdef CONFIG_FORCE_CONSOLE_RESUME
static void enable_serial_wakeup(int enable)
{
@@ -192,7 +196,7 @@ static void enable_serial_wakeup(int enable)
} else {
/* serial port wake up : don't go back to sleep */
if (STM32_EXTI_PR & (1 << 10))
- disable_sleep(SLEEP_MASK_FORCE);
+ disable_sleep(SLEEP_MASK_FORCE_NO_DSLEEP);
/* restore keyboard external IT on PC10 */
STM32_AFIO_EXTICR(10 / 4) = save_exticr;
}
@@ -216,7 +220,7 @@ void __idle(void)
t0 = get_time();
next_delay = __hw_clock_event_get() - t0.le.lo;
- if (!sleep_mask && (next_delay > STOP_MODE_LATENCY)) {
+ if (DEEP_SLEEP_ALLOWED && (next_delay > STOP_MODE_LATENCY)) {
/* deep-sleep in STOP mode */
enable_serial_wakeup(1);