aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2011-03-11 12:39:58 -0500
committerTony Lindgren <tony@atomide.com>2011-03-11 12:39:58 -0500
commit0d9596958d0be59e6bb373b5e6bc0729cbba5110 (patch)
tree516886b4e5a626c4b8c6d013e631b7234ef34128 /arch
parenta2358a7bc35e388978fc2f7f6b071a0fd27d78c1 (diff)
parent5e7c58dc8d9b7f31d418cf98c6a8cad84b86f510 (diff)
Merge branch 'for_2.6.39/pm-integration' of ssh://master.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap-pm into omap-for-linus
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-omap2/clock.c11
-rw-r--r--arch/arm/mach-omap2/opp3xxx_data.c46
-rw-r--r--arch/arm/mach-omap2/opp4xxx_data.c38
-rw-r--r--arch/arm/mach-omap2/pm34xx.c7
-rw-r--r--arch/arm/mach-omap2/powerdomain.c26
5 files changed, 84 insertions, 44 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index 46d03ccc2806..180299e4a838 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -22,7 +22,9 @@
22#include <linux/clk.h> 22#include <linux/clk.h>
23#include <linux/io.h> 23#include <linux/io.h>
24#include <linux/bitops.h> 24#include <linux/bitops.h>
25#include <trace/events/power.h>
25 26
27#include <asm/cpu.h>
26#include <plat/clock.h> 28#include <plat/clock.h>
27#include "clockdomain.h" 29#include "clockdomain.h"
28#include <plat/cpu.h> 30#include <plat/cpu.h>
@@ -261,8 +263,10 @@ void omap2_clk_disable(struct clk *clk)
261 263
262 pr_debug("clock: %s: disabling in hardware\n", clk->name); 264 pr_debug("clock: %s: disabling in hardware\n", clk->name);
263 265
264 if (clk->ops && clk->ops->disable) 266 if (clk->ops && clk->ops->disable) {
267 trace_clock_disable(clk->name, 0, smp_processor_id());
265 clk->ops->disable(clk); 268 clk->ops->disable(clk);
269 }
266 270
267 if (clk->clkdm) 271 if (clk->clkdm)
268 clkdm_clk_disable(clk->clkdm, clk); 272 clkdm_clk_disable(clk->clkdm, clk);
@@ -314,6 +318,7 @@ int omap2_clk_enable(struct clk *clk)
314 } 318 }
315 319
316 if (clk->ops && clk->ops->enable) { 320 if (clk->ops && clk->ops->enable) {
321 trace_clock_enable(clk->name, 1, smp_processor_id());
317 ret = clk->ops->enable(clk); 322 ret = clk->ops->enable(clk);
318 if (ret) { 323 if (ret) {
319 WARN(1, "clock: %s: could not enable: %d\n", 324 WARN(1, "clock: %s: could not enable: %d\n",
@@ -353,8 +358,10 @@ int omap2_clk_set_rate(struct clk *clk, unsigned long rate)
353 pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate); 358 pr_debug("clock: set_rate for clock %s to rate %ld\n", clk->name, rate);
354 359
355 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */ 360 /* dpll_ck, core_ck, virt_prcm_set; plus all clksel clocks */
356 if (clk->set_rate) 361 if (clk->set_rate) {
362 trace_clock_set_rate(clk->name, rate, smp_processor_id());
357 ret = clk->set_rate(clk, rate); 363 ret = clk->set_rate(clk, rate);
364 }
358 365
359 return ret; 366 return ret;
360} 367}
diff --git a/arch/arm/mach-omap2/opp3xxx_data.c b/arch/arm/mach-omap2/opp3xxx_data.c
index d2bd1bd83bf0..d95f3f945d4a 100644
--- a/arch/arm/mach-omap2/opp3xxx_data.c
+++ b/arch/arm/mach-omap2/opp3xxx_data.c
@@ -89,15 +89,15 @@ struct omap_volt_data omap36xx_vddcore_volt_data[] = {
89 89
90static struct omap_opp_def __initdata omap34xx_opp_def_list[] = { 90static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
91 /* MPU OPP1 */ 91 /* MPU OPP1 */
92 OPP_INITIALIZER("mpu", true, 125000000, 975000), 92 OPP_INITIALIZER("mpu", true, 125000000, OMAP3430_VDD_MPU_OPP1_UV),
93 /* MPU OPP2 */ 93 /* MPU OPP2 */
94 OPP_INITIALIZER("mpu", true, 250000000, 1075000), 94 OPP_INITIALIZER("mpu", true, 250000000, OMAP3430_VDD_MPU_OPP2_UV),
95 /* MPU OPP3 */ 95 /* MPU OPP3 */
96 OPP_INITIALIZER("mpu", true, 500000000, 1200000), 96 OPP_INITIALIZER("mpu", true, 500000000, OMAP3430_VDD_MPU_OPP3_UV),
97 /* MPU OPP4 */ 97 /* MPU OPP4 */
98 OPP_INITIALIZER("mpu", true, 550000000, 1270000), 98 OPP_INITIALIZER("mpu", true, 550000000, OMAP3430_VDD_MPU_OPP4_UV),
99 /* MPU OPP5 */ 99 /* MPU OPP5 */
100 OPP_INITIALIZER("mpu", true, 600000000, 1350000), 100 OPP_INITIALIZER("mpu", true, 600000000, OMAP3430_VDD_MPU_OPP5_UV),
101 101
102 /* 102 /*
103 * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is 103 * L3 OPP1 - 41.5 MHz is disabled because: The voltage for that OPP is
@@ -107,47 +107,47 @@ static struct omap_opp_def __initdata omap34xx_opp_def_list[] = {
107 * impact that frequency will do to the MPU and the whole system in 107 * impact that frequency will do to the MPU and the whole system in
108 * general. 108 * general.
109 */ 109 */
110 OPP_INITIALIZER("l3_main", false, 41500000, 975000), 110 OPP_INITIALIZER("l3_main", false, 41500000, OMAP3430_VDD_CORE_OPP1_UV),
111 /* L3 OPP2 */ 111 /* L3 OPP2 */
112 OPP_INITIALIZER("l3_main", true, 83000000, 1050000), 112 OPP_INITIALIZER("l3_main", true, 83000000, OMAP3430_VDD_CORE_OPP2_UV),
113 /* L3 OPP3 */ 113 /* L3 OPP3 */
114 OPP_INITIALIZER("l3_main", true, 166000000, 1150000), 114 OPP_INITIALIZER("l3_main", true, 166000000, OMAP3430_VDD_CORE_OPP3_UV),
115 115
116 /* DSP OPP1 */ 116 /* DSP OPP1 */
117 OPP_INITIALIZER("iva", true, 90000000, 975000), 117 OPP_INITIALIZER("iva", true, 90000000, OMAP3430_VDD_MPU_OPP1_UV),
118 /* DSP OPP2 */ 118 /* DSP OPP2 */
119 OPP_INITIALIZER("iva", true, 180000000, 1075000), 119 OPP_INITIALIZER("iva", true, 180000000, OMAP3430_VDD_MPU_OPP2_UV),
120 /* DSP OPP3 */ 120 /* DSP OPP3 */
121 OPP_INITIALIZER("iva", true, 360000000, 1200000), 121 OPP_INITIALIZER("iva", true, 360000000, OMAP3430_VDD_MPU_OPP3_UV),
122 /* DSP OPP4 */ 122 /* DSP OPP4 */
123 OPP_INITIALIZER("iva", true, 400000000, 1270000), 123 OPP_INITIALIZER("iva", true, 400000000, OMAP3430_VDD_MPU_OPP4_UV),
124 /* DSP OPP5 */ 124 /* DSP OPP5 */
125 OPP_INITIALIZER("iva", true, 430000000, 1350000), 125 OPP_INITIALIZER("iva", true, 430000000, OMAP3430_VDD_MPU_OPP5_UV),
126}; 126};
127 127
128static struct omap_opp_def __initdata omap36xx_opp_def_list[] = { 128static struct omap_opp_def __initdata omap36xx_opp_def_list[] = {
129 /* MPU OPP1 - OPP50 */ 129 /* MPU OPP1 - OPP50 */
130 OPP_INITIALIZER("mpu", true, 300000000, 1012500), 130 OPP_INITIALIZER("mpu", true, 300000000, OMAP3630_VDD_MPU_OPP50_UV),
131 /* MPU OPP2 - OPP100 */ 131 /* MPU OPP2 - OPP100 */
132 OPP_INITIALIZER("mpu", true, 600000000, 1200000), 132 OPP_INITIALIZER("mpu", true, 600000000, OMAP3630_VDD_MPU_OPP100_UV),
133 /* MPU OPP3 - OPP-Turbo */ 133 /* MPU OPP3 - OPP-Turbo */
134 OPP_INITIALIZER("mpu", false, 800000000, 1325000), 134 OPP_INITIALIZER("mpu", false, 800000000, OMAP3630_VDD_MPU_OPP120_UV),
135 /* MPU OPP4 - OPP-SB */ 135 /* MPU OPP4 - OPP-SB */
136 OPP_INITIALIZER("mpu", false, 1000000000, 1375000), 136 OPP_INITIALIZER("mpu", false, 1000000000, OMAP3630_VDD_MPU_OPP1G_UV),
137 137
138 /* L3 OPP1 - OPP50 */ 138 /* L3 OPP1 - OPP50 */
139 OPP_INITIALIZER("l3_main", true, 100000000, 1000000), 139 OPP_INITIALIZER("l3_main", true, 100000000, OMAP3630_VDD_CORE_OPP50_UV),
140 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ 140 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
141 OPP_INITIALIZER("l3_main", true, 200000000, 1200000), 141 OPP_INITIALIZER("l3_main", true, 200000000, OMAP3630_VDD_CORE_OPP100_UV),
142 142
143 /* DSP OPP1 - OPP50 */ 143 /* DSP OPP1 - OPP50 */
144 OPP_INITIALIZER("iva", true, 260000000, 1012500), 144 OPP_INITIALIZER("iva", true, 260000000, OMAP3630_VDD_MPU_OPP50_UV),
145 /* DSP OPP2 - OPP100 */ 145 /* DSP OPP2 - OPP100 */
146 OPP_INITIALIZER("iva", true, 520000000, 1200000), 146 OPP_INITIALIZER("iva", true, 520000000, OMAP3630_VDD_MPU_OPP100_UV),
147 /* DSP OPP3 - OPP-Turbo */ 147 /* DSP OPP3 - OPP-Turbo */
148 OPP_INITIALIZER("iva", false, 660000000, 1325000), 148 OPP_INITIALIZER("iva", false, 660000000, OMAP3630_VDD_MPU_OPP120_UV),
149 /* DSP OPP4 - OPP-SB */ 149 /* DSP OPP4 - OPP-SB */
150 OPP_INITIALIZER("iva", false, 800000000, 1375000), 150 OPP_INITIALIZER("iva", false, 800000000, OMAP3630_VDD_MPU_OPP1G_UV),
151}; 151};
152 152
153/** 153/**
diff --git a/arch/arm/mach-omap2/opp4xxx_data.c b/arch/arm/mach-omap2/opp4xxx_data.c
index 5030794d73ff..2293ba27101b 100644
--- a/arch/arm/mach-omap2/opp4xxx_data.c
+++ b/arch/arm/mach-omap2/opp4xxx_data.c
@@ -31,10 +31,10 @@
31 * voltage dependent data for each VDD. 31 * voltage dependent data for each VDD.
32 */ 32 */
33 33
34#define OMAP4430_VDD_MPU_OPP50_UV 930000 34#define OMAP4430_VDD_MPU_OPP50_UV 1025000
35#define OMAP4430_VDD_MPU_OPP100_UV 1100000 35#define OMAP4430_VDD_MPU_OPP100_UV 1200000
36#define OMAP4430_VDD_MPU_OPPTURBO_UV 1260000 36#define OMAP4430_VDD_MPU_OPPTURBO_UV 1313000
37#define OMAP4430_VDD_MPU_OPPNITRO_UV 1350000 37#define OMAP4430_VDD_MPU_OPPNITRO_UV 1375000
38 38
39struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = { 39struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
40 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c), 40 VOLT_DATA_DEFINE(OMAP4430_VDD_MPU_OPP50_UV, OMAP44XX_CONTROL_FUSE_MPU_OPP50, 0xf4, 0x0c),
@@ -44,9 +44,9 @@ struct omap_volt_data omap44xx_vdd_mpu_volt_data[] = {
44 VOLT_DATA_DEFINE(0, 0, 0, 0), 44 VOLT_DATA_DEFINE(0, 0, 0, 0),
45}; 45};
46 46
47#define OMAP4430_VDD_IVA_OPP50_UV 930000 47#define OMAP4430_VDD_IVA_OPP50_UV 1013000
48#define OMAP4430_VDD_IVA_OPP100_UV 1100000 48#define OMAP4430_VDD_IVA_OPP100_UV 1188000
49#define OMAP4430_VDD_IVA_OPPTURBO_UV 1260000 49#define OMAP4430_VDD_IVA_OPPTURBO_UV 1300000
50 50
51struct omap_volt_data omap44xx_vdd_iva_volt_data[] = { 51struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
52 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c), 52 VOLT_DATA_DEFINE(OMAP4430_VDD_IVA_OPP50_UV, OMAP44XX_CONTROL_FUSE_IVA_OPP50, 0xf4, 0x0c),
@@ -55,8 +55,8 @@ struct omap_volt_data omap44xx_vdd_iva_volt_data[] = {
55 VOLT_DATA_DEFINE(0, 0, 0, 0), 55 VOLT_DATA_DEFINE(0, 0, 0, 0),
56}; 56};
57 57
58#define OMAP4430_VDD_CORE_OPP50_UV 930000 58#define OMAP4430_VDD_CORE_OPP50_UV 1025000
59#define OMAP4430_VDD_CORE_OPP100_UV 1100000 59#define OMAP4430_VDD_CORE_OPP100_UV 1200000
60 60
61struct omap_volt_data omap44xx_vdd_core_volt_data[] = { 61struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
62 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c), 62 VOLT_DATA_DEFINE(OMAP4430_VDD_CORE_OPP50_UV, OMAP44XX_CONTROL_FUSE_CORE_OPP50, 0xf4, 0x0c),
@@ -67,18 +67,24 @@ struct omap_volt_data omap44xx_vdd_core_volt_data[] = {
67 67
68static struct omap_opp_def __initdata omap44xx_opp_def_list[] = { 68static struct omap_opp_def __initdata omap44xx_opp_def_list[] = {
69 /* MPU OPP1 - OPP50 */ 69 /* MPU OPP1 - OPP50 */
70 OPP_INITIALIZER("mpu", true, 300000000, 1100000), 70 OPP_INITIALIZER("mpu", true, 300000000, OMAP4430_VDD_MPU_OPP50_UV),
71 /* MPU OPP2 - OPP100 */ 71 /* MPU OPP2 - OPP100 */
72 OPP_INITIALIZER("mpu", true, 600000000, 1200000), 72 OPP_INITIALIZER("mpu", true, 600000000, OMAP4430_VDD_MPU_OPP100_UV),
73 /* MPU OPP3 - OPP-Turbo */ 73 /* MPU OPP3 - OPP-Turbo */
74 OPP_INITIALIZER("mpu", false, 800000000, 1260000), 74 OPP_INITIALIZER("mpu", true, 800000000, OMAP4430_VDD_MPU_OPPTURBO_UV),
75 /* MPU OPP4 - OPP-SB */ 75 /* MPU OPP4 - OPP-SB */
76 OPP_INITIALIZER("mpu", false, 1008000000, 1350000), 76 OPP_INITIALIZER("mpu", true, 1008000000, OMAP4430_VDD_MPU_OPPNITRO_UV),
77 /* L3 OPP1 - OPP50 */ 77 /* L3 OPP1 - OPP50 */
78 OPP_INITIALIZER("l3_main_1", true, 100000000, 930000), 78 OPP_INITIALIZER("l3_main_1", true, 100000000, OMAP4430_VDD_CORE_OPP50_UV),
79 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */ 79 /* L3 OPP2 - OPP100, OPP-Turbo, OPP-SB */
80 OPP_INITIALIZER("l3_main_1", true, 200000000, 1100000), 80 OPP_INITIALIZER("l3_main_1", true, 200000000, OMAP4430_VDD_CORE_OPP100_UV),
81 /* TODO: add IVA, DSP, aess, fdif, gpu */ 81 /* IVA OPP1 - OPP50 */
82 OPP_INITIALIZER("iva", true, 133000000, OMAP4430_VDD_IVA_OPP50_UV),
83 /* IVA OPP2 - OPP100 */
84 OPP_INITIALIZER("iva", true, 266100000, OMAP4430_VDD_IVA_OPP100_UV),
85 /* IVA OPP3 - OPP-Turbo */
86 OPP_INITIALIZER("iva", false, 332000000, OMAP4430_VDD_IVA_OPPTURBO_UV),
87 /* TODO: add DSP, aess, fdif, gpu */
82}; 88};
83 89
84/** 90/**
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c
index b5361a1260fc..0c5e3a46a3ad 100644
--- a/arch/arm/mach-omap2/pm34xx.c
+++ b/arch/arm/mach-omap2/pm34xx.c
@@ -29,6 +29,7 @@
29#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/slab.h> 30#include <linux/slab.h>
31#include <linux/console.h> 31#include <linux/console.h>
32#include <trace/events/power.h>
32 33
33#include <plat/sram.h> 34#include <plat/sram.h>
34#include "clockdomain.h" 35#include "clockdomain.h"
@@ -514,8 +515,14 @@ static void omap3_pm_idle(void)
514 if (omap_irq_pending() || need_resched()) 515 if (omap_irq_pending() || need_resched())
515 goto out; 516 goto out;
516 517
518 trace_power_start(POWER_CSTATE, 1, smp_processor_id());
519 trace_cpu_idle(1, smp_processor_id());
520
517 omap_sram_idle(); 521 omap_sram_idle();
518 522
523 trace_power_end(smp_processor_id());
524 trace_cpu_idle(PWR_EVENT_EXIT, smp_processor_id());
525
519out: 526out:
520 local_fiq_enable(); 527 local_fiq_enable();
521 local_irq_enable(); 528 local_irq_enable();
diff --git a/arch/arm/mach-omap2/powerdomain.c b/arch/arm/mach-omap2/powerdomain.c
index a11be81997c5..49c6513e90d8 100644
--- a/arch/arm/mach-omap2/powerdomain.c
+++ b/arch/arm/mach-omap2/powerdomain.c
@@ -19,12 +19,15 @@
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/errno.h> 20#include <linux/errno.h>
21#include <linux/string.h> 21#include <linux/string.h>
22#include <trace/events/power.h>
23
22#include "cm2xxx_3xxx.h" 24#include "cm2xxx_3xxx.h"
23#include "prcm44xx.h" 25#include "prcm44xx.h"
24#include "cm44xx.h" 26#include "cm44xx.h"
25#include "prm2xxx_3xxx.h" 27#include "prm2xxx_3xxx.h"
26#include "prm44xx.h" 28#include "prm44xx.h"
27 29
30#include <asm/cpu.h>
28#include <plat/cpu.h> 31#include <plat/cpu.h>
29#include "powerdomain.h" 32#include "powerdomain.h"
30#include "clockdomain.h" 33#include "clockdomain.h"
@@ -32,6 +35,8 @@
32 35
33#include "pm.h" 36#include "pm.h"
34 37
38#define PWRDM_TRACE_STATES_FLAG (1<<31)
39
35enum { 40enum {
36 PWRDM_STATE_NOW = 0, 41 PWRDM_STATE_NOW = 0,
37 PWRDM_STATE_PREV, 42 PWRDM_STATE_PREV,
@@ -130,8 +135,7 @@ static void _update_logic_membank_counters(struct powerdomain *pwrdm)
130static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag) 135static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
131{ 136{
132 137
133 int prev; 138 int prev, state, trace_state = 0;
134 int state;
135 139
136 if (pwrdm == NULL) 140 if (pwrdm == NULL)
137 return -EINVAL; 141 return -EINVAL;
@@ -148,6 +152,17 @@ static int _pwrdm_state_switch(struct powerdomain *pwrdm, int flag)
148 pwrdm->state_counter[prev]++; 152 pwrdm->state_counter[prev]++;
149 if (prev == PWRDM_POWER_RET) 153 if (prev == PWRDM_POWER_RET)
150 _update_logic_membank_counters(pwrdm); 154 _update_logic_membank_counters(pwrdm);
155 /*
156 * If the power domain did not hit the desired state,
157 * generate a trace event with both the desired and hit states
158 */
159 if (state != prev) {
160 trace_state = (PWRDM_TRACE_STATES_FLAG |
161 ((state & OMAP_POWERSTATE_MASK) << 8) |
162 ((prev & OMAP_POWERSTATE_MASK) << 0));
163 trace_power_domain_target(pwrdm->name, trace_state,
164 smp_processor_id());
165 }
151 break; 166 break;
152 default: 167 default:
153 return -EINVAL; 168 return -EINVAL;
@@ -406,8 +421,13 @@ int pwrdm_set_next_pwrst(struct powerdomain *pwrdm, u8 pwrst)
406 pr_debug("powerdomain: setting next powerstate for %s to %0x\n", 421 pr_debug("powerdomain: setting next powerstate for %s to %0x\n",
407 pwrdm->name, pwrst); 422 pwrdm->name, pwrst);
408 423
409 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) 424 if (arch_pwrdm && arch_pwrdm->pwrdm_set_next_pwrst) {
425 /* Trace the pwrdm desired target state */
426 trace_power_domain_target(pwrdm->name, pwrst,
427 smp_processor_id());
428 /* Program the pwrdm desired target state */
410 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst); 429 ret = arch_pwrdm->pwrdm_set_next_pwrst(pwrdm, pwrst);
430 }
411 431
412 return ret; 432 return ret;
413} 433}