diff options
author | Alec Berg <alecaberg@chromium.org> | 2013-10-08 16:46:58 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2013-10-10 23:14:20 +0000 |
commit | 27e063ea100086a913ed655b611c88e077de5b00 (patch) | |
tree | 701999fd9367e30d008179243a0fc95fc51c5175 /chip/lm4/system.c | |
parent | f7e69a211ce0121ec06c79f6d82574d3347dec2f (diff) | |
download | chrome-ec-27e063ea100086a913ed655b611c88e077de5b00.tar.gz |
lm4: Modified clock gating to allow easy expansion to low power.
Created a new function to enable or disable clocks to various
peripherals. This new function makes it easy to specify if you
want the clock enabled in run mode, sleep mode, and/or deep
sleep mode.
Added infrastructure to specify which GPIOs should interrupt the
EC from deep sleep.
BUG=none
BRANCH=none
TEST=Passes all unit tests. Ran on a peppy and verified that
the clock gate control registers in run mode (LM4_RCGC regs)
were the same before and after this change.
Change-Id: Ia5009ac8c837f61dca52fe86ebdeede2e1a7fe4d
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/172454
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/lm4/system.c')
-rw-r--r-- | chip/lm4/system.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/chip/lm4/system.c b/chip/lm4/system.c index 46d2fa68da..33bfd0227c 100644 --- a/chip/lm4/system.c +++ b/chip/lm4/system.c @@ -5,6 +5,7 @@ /* System module for Chrome EC : LM4 hardware specific implementation */ +#include "clock.h" #include "common.h" #include "console.h" #include "cpu.h" @@ -295,12 +296,11 @@ void system_hibernate(uint32_t seconds, uint32_t microseconds) void system_pre_init(void) { - volatile uint32_t scratch __attribute__((unused)); - - /* Enable clocks to the hibernation module */ - LM4_SYSTEM_RCGCHIB = 1; - /* Wait 3 clock cycles before using the module */ - scratch = LM4_SYSTEM_RCGCHIB; + /* + * Enable clocks to the hibernation module in run, sleep, + * and deep sleep modes. + */ + clock_enable_peripheral(CGC_OFFSET_HIB, 0x1, CGC_MODE_ALL); /* * Enable the hibernation oscillator, if it's not already enabled. |