* [PATCH 0/3] Update CPU idle parameter passing
@ 2009-10-29 8:30 Kalle Jokiniemi
2009-10-29 8:30 ` [PATCH 1/3] OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle Kalle Jokiniemi
2009-11-12 0:28 ` [PATCH 0/3] Update CPU idle parameter passing Kevin Hilman
0 siblings, 2 replies; 5+ messages in thread
From: Kalle Jokiniemi @ 2009-10-29 8:30 UTC (permalink / raw)
To: khilman; +Cc: linux-omap, rnayak, jouni.hogander
Hi Kevin,
Made some patches to enable setting RX-51 cpu idle parameters
as we use them. Added "valid" field passing to cpuidle_params
in the process.
Tested on RX-51. Applies on top of linux-omap/pm branch.
Kalle Jokiniemi (3):
OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle
OMAP3: Add valid field into C-state parameter passing
OMAP: RX-51: Pass cpu idle parameters
kajokini@ubuntu:~/work/linux-open/linux-omap$ git diff --stat HEAD~3..HEAD
arch/arm/mach-omap2/board-3430sdp.c | 14 ++++++------
arch/arm/mach-omap2/board-rx51.c | 18 +++++++++++++++++
arch/arm/mach-omap2/cpuidle34xx.c | 37 +++++++++++++++++++++-------------
arch/arm/mach-omap2/pm.h | 8 +++++++
4 files changed, 56 insertions(+), 21 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread* [PATCH 1/3] OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle 2009-10-29 8:30 [PATCH 0/3] Update CPU idle parameter passing Kalle Jokiniemi @ 2009-10-29 8:30 ` Kalle Jokiniemi 2009-10-29 8:30 ` [PATCH 2/3] OMAP3: Add valid field into C-state parameter passing Kalle Jokiniemi 2009-11-12 0:28 ` [PATCH 0/3] Update CPU idle parameter passing Kevin Hilman 1 sibling, 1 reply; 5+ messages in thread From: Kalle Jokiniemi @ 2009-10-29 8:30 UTC (permalink / raw) To: khilman; +Cc: linux-omap, rnayak, jouni.hogander, Kalle Jokiniemi Building without CONFIG_CPU_IDLE causes build to fail if cpu idle parameters are tried to pass using omap3_pm_init_cpuidle function. Fixed by defining a dummy function for non-cpu idle builds. Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com> --- arch/arm/mach-omap2/pm.h | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index b576424..b9421e8 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -49,7 +49,14 @@ struct cpuidle_params { }; extern void omap3_pm_init_vc(struct prm_setup_vc *setup_vc); +#ifdef CONFIG_CPU_IDLE extern void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params); +#else +static inline void omap3_pm_init_cpuidle( + struct cpuidle_params *cpuidle_board_params) +{ +} +#endif extern int resource_set_opp_level(int res, u32 target_level, int flags); extern int resource_access_opp_lock(int res, int delta); -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/3] OMAP3: Add valid field into C-state parameter passing 2009-10-29 8:30 ` [PATCH 1/3] OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle Kalle Jokiniemi @ 2009-10-29 8:30 ` Kalle Jokiniemi 2009-10-29 8:30 ` [PATCH 3/3] OMAP: RX-51: Pass cpu idle parameters Kalle Jokiniemi 0 siblings, 1 reply; 5+ messages in thread From: Kalle Jokiniemi @ 2009-10-29 8:30 UTC (permalink / raw) To: khilman; +Cc: linux-omap, rnayak, jouni.hogander, Kalle Jokiniemi 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> --- arch/arm/mach-omap2/board-3430sdp.c | 14 ++++++------ arch/arm/mach-omap2/cpuidle34xx.c | 37 +++++++++++++++++++++------------- 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 11f0dc5..74c20ee 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -76,19 +76,19 @@ static struct prm_setup_vc omap3_setuptime_table = { /* FIXME: These values need to be updated based on more profiling on 3430sdp*/ static struct cpuidle_params omap3_cpuidle_params_table[] = { /* C1 */ - {2, 2, 5}, + {1, 2, 2, 5}, /* C2 */ - {10, 10, 30}, + {1, 10, 10, 30}, /* C3 */ - {50, 50, 300}, + {1, 50, 50, 300}, /* C4 */ - {1500, 1800, 4000}, + {1, 1500, 1800, 4000}, /* C5 */ - {2500, 7500, 12000}, + {1, 2500, 7500, 12000}, /* C6 */ - {3000, 8500, 15000}, + {1, 3000, 8500, 15000}, /* C7 */ - {10000, 30000, 300000}, + {1, 10000, 30000, 300000}, }; static int board_keymap[] = { diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index fdfa1d5..9c9474a 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -69,19 +69,19 @@ struct powerdomain *mpu_pd, *core_pd; */ static struct cpuidle_params cpuidle_params_table[] = { /* C1 */ - {2, 2, 5}, + {1, 2, 2, 5}, /* C2 */ - {10, 10, 30}, + {1, 10, 10, 30}, /* C3 */ - {50, 50, 300}, + {1, 50, 50, 300}, /* C4 */ - {1500, 1800, 4000}, + {1, 1500, 1800, 4000}, /* C5 */ - {2500, 7500, 12000}, + {1, 2500, 7500, 12000}, /* C6 */ - {3000, 8500, 15000}, + {1, 3000, 8500, 15000}, /* C7 */ - {10000, 30000, 300000}, + {1, 10000, 30000, 300000}, }; static int omap3_idle_bm_check(void) @@ -197,6 +197,8 @@ void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) return; for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { + cpuidle_params_table[i].valid = + cpuidle_board_params[i].valid; cpuidle_params_table[i].sleep_latency = cpuidle_board_params[i].sleep_latency; cpuidle_params_table[i].wake_latency = @@ -221,7 +223,8 @@ void omap3_pm_init_cpuidle(struct cpuidle_params *cpuidle_board_params) void omap_init_power_states(void) { /* C1 . MPU WFI + Core active */ - omap3_power_states[OMAP3_STATE_C1].valid = 1; + omap3_power_states[OMAP3_STATE_C1].valid = + cpuidle_params_table[OMAP3_STATE_C1].valid; omap3_power_states[OMAP3_STATE_C1].type = OMAP3_STATE_C1; omap3_power_states[OMAP3_STATE_C1].sleep_latency = cpuidle_params_table[OMAP3_STATE_C1].sleep_latency; @@ -234,7 +237,8 @@ void omap_init_power_states(void) omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; /* C2 . MPU WFI + Core inactive */ - omap3_power_states[OMAP3_STATE_C2].valid = 1; + omap3_power_states[OMAP3_STATE_C2].valid = + cpuidle_params_table[OMAP3_STATE_C2].valid; omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; omap3_power_states[OMAP3_STATE_C2].sleep_latency = cpuidle_params_table[OMAP3_STATE_C2].sleep_latency; @@ -247,7 +251,8 @@ void omap_init_power_states(void) omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; /* C3 . MPU CSWR + Core inactive */ - omap3_power_states[OMAP3_STATE_C3].valid = 1; + omap3_power_states[OMAP3_STATE_C3].valid = + cpuidle_params_table[OMAP3_STATE_C3].valid; omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; omap3_power_states[OMAP3_STATE_C3].sleep_latency = cpuidle_params_table[OMAP3_STATE_C3].sleep_latency; @@ -261,7 +266,8 @@ void omap_init_power_states(void) CPUIDLE_FLAG_CHECK_BM; /* C4 . MPU OFF + Core inactive */ - omap3_power_states[OMAP3_STATE_C4].valid = 1; + omap3_power_states[OMAP3_STATE_C4].valid = + cpuidle_params_table[OMAP3_STATE_C4].valid; omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; omap3_power_states[OMAP3_STATE_C4].sleep_latency = cpuidle_params_table[OMAP3_STATE_C4].sleep_latency; @@ -275,7 +281,8 @@ void omap_init_power_states(void) CPUIDLE_FLAG_CHECK_BM; /* C5 . MPU CSWR + Core CSWR*/ - omap3_power_states[OMAP3_STATE_C5].valid = 1; + omap3_power_states[OMAP3_STATE_C5].valid = + cpuidle_params_table[OMAP3_STATE_C5].valid; omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; omap3_power_states[OMAP3_STATE_C5].sleep_latency = cpuidle_params_table[OMAP3_STATE_C5].sleep_latency; @@ -289,7 +296,8 @@ void omap_init_power_states(void) CPUIDLE_FLAG_CHECK_BM; /* C6 . MPU OFF + Core CSWR */ - omap3_power_states[OMAP3_STATE_C6].valid = 1; + omap3_power_states[OMAP3_STATE_C6].valid = + cpuidle_params_table[OMAP3_STATE_C6].valid; omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; omap3_power_states[OMAP3_STATE_C6].sleep_latency = cpuidle_params_table[OMAP3_STATE_C6].sleep_latency; @@ -303,7 +311,8 @@ void omap_init_power_states(void) CPUIDLE_FLAG_CHECK_BM; /* C7 . MPU OFF + Core OFF */ - omap3_power_states[OMAP3_STATE_C7].valid = 1; + omap3_power_states[OMAP3_STATE_C7].valid = + cpuidle_params_table[OMAP3_STATE_C7].valid; omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; omap3_power_states[OMAP3_STATE_C7].sleep_latency = 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 b9421e8..c195b14 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -43,6 +43,7 @@ struct prm_setup_vc { }; struct cpuidle_params { + u8 valid; u32 sleep_latency; u32 wake_latency; u32 threshold; -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 3/3] OMAP: RX-51: Pass cpu idle parameters 2009-10-29 8:30 ` [PATCH 2/3] OMAP3: Add valid field into C-state parameter passing Kalle Jokiniemi @ 2009-10-29 8:30 ` Kalle Jokiniemi 0 siblings, 0 replies; 5+ messages in thread From: Kalle Jokiniemi @ 2009-10-29 8:30 UTC (permalink / raw) To: khilman; +Cc: linux-omap, rnayak, jouni.hogander, Kalle Jokiniemi Pass cpuidle parameters for RX-51. Numbers based on measurements made in October 2009 for PM optimized kernel with CPU freq enabled. Assumes OPP2 (main idle OPP, and worst case latencies). Signed-off-by: Kalle Jokiniemi <kalle.jokiniemi@digia.com> --- arch/arm/mach-omap2/board-rx51.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 527f0c6..02fb33b 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -32,11 +32,28 @@ #include <plat/usb.h> #include "omap3-opp.h" +#include "pm.h" #define RX51_GPIO_SLEEP_IND 162 struct omap_sdrc_params *rx51_get_sdram_timings(void); +static struct cpuidle_params rx51_cpuidle_params[] = { + /* C1 */ + {1, 110, 162, 5}, + /* C2 */ + {1, 106, 180, 309}, + /* C3 */ + {0, 107, 410, 46057}, + /* C4 */ + {0, 121, 3374, 46057}, + /* C5 */ + {1, 855, 1146, 46057}, + /* C6 */ + {0, 7580, 4134, 484329}, + /* C7 */ + {1, 7505, 15274, 484329}, +}; static struct gpio_led gpio_leds[] = { { .name = "sleep_ind", @@ -84,6 +101,7 @@ static void __init rx51_init_irq(void) { omap_board_config = rx51_config; omap_board_config_size = ARRAY_SIZE(rx51_config); + omap3_pm_init_cpuidle(rx51_cpuidle_params); omap2_init_common_hw(rx51_get_sdram_timings(), rx51_get_sdram_timings(), omap3_mpu_rate_table, omap3_dsp_rate_table, omap3_l3_rate_table); -- 1.5.4.3 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 0/3] Update CPU idle parameter passing 2009-10-29 8:30 [PATCH 0/3] Update CPU idle parameter passing Kalle Jokiniemi 2009-10-29 8:30 ` [PATCH 1/3] OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle Kalle Jokiniemi @ 2009-11-12 0:28 ` Kevin Hilman 1 sibling, 0 replies; 5+ messages in thread From: Kevin Hilman @ 2009-11-12 0:28 UTC (permalink / raw) To: Kalle Jokiniemi; +Cc: linux-omap, rnayak, jouni.hogander Kalle Jokiniemi <kalle.jokiniemi@digia.com> writes: > Hi Kevin, > > Made some patches to enable setting RX-51 cpu idle parameters > as we use them. Added "valid" field passing to cpuidle_params > in the process. > > Tested on RX-51. Applies on top of linux-omap/pm branch. > > Kalle Jokiniemi (3): > OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle > OMAP3: Add valid field into C-state parameter passing > OMAP: RX-51: Pass cpu idle parameters Thanks, applying this series to PM branch. Kevin > kajokini@ubuntu:~/work/linux-open/linux-omap$ git diff --stat HEAD~3..HEAD > arch/arm/mach-omap2/board-3430sdp.c | 14 ++++++------ > arch/arm/mach-omap2/board-rx51.c | 18 +++++++++++++++++ > arch/arm/mach-omap2/cpuidle34xx.c | 37 +++++++++++++++++++++------------- > arch/arm/mach-omap2/pm.h | 8 +++++++ > 4 files changed, 56 insertions(+), 21 deletions(-) ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-11-12 0:28 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-10-29 8:30 [PATCH 0/3] Update CPU idle parameter passing Kalle Jokiniemi 2009-10-29 8:30 ` [PATCH 1/3] OMAP:PM: Fix non-cpu idle builds using omap3_pm_init_cpuidle Kalle Jokiniemi 2009-10-29 8:30 ` [PATCH 2/3] OMAP3: Add valid field into C-state parameter passing Kalle Jokiniemi 2009-10-29 8:30 ` [PATCH 3/3] OMAP: RX-51: Pass cpu idle parameters Kalle Jokiniemi 2009-11-12 0:28 ` [PATCH 0/3] Update CPU idle parameter passing Kevin Hilman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox