summaryrefslogtreecommitdiff
path: root/chip/lm4/peci.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2013-10-08 16:46:58 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-10 23:14:20 +0000
commit27e063ea100086a913ed655b611c88e077de5b00 (patch)
tree701999fd9367e30d008179243a0fc95fc51c5175 /chip/lm4/peci.c
parentf7e69a211ce0121ec06c79f6d82574d3347dec2f (diff)
downloadchrome-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/peci.c')
-rw-r--r--chip/lm4/peci.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chip/lm4/peci.c b/chip/lm4/peci.c
index d753c52730..7f0d692439 100644
--- a/chip/lm4/peci.c
+++ b/chip/lm4/peci.c
@@ -110,9 +110,9 @@ static void peci_init(void)
{
int i;
- /* Enable the PECI module and delay a few clocks */
- LM4_SYSTEM_RCGCPECI = 1;
- clock_wait_cycles(3);
+ /* Enable the PECI module in run and sleep modes. */
+ clock_enable_peripheral(CGC_OFFSET_PECI, 0x1,
+ CGC_MODE_RUN | CGC_MODE_SLEEP);
/* Configure GPIOs */
gpio_config_module(MODULE_PECI, 1);