aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos/cpuidle.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-14 17:38:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-14 17:38:28 -0500
commit6a57d104c8cb5b6adad6784b4ce6e2f7f9961a3a (patch)
treec3ff93b006d7483ccee09799d215b03b1bbc3f1b /arch/arm/mach-exynos/cpuidle.c
parentcebfa85eb86d92bf85d3b041c6b044184517a988 (diff)
parentc91321e8ff338a88a9272dcd938f085955cd5846 (diff)
Merge tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM Soc updates, take 2, from Olof Johansson: "This is the second batch of SoC updates for the 3.8 merge window, containing parts that had dependencies on earlier branches such that we couldn't include them with the first branch. These are general updates for Samsung Exynos, Renesas/shmobile and a topic branch that adds SMP support to Altera's socfpga platform." Fix up conflicts mostly as per Olof. * tag 'soc2' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: ARM: EXYNOS: Clock settings for SATA and SATA PHY ARM: EXYNOS: Add ARM down clock support ARM: EXYNOS: Fix i2c suspend/resume for legacy controller ARM: EXYNOS: Add aliases for i2c controller ARM: EXYNOS: Setup legacy i2c controller interrupts sh: clkfwk: fixup unsed variable warning Revert "ARM: shmobile: r8a7779: Replace modify_scu_cpu_psr with scu_power_mode" Revert "ARM: shmobile: sh73a0: Replace modify_scu_cpu_psr with scu_power_mode" Revert "ARM: shmobile: emev2: Replace modify_scu_cpu_psr with scu_power_mode" ARM: highbank: use common debug_ll_io_init ARM: shmobile: sh7372: sh7372_fsiXck_clk become non-global ARM: shmobile: sh7372: remove fsidivx clock ARM: socfpga: mark secondary_trampoline as cpuinit socfpga: map uart into virtual address space so that early_printk() works ARM: socfpga: fix build break for allyesconfig ARM: socfpga: Enable SMP for socfpga ARM: EXYNOS: Add dp clock support for EXYNOS5 ARM: SAMSUNG: call clk_get_rate for debugfs rate files ARM: SAMSUNG: add clock_tree debugfs file in clock
Diffstat (limited to 'arch/arm/mach-exynos/cpuidle.c')
-rw-r--r--arch/arm/mach-exynos/cpuidle.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos/cpuidle.c b/arch/arm/mach-exynos/cpuidle.c
index 8e4ec21ef2cf..050924152776 100644
--- a/arch/arm/mach-exynos/cpuidle.c
+++ b/arch/arm/mach-exynos/cpuidle.c
@@ -21,6 +21,7 @@
21#include <asm/suspend.h> 21#include <asm/suspend.h>
22#include <asm/unified.h> 22#include <asm/unified.h>
23#include <asm/cpuidle.h> 23#include <asm/cpuidle.h>
24#include <mach/regs-clock.h>
24#include <mach/regs-pmu.h> 25#include <mach/regs-pmu.h>
25#include <mach/pmu.h> 26#include <mach/pmu.h>
26 27
@@ -157,12 +158,47 @@ static int exynos4_enter_lowpower(struct cpuidle_device *dev,
157 return exynos4_enter_core0_aftr(dev, drv, new_index); 158 return exynos4_enter_core0_aftr(dev, drv, new_index);
158} 159}
159 160
161static void __init exynos5_core_down_clk(void)
162{
163 unsigned int tmp;
164
165 /*
166 * Enable arm clock down (in idle) and set arm divider
167 * ratios in WFI/WFE state.
168 */
169 tmp = PWR_CTRL1_CORE2_DOWN_RATIO | \
170 PWR_CTRL1_CORE1_DOWN_RATIO | \
171 PWR_CTRL1_DIV2_DOWN_EN | \
172 PWR_CTRL1_DIV1_DOWN_EN | \
173 PWR_CTRL1_USE_CORE1_WFE | \
174 PWR_CTRL1_USE_CORE0_WFE | \
175 PWR_CTRL1_USE_CORE1_WFI | \
176 PWR_CTRL1_USE_CORE0_WFI;
177 __raw_writel(tmp, EXYNOS5_PWR_CTRL1);
178
179 /*
180 * Enable arm clock up (on exiting idle). Set arm divider
181 * ratios when not in idle along with the standby duration
182 * ratios.
183 */
184 tmp = PWR_CTRL2_DIV2_UP_EN | \
185 PWR_CTRL2_DIV1_UP_EN | \
186 PWR_CTRL2_DUR_STANDBY2_VAL | \
187 PWR_CTRL2_DUR_STANDBY1_VAL | \
188 PWR_CTRL2_CORE2_UP_RATIO | \
189 PWR_CTRL2_CORE1_UP_RATIO;
190 __raw_writel(tmp, EXYNOS5_PWR_CTRL2);
191}
192
160static int __init exynos4_init_cpuidle(void) 193static int __init exynos4_init_cpuidle(void)
161{ 194{
162 int i, max_cpuidle_state, cpu_id; 195 int i, max_cpuidle_state, cpu_id;
163 struct cpuidle_device *device; 196 struct cpuidle_device *device;
164 struct cpuidle_driver *drv = &exynos4_idle_driver; 197 struct cpuidle_driver *drv = &exynos4_idle_driver;
165 198
199 if (soc_is_exynos5250())
200 exynos5_core_down_clk();
201
166 /* Setup cpuidle driver */ 202 /* Setup cpuidle driver */
167 drv->state_count = (sizeof(exynos4_cpuidle_set) / 203 drv->state_count = (sizeof(exynos4_cpuidle_set) /
168 sizeof(struct cpuidle_state)); 204 sizeof(struct cpuidle_state));