diff options
author | Kalle Jokiniemi <kalle.jokiniemi@digia.com> | 2009-10-29 04:30:19 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2010-02-23 14:05:02 -0500 |
commit | 709731bb369b562586ee4c60f3f0393eb94dd9d6 (patch) | |
tree | c1c44e6f297e5ea3686eaa4035b824e4e9181f56 /arch | |
parent | bb4de3df69e2993d642e38e17a3eccfe37845acc (diff) |
OMAP3: cpuidle: Add valid field into C-state parameter passing
Different boards benefit differently from the available
seven C-states for cpu idle. In most cases, only few,
properly spaced (in terms of consumption and latency)
C-states are required to make the power management
optimal. Hence we need a possibility to pass which
C-states are actually used for each board.
So added the valid field to cpuidle_params and added
support to 3430sdp, which uses the paramenter passing.
Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/board-3430sdp.c | 14 | ||||
-rw-r--r-- | arch/arm/mach-omap2/cpuidle34xx.c | 37 | ||||
-rw-r--r-- | arch/arm/mach-omap2/pm.h | 1 |
3 files changed, 31 insertions, 21 deletions
diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index 99f295e81db4..d4647abb56f3 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c | |||
@@ -61,19 +61,19 @@ | |||
61 | /* FIXME: These values need to be updated based on more profiling on 3430sdp*/ | 61 | /* FIXME: These values need to be updated based on more profiling on 3430sdp*/ |
62 | static struct cpuidle_params omap3_cpuidle_params_table[] = { | 62 | static struct cpuidle_params omap3_cpuidle_params_table[] = { |
63 | /* C1 */ | 63 | /* C1 */ |
64 | {2, 2, 5}, | 64 | {1, 2, 2, 5}, |
65 | /* C2 */ | 65 | /* C2 */ |
66 | {10, 10, 30}, | 66 | {1, 10, 10, 30}, |
67 | /* C3 */ | 67 | /* C3 */ |
68 | {50, 50, 300}, | 68 | {1, 50, 50, 300}, |
69 | /* C4 */ | 69 | /* C4 */ |
70 | {1500, 1800, 4000}, | 70 | {1, 1500, 1800, 4000}, |
71 | /* C5 */ | 71 | /* C5 */ |
72 | {2500, 7500, 12000}, | 72 | {1, 2500, 7500, 12000}, |
73 | /* C6 */ | 73 | /* C6 */ |
74 | {3000, 8500, 15000}, | 74 | {1, 3000, 8500, 15000}, |
75 | /* C7 */ | 75 | /* C7 */ |
76 | {10000, 30000, 300000}, | 76 | {1, 10000, 30000, 300000}, |
77 | }; | 77 | }; |
78 | 78 | ||
79 | static int board_keymap[] = { | 79 | static int board_keymap[] = { |
diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 597148eed0bd..3d3d035db9af 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c | |||
@@ -71,19 +71,19 @@ struct powerdomain *mpu_pd, *core_pd; | |||
71 | */ | 71 | */ |
72 | static struct cpuidle_params cpuidle_params_table[] = { | 72 | static struct cpuidle_params cpuidle_params_table[] = { |
73 | /* C1 */ | 73 | /* C1 */ |
74 | {2, 2, 5}, | 74 | {1, 2, 2, 5}, |
75 | /* C2 */ | 75 | /* C2 */ |
76 | {10, 10, 30}, | 76 | {1, 10, 10, 30}, |
77 | /* C3 */ | 77 | /* C3 */ |
78 | {50, 50, 300}, | 78 | {1, 50, 50, 300}, |
79 | /* C4 */ | 79 | /* C4 */ |
80 | {1500, 1800, 4000}, | 80 | {1, 1500, 1800, 4000}, |
81 | /* C5 */ | 81 | /* C5 */ |
82 | {2500, 7500, 12000}, | 82 | {1, 2500, 7500, 12000}, |
83 | /* C6 */ | 83 | /* C6 */ |
84 | {3000, 8500, 15000}, | 84 | {1, 3000, 8500, 15000}, |
85 | /* C7 */ | 85 | /* C7 */ |
86 | {10000, 30000, 300000}, | 86 | {1, 10000, 30000, 300000}, |
87 | }; | 87 | }; |
88 | 88 | ||
89 | static int omap3_idle_bm_check(void) | 89 | static int omap3_idle_bm_check(void) |
@@ -277,6 +277,8 @@ void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) | |||
277 | return; | 277 | return; |
278 | 278 | ||
279 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { | 279 | for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { |
280 | cpuidle_params_table[i].valid = | ||
281 | cpuidle_board_params[i].valid; | ||
280 | cpuidle_params_table[i].sleep_latency = | 282 | cpuidle_params_table[i].sleep_latency = |
281 | cpuidle_board_params[i].sleep_latency; | 283 | cpuidle_board_params[i].sleep_latency; |
282 | cpuidle_params_table[i].wake_latency = | 284 | cpuidle_params_table[i].wake_latency = |
@@ -301,7 +303,8 @@ void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) | |||
301 | void omap_init_power_states(void) | 303 | void omap_init_power_states(void) |
302 | { | 304 | { |
303 | /* C1 . MPU WFI + Core active */ | 305 | /* C1 . MPU WFI + Core active */ |
304 | omap3_power_states[OMAP3_STATE_C1].valid = 1; | 306 | omap3_power_states[OMAP3_STATE_C1].valid = |
307 | cpuidle_params_table[OMAP3_STATE_C1].valid; | ||
305 | omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1; | 308 | omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1; |
306 | omap3_power_states[OMAP3_STATE_C1].sleep_latency = | 309 | omap3_power_states[OMAP3_STATE_C1].sleep_latency = |
307 | cpuidle_params_table[OMAP3_STATE_C1].sleep_latency; | 310 | cpuidle_params_table[OMAP3_STATE_C1].sleep_latency; |
@@ -314,7 +317,8 @@ void omap_init_power_states(void) | |||
314 | omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; | 317 | omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; |
315 | 318 | ||
316 | /* C2 . MPU WFI + Core inactive */ | 319 | /* C2 . MPU WFI + Core inactive */ |
317 | omap3_power_states[OMAP3_STATE_C2].valid = 1; | 320 | omap3_power_states[OMAP3_STATE_C2].valid = |
321 | cpuidle_params_table[OMAP3_STATE_C2].valid; | ||
318 | omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; | 322 | omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; |
319 | omap3_power_states[OMAP3_STATE_C2].sleep_latency = | 323 | omap3_power_states[OMAP3_STATE_C2].sleep_latency = |
320 | cpuidle_params_table[OMAP3_STATE_C2].sleep_latency; | 324 | cpuidle_params_table[OMAP3_STATE_C2].sleep_latency; |
@@ -327,7 +331,8 @@ void omap_init_power_states(void) | |||
327 | omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; | 331 | omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; |
328 | 332 | ||
329 | /* C3 . MPU CSWR + Core inactive */ | 333 | /* C3 . MPU CSWR + Core inactive */ |
330 | omap3_power_states[OMAP3_STATE_C3].valid = 1; | 334 | omap3_power_states[OMAP3_STATE_C3].valid = |
335 | cpuidle_params_table[OMAP3_STATE_C3].valid; | ||
331 | omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; | 336 | omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; |
332 | omap3_power_states[OMAP3_STATE_C3].sleep_latency = | 337 | omap3_power_states[OMAP3_STATE_C3].sleep_latency = |
333 | cpuidle_params_table[OMAP3_STATE_C3].sleep_latency; | 338 | cpuidle_params_table[OMAP3_STATE_C3].sleep_latency; |
@@ -341,7 +346,8 @@ void omap_init_power_states(void) | |||
341 | CPUIDLE_FLAG_CHECK_BM; | 346 | CPUIDLE_FLAG_CHECK_BM; |
342 | 347 | ||
343 | /* C4 . MPU OFF + Core inactive */ | 348 | /* C4 . MPU OFF + Core inactive */ |
344 | omap3_power_states[OMAP3_STATE_C4].valid = 1; | 349 | omap3_power_states[OMAP3_STATE_C4].valid = |
350 | cpuidle_params_table[OMAP3_STATE_C4].valid; | ||
345 | omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; | 351 | omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; |
346 | omap3_power_states[OMAP3_STATE_C4].sleep_latency = | 352 | omap3_power_states[OMAP3_STATE_C4].sleep_latency = |
347 | cpuidle_params_table[OMAP3_STATE_C4].sleep_latency; | 353 | cpuidle_params_table[OMAP3_STATE_C4].sleep_latency; |
@@ -355,7 +361,8 @@ void omap_init_power_states(void) | |||
355 | CPUIDLE_FLAG_CHECK_BM; | 361 | CPUIDLE_FLAG_CHECK_BM; |
356 | 362 | ||
357 | /* C5 . MPU CSWR + Core CSWR*/ | 363 | /* C5 . MPU CSWR + Core CSWR*/ |
358 | omap3_power_states[OMAP3_STATE_C5].valid = 1; | 364 | omap3_power_states[OMAP3_STATE_C5].valid = |
365 | cpuidle_params_table[OMAP3_STATE_C5].valid; | ||
359 | omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; | 366 | omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; |
360 | omap3_power_states[OMAP3_STATE_C5].sleep_latency = | 367 | omap3_power_states[OMAP3_STATE_C5].sleep_latency = |
361 | cpuidle_params_table[OMAP3_STATE_C5].sleep_latency; | 368 | cpuidle_params_table[OMAP3_STATE_C5].sleep_latency; |
@@ -369,7 +376,8 @@ void omap_init_power_states(void) | |||
369 | CPUIDLE_FLAG_CHECK_BM; | 376 | CPUIDLE_FLAG_CHECK_BM; |
370 | 377 | ||
371 | /* C6 . MPU OFF + Core CSWR */ | 378 | /* C6 . MPU OFF + Core CSWR */ |
372 | omap3_power_states[OMAP3_STATE_C6].valid = 1; | 379 | omap3_power_states[OMAP3_STATE_C6].valid = |
380 | cpuidle_params_table[OMAP3_STATE_C6].valid; | ||
373 | omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; | 381 | omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; |
374 | omap3_power_states[OMAP3_STATE_C6].sleep_latency = | 382 | omap3_power_states[OMAP3_STATE_C6].sleep_latency = |
375 | cpuidle_params_table[OMAP3_STATE_C6].sleep_latency; | 383 | cpuidle_params_table[OMAP3_STATE_C6].sleep_latency; |
@@ -383,7 +391,8 @@ void omap_init_power_states(void) | |||
383 | CPUIDLE_FLAG_CHECK_BM; | 391 | CPUIDLE_FLAG_CHECK_BM; |
384 | 392 | ||
385 | /* C7 . MPU OFF + Core OFF */ | 393 | /* C7 . MPU OFF + Core OFF */ |
386 | omap3_power_states[OMAP3_STATE_C7].valid = 1; | 394 | omap3_power_states[OMAP3_STATE_C7].valid = |
395 | cpuidle_params_table[OMAP3_STATE_C7].valid; | ||
387 | omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; | 396 | omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; |
388 | omap3_power_states[OMAP3_STATE_C7].sleep_latency = | 397 | omap3_power_states[OMAP3_STATE_C7].sleep_latency = |
389 | cpuidle_params_table[OMAP3_STATE_C7].sleep_latency; | 398 | cpuidle_params_table[OMAP3_STATE_C7].sleep_latency; |
diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 58a2671e6147..bd6466a2b039 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h | |||
@@ -24,6 +24,7 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); | |||
24 | extern int omap3_idle_init(void); | 24 | extern int omap3_idle_init(void); |
25 | 25 | ||
26 | struct cpuidle_params { | 26 | struct cpuidle_params { |
27 | u8 valid; | ||
27 | u32 sleep_latency; | 28 | u32 sleep_latency; |
28 | u32 wake_latency; | 29 | u32 wake_latency; |
29 | u32 threshold; | 30 | u32 threshold; |