aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/cpuidle-imx6sx.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 12:27:54 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-02-17 12:27:54 -0500
commit878ba61aa98cbb97a513757800e77613f856a029 (patch)
treec03b8373cdb7163f81141a867c9cda1a9f71e73e /arch/arm/mach-imx/cpuidle-imx6sx.c
parentea7531ac4a9d0b39edce43472147dc41cc2b7a34 (diff)
parentdf1a66812535e04bfd960e15d5be4893853b6730 (diff)
Merge tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC platform changes from Olof Johansson: "New and updated SoC support. Also included are some cleanups where the platform maintainers hadn't separated cleanups from new developent in separate branches. Some of the larger things worth pointing out: - A large set of changes from Alexandre Belloni and Nicolas Ferre preparing at91 platforms for multiplatform and cleaning up quite a bit in the process. - Removal of CSR's "Marco" SoC platform that never made it out to the market. We love seeing these since it means the vendor published support before product was out, which is exactly what we want! New platforms this release are: - Conexant Digicolor (CX92755 SoC) - Hisilicon HiP01 SoC - CSR/sirf Atlas7 SoC - ST STiH418 SoC - Common code changes for Nvidia Tegra132 (64-bit SoC) We're seeing more and more platforms having a harder time labelling changes as cleanups vs new development -- which is a good sign that we've come quite far on the cleanup effort. So over time we might start combining the cleanup and new-development branches more" * tag 'soc-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (124 commits) ARM: at91/trivial: unify functions and machine names ARM: at91: remove at91_dt_initialize and machine init_early() ARM: at91: change board files into SoC files ARM: at91: remove at91_boot_soc ARM: at91: move alternative initial mapping to board-dt-sama5.c ARM: at91: merge all SOC_AT91SAM9xxx ARM: at91: at91rm9200: set idle and restart from rm9200_dt_device_init() ARM: digicolor: select syscon and timer ARM: zynq: Simplify SLCR initialization ARM: zynq: PM: Fixed simple typo. ARM: zynq: Setup default gpio number for Xilinx Zynq ARM: digicolor: add low level debug support ARM: initial support for Conexant Digicolor CX92755 SoC ARM: OMAP2+: Add dm816x hwmod support ARM: OMAP2+: Add clock domain support for dm816x ARM: OMAP2+: Add board-generic.c entry for ti81xx ARM: at91: pm: remove warning to remove SOC_AT91SAM9263 usage ARM: at91: remove unused mach/system_rev.h ARM: at91: stop using HAVE_AT91_DBGUx ARM: at91: fix ordering of SRAM and PM initialization ...
Diffstat (limited to 'arch/arm/mach-imx/cpuidle-imx6sx.c')
-rw-r--r--arch/arm/mach-imx/cpuidle-imx6sx.c105
1 files changed, 105 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-imx/cpuidle-imx6sx.c
new file mode 100644
index 000000000000..5a36722b089d
--- /dev/null
+++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
@@ -0,0 +1,105 @@
1/*
2 * Copyright (C) 2014 Freescale Semiconductor, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#include <linux/cpuidle.h>
10#include <linux/cpu_pm.h>
11#include <linux/module.h>
12#include <asm/cpuidle.h>
13#include <asm/proc-fns.h>
14#include <asm/suspend.h>
15
16#include "common.h"
17#include "cpuidle.h"
18
19static int imx6sx_idle_finish(unsigned long val)
20{
21 cpu_do_idle();
22
23 return 0;
24}
25
26static int imx6sx_enter_wait(struct cpuidle_device *dev,
27 struct cpuidle_driver *drv, int index)
28{
29 imx6q_set_lpm(WAIT_UNCLOCKED);
30
31 switch (index) {
32 case 1:
33 cpu_do_idle();
34 break;
35 case 2:
36 imx6_enable_rbc(true);
37 imx_gpc_set_arm_power_in_lpm(true);
38 imx_set_cpu_jump(0, v7_cpu_resume);
39 /* Need to notify there is a cpu pm operation. */
40 cpu_pm_enter();
41 cpu_cluster_pm_enter();
42
43 cpu_suspend(0, imx6sx_idle_finish);
44
45 cpu_cluster_pm_exit();
46 cpu_pm_exit();
47 imx_gpc_set_arm_power_in_lpm(false);
48 imx6_enable_rbc(false);
49 break;
50 default:
51 break;
52 }
53
54 imx6q_set_lpm(WAIT_CLOCKED);
55
56 return index;
57}
58
59static struct cpuidle_driver imx6sx_cpuidle_driver = {
60 .name = "imx6sx_cpuidle",
61 .owner = THIS_MODULE,
62 .states = {
63 /* WFI */
64 ARM_CPUIDLE_WFI_STATE,
65 /* WAIT */
66 {
67 .exit_latency = 50,
68 .target_residency = 75,
69 .flags = CPUIDLE_FLAG_TIMER_STOP,
70 .enter = imx6sx_enter_wait,
71 .name = "WAIT",
72 .desc = "Clock off",
73 },
74 /* WAIT + ARM power off */
75 {
76 /*
77 * ARM gating 31us * 5 + RBC clear 65us
78 * and some margin for SW execution, here set it
79 * to 300us.
80 */
81 .exit_latency = 300,
82 .target_residency = 500,
83 .enter = imx6sx_enter_wait,
84 .name = "LOW-POWER-IDLE",
85 .desc = "ARM power off",
86 },
87 },
88 .state_count = 3,
89 .safe_state_index = 0,
90};
91
92int __init imx6sx_cpuidle_init(void)
93{
94 imx6_enable_rbc(false);
95 /*
96 * set ARM power up/down timing to the fastest,
97 * sw2iso and sw can be set to one 32K cycle = 31us
98 * except for power up sw2iso which need to be
99 * larger than LDO ramp up time.
100 */
101 imx_gpc_set_arm_power_up_timing(2, 1);
102 imx_gpc_set_arm_power_down_timing(1, 1);
103
104 return cpuidle_register(&imx6sx_cpuidle_driver, NULL);
105}