From 27e063ea100086a913ed655b611c88e077de5b00 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Tue, 8 Oct 2013 16:46:58 -0700 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/172454 Reviewed-by: Randall Spangler --- chip/lm4/peci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'chip/lm4/peci.c') 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); -- cgit v1.2.1