* [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files @ 2009-06-29 14:35 Rajendra Nayak 2009-06-29 14:35 ` [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak 2009-09-30 19:13 ` [PATCH 1/2] OMAP3: PM: Configure PRM setup times " Kevin Hilman 0 siblings, 2 replies; 7+ messages in thread From: Rajendra Nayak @ 2009-06-29 14:35 UTC (permalink / raw) To: linux-omap; +Cc: Rajendra Nayak The setup times to be programmed in the PRM module on OMAP (for clksetup, voltsetup etc) are board specific. They depend heavily on the PMIC used and even on different boards with the same PMIC, they vary based on the sleep/wake sequence used, system clock speed et al. This patch makes it possible for these setup values to be configured from different board files. Signed-off-by: Rajendra Nayak <rnayak@ti.com> --- arch/arm/mach-omap2/board-3430sdp.c | 20 +++++++++++++++++++- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-generic.c | 2 +- arch/arm/mach-omap2/board-h4.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom2.c | 2 +- arch/arm/mach-omap2/io.c | 5 ++++- arch/arm/mach-omap2/pm.c | 7 +++++++ arch/arm/mach-omap2/pm.h | 16 +++++++++------- arch/arm/mach-omap2/pm34xx.c | 10 ++++++++++ arch/arm/plat-omap/include/mach/io.h | 4 +++- 15 files changed, 61 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index e9a4d10..b43cf94 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -58,6 +58,23 @@ #define TWL4030_MSECURE_GPIO 22 +/* FIXME: These are not the optimal setup values to be used on 3430sdp*/ +static struct prm_setup_vc omap3_setuptime_table = { + .clksetup = 0xff, + .voltsetup_time1 = 0xfff, + .voltsetup_time2 = 0xfff, + .voltoffset = 0xff, + .voltsetup2 = 0xff, + .vdd0_on = 0x30, + .vdd0_onlp = 0x20, + .vdd0_ret = 0x1e, + .vdd0_off = 0x00, + .vdd1_on = 0x2c, + .vdd1_onlp = 0x20, + .vdd1_ret = 0x1e, + .vdd1_off = 0x00, +}; + static int sdp3430_keymap[] = { KEY(0, 0, KEY_LEFT), KEY(0, 1, KEY_RIGHT), @@ -174,7 +191,8 @@ static struct platform_device *sdp3430_devices[] __initdata = { static void __init omap_3430sdp_init_irq(void) { omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + omap3_dsp_rate_table, omap3_l3_rate_table, + &omap3_setuptime_table); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 1a7fb81..293a9b2 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -250,7 +250,7 @@ out: static void __init omap_apollon_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); apollon_init_smc91x(); diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index 23583da..dfc1b49 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -33,7 +33,7 @@ static void __init omap_generic_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); } diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index de6adf7..af0ebaf 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -270,7 +270,7 @@ static void __init h4_init_flash(void) static void __init omap_h4_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); h4_init_flash(); diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index 3b662ff..eb5e2e0 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void) static void __init omap_ldp_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); ldp_init_smsc911x(); diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index 36b4bfb..e0be6bd 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void) static void __init omap3_beagle_init_irq(void) { omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); omap_init_irq(); #ifdef CONFIG_OMAP_32K_TIMER omap2_gp_clockevent_set_gptimer(12); diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index e300a9e..eaab39b 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = { static void __init omap3_evm_init_irq(void) { omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); omap_init_irq(); omap_gpio_init(); omap3evm_init_smc911x(); diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index 0bff181..f159e18 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -360,7 +360,7 @@ static int __init overo_i2c_init(void) static void __init overo_init_irq(void) { - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL); + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 4733e4e..3629a0e 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = { static void __init rx51_init_irq(void) { omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c index 981f28e..e63bfa0 100644 --- a/arch/arm/mach-omap2/board-zoom2.c +++ b/arch/arm/mach-omap2/board-zoom2.c @@ -27,7 +27,7 @@ static void __init omap_zoom2_init_irq(void) { omap2_init_common_hw(NULL, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 980322d..266a5a1 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -44,6 +44,7 @@ #include <mach/clockdomain.h> #include "clockdomains.h" +#include "pm.h" #endif /* * The machine specific code may provide the extra mapping besides the @@ -281,12 +282,14 @@ static int __init _omap2_init_reprogram_sdrc(void) void __init omap2_init_common_hw(struct omap_sdrc_params *sp, struct omap_opp *mpu_opps, struct omap_opp *dsp_opps, - struct omap_opp *l3_opps) + struct omap_opp *l3_opps, + struct prm_setup_vc *setup_times) { omap2_mux_init(); #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ /* The OPP tables have to be registered before a clk init */ omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); + omap_pm_early_init(setup_times); pwrdm_init(powerdomains_omap); clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); omapdev_init(omapdevs); diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index 1192e01..b81ba3b 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -236,6 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev) return 0; } +void __init omap_pm_early_init(struct prm_setup_vc *setup_times) +{ + if (cpu_is_omap34xx()) + omap3_set_prm_setup_vc(setup_times); + return; +} + static int __init omap_pm_init(void) { int error = -1; diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index ddc9453..0beb32d 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -13,12 +13,6 @@ #include <mach/powerdomain.h> -#ifdef CONFIG_ARCH_OMAP3 -extern unsigned short enable_dyn_sleep; -extern unsigned short enable_off_mode; -extern unsigned short voltage_off_while_idle; -extern void *omap3_secure_ram_storage; - struct prm_setup_vc { u16 clksetup; u16 voltsetup_time1; @@ -37,6 +31,11 @@ struct prm_setup_vc { u16 vdd1_off; }; +#ifdef CONFIG_ARCH_OMAP3 +extern unsigned short enable_dyn_sleep; +extern unsigned short enable_off_mode; +extern unsigned short voltage_off_while_idle; +extern void *omap3_secure_ram_storage; extern void omap3_pm_off_mode_enable(int); extern void omap_sram_idle(void); extern int omap3_can_sleep(void); @@ -44,13 +43,15 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc); - #ifdef CONFIG_CPU_IDLE int omap3_idle_init(void); #else static inline int omap3_idle_init(void) { return 0; } #endif +#else /* CONFIG_ARCH_OMAP3 */ +#define omap3_set_prm_setup_vc(setup_vc) do {} while (0); + #endif /* CONFIG_ARCH_OMAP3 */ extern int resource_set_opp_level(int res, u32 target_level, int flags); extern int resource_access_opp_lock(int res, int delta); @@ -90,5 +91,6 @@ extern unsigned int omap34xx_suspend_sz; extern unsigned int save_secure_ram_context_sz; extern unsigned int omap24xx_cpu_suspend_sz; extern unsigned int omap34xx_cpu_suspend_sz; +void __init omap_pm_early_init(struct prm_setup_vc *setup_times); #endif diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 7a4a525..7b05244 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c @@ -77,6 +77,13 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm; static struct powerdomain *core_pwrdm, *per_pwrdm; static struct powerdomain *cam_pwrdm; +/* + * These values are board specific and have to be passed from + * the respective board files. + * The values used here are just worst case values which will + * be used on boards which do not pass on these values from + * the board files. + */ static struct prm_setup_vc prm_setup = { .clksetup = 0xff, .voltsetup_time1 = 0xfff, @@ -985,6 +992,9 @@ int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state) void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc) { + if (!setup_vc) + return; + prm_setup.clksetup = setup_vc->clksetup; prm_setup.voltsetup_time1 = setup_vc->voltsetup_time1; prm_setup.voltsetup_time2 = setup_vc->voltsetup_time2; diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h index 142f7e2..3582bef 100644 --- a/arch/arm/plat-omap/include/mach/io.h +++ b/arch/arm/plat-omap/include/mach/io.h @@ -224,6 +224,7 @@ struct omap_sdrc_params; struct omap_opp; +struct prm_setup_vc; extern void omap1_map_common_io(void); extern void omap1_init_common_hw(void); @@ -232,7 +233,8 @@ extern void omap2_map_common_io(void); extern void omap2_init_common_hw(struct omap_sdrc_params *sp, struct omap_opp *mpu_opps, struct omap_opp *dsp_opps, - struct omap_opp *l3_opps); + struct omap_opp *l3_opps, + struct prm_setup_vc *setup_times); #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) #define __arch_iounmap(v) omap_iounmap(v) -- 1.5.4.7 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files 2009-06-29 14:35 [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak @ 2009-06-29 14:35 ` Rajendra Nayak 2009-06-29 20:18 ` Mike Chan 2009-06-30 11:41 ` Premi, Sanjeev 2009-09-30 19:13 ` [PATCH 1/2] OMAP3: PM: Configure PRM setup times " Kevin Hilman 1 sibling, 2 replies; 7+ messages in thread From: Rajendra Nayak @ 2009-06-29 14:35 UTC (permalink / raw) To: linux-omap; +Cc: Rajendra Nayak The CPUidle C state latencies and thresholds are dependent on various board specific details. Hence this patch makes it possible to configure these values from the respective board files. Signed-off-by: Rajendra Nayak <rnayak@ti.com> --- arch/arm/mach-omap2/board-3430sdp.c | 22 ++++++- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-generic.c | 2 +- arch/arm/mach-omap2/board-h4.c | 2 +- arch/arm/mach-omap2/board-ldp.c | 2 +- arch/arm/mach-omap2/board-omap3beagle.c | 2 +- arch/arm/mach-omap2/board-omap3evm.c | 2 +- arch/arm/mach-omap2/board-overo.c | 3 +- arch/arm/mach-omap2/board-rx51.c | 2 +- arch/arm/mach-omap2/board-zoom2.c | 2 +- arch/arm/mach-omap2/cpuidle34xx.c | 105 ++++++++++++++++++++++++------ arch/arm/mach-omap2/io.c | 5 +- arch/arm/mach-omap2/pm.c | 7 ++- arch/arm/mach-omap2/pm.h | 12 +++- arch/arm/plat-omap/include/mach/io.h | 4 +- 15 files changed, 136 insertions(+), 38 deletions(-) diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c index b43cf94..750d841 100644 --- a/arch/arm/mach-omap2/board-3430sdp.c +++ b/arch/arm/mach-omap2/board-3430sdp.c @@ -75,6 +75,24 @@ static struct prm_setup_vc omap3_setuptime_table = { .vdd1_off = 0x00, }; +/* 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}, + /* C2 */ + {10, 10, 30}, + /* C3 */ + {50, 50, 300}, + /* C4 */ + {1500, 1800, 4000}, + /* C5 */ + {2500, 7500, 12000}, + /* C6 */ + {3000, 8500, 15000}, + /* C7 */ + {10000, 30000, 300000}, +}; + static int sdp3430_keymap[] = { KEY(0, 0, KEY_LEFT), KEY(0, 1, KEY_RIGHT), @@ -191,8 +209,8 @@ static struct platform_device *sdp3430_devices[] __initdata = { static void __init omap_3430sdp_init_irq(void) { omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table, - &omap3_setuptime_table); + omap3_dsp_rate_table, omap3_l3_rate_table, + &omap3_setuptime_table, omap3_cpuidle_params_table); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c index 293a9b2..fe625a9 100644 --- a/arch/arm/mach-omap2/board-apollon.c +++ b/arch/arm/mach-omap2/board-apollon.c @@ -250,7 +250,7 @@ out: static void __init omap_apollon_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); apollon_init_smc91x(); diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c index dfc1b49..ecf2c45 100644 --- a/arch/arm/mach-omap2/board-generic.c +++ b/arch/arm/mach-omap2/board-generic.c @@ -33,7 +33,7 @@ static void __init omap_generic_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); omap_init_irq(); } diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c index af0ebaf..365bc69 100644 --- a/arch/arm/mach-omap2/board-h4.c +++ b/arch/arm/mach-omap2/board-h4.c @@ -270,7 +270,7 @@ static void __init h4_init_flash(void) static void __init omap_h4_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); h4_init_flash(); diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index eb5e2e0..1265a12 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c @@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void) static void __init omap_ldp_init_irq(void) { - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); ldp_init_smsc911x(); diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c index e0be6bd..da1f3f6 100644 --- a/arch/arm/mach-omap2/board-omap3beagle.c +++ b/arch/arm/mach-omap2/board-omap3beagle.c @@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void) static void __init omap3_beagle_init_irq(void) { omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); omap_init_irq(); #ifdef CONFIG_OMAP_32K_TIMER omap2_gp_clockevent_set_gptimer(12); diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c index eaab39b..4a287b9 100644 --- a/arch/arm/mach-omap2/board-omap3evm.c +++ b/arch/arm/mach-omap2/board-omap3evm.c @@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = { static void __init omap3_evm_init_irq(void) { omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); omap_init_irq(); omap_gpio_init(); omap3evm_init_smc911x(); diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c index f159e18..a673921 100644 --- a/arch/arm/mach-omap2/board-overo.c +++ b/arch/arm/mach-omap2/board-overo.c @@ -360,7 +360,8 @@ static int __init overo_i2c_init(void) static void __init overo_init_irq(void) { - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL); + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, + NULL, NULL, NULL, NULL, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c index 3629a0e..6cb8715 100644 --- a/arch/arm/mach-omap2/board-rx51.c +++ b/arch/arm/mach-omap2/board-rx51.c @@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = { static void __init rx51_init_irq(void) { omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c index e63bfa0..0fcd0ff 100644 --- a/arch/arm/mach-omap2/board-zoom2.c +++ b/arch/arm/mach-omap2/board-zoom2.c @@ -27,7 +27,7 @@ static void __init omap_zoom2_init_irq(void) { omap2_init_common_hw(NULL, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); omap_init_irq(); omap_gpio_init(); } diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c index 7bbec90..3d6c55a 100644 --- a/arch/arm/mach-omap2/cpuidle34xx.c +++ b/arch/arm/mach-omap2/cpuidle34xx.c @@ -60,6 +60,30 @@ struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES]; struct omap3_processor_cx current_cx_state; struct powerdomain *mpu_pd, *core_pd, *per_pd; +/* + * The latencies/thresholds for various C states have + * to be configured from the respective board files. + * These are some default values (which might not provide + * the best power savings) used on boards which do not + * pass these details from the board file. + */ +static struct cpuidle_params cpuidle_params_table[] = { + /* C1 */ + {2, 2, 5}, + /* C2 */ + {10, 10, 30}, + /* C3 */ + {50, 50, 300}, + /* C4 */ + {1500, 1800, 4000}, + /* C5 */ + {2500, 7500, 12000}, + /* C6 */ + {3000, 8500, 15000}, + /* C7 */ + {10000, 30000, 300000}, +}; + static int omap3_idle_bm_check(void) { if (!omap3_can_sleep()) @@ -165,6 +189,24 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); +void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params) +{ + int i; + + if (!cpuidle_board_params) + return; + + for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { + cpuidle_params_table[i].sleep_latency = + cpuidle_board_params[i].sleep_latency; + cpuidle_params_table[i].wake_latency = + cpuidle_board_params[i].wake_latency; + cpuidle_params_table[i].threshold = + cpuidle_board_params[i].threshold; + } + return; +} + /* omap3_init_power_states - Initialises the OMAP3 specific C states. * * Below is the desciption of each C state. @@ -181,9 +223,12 @@ 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].type = OMAP3_STATE_C1; - omap3_power_states[OMAP3_STATE_C1].sleep_latency = 2; - omap3_power_states[OMAP3_STATE_C1].wakeup_latency = 2; - omap3_power_states[OMAP3_STATE_C1].threshold = 5; + omap3_power_states[OMAP3_STATE_C1].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C1].sleep_latency; + omap3_power_states[OMAP3_STATE_C1].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C1].wake_latency; + omap3_power_states[OMAP3_STATE_C1].threshold = + cpuidle_params_table[OMAP3_STATE_C1].threshold; omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; @@ -191,9 +236,12 @@ void omap_init_power_states(void) /* C2 . MPU WFI + Core inactive */ omap3_power_states[OMAP3_STATE_C2].valid = 1; omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; - omap3_power_states[OMAP3_STATE_C2].sleep_latency = 10; - omap3_power_states[OMAP3_STATE_C2].wakeup_latency = 10; - omap3_power_states[OMAP3_STATE_C2].threshold = 30; + omap3_power_states[OMAP3_STATE_C2].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C2].sleep_latency;; + omap3_power_states[OMAP3_STATE_C2].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C2].wake_latency;; + omap3_power_states[OMAP3_STATE_C2].threshold = + cpuidle_params_table[OMAP3_STATE_C2].threshold;; omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON; omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; @@ -201,9 +249,12 @@ void omap_init_power_states(void) /* C3 . MPU CSWR + Core inactive */ omap3_power_states[OMAP3_STATE_C3].valid = 1; omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; - omap3_power_states[OMAP3_STATE_C3].sleep_latency = 50; - omap3_power_states[OMAP3_STATE_C3].wakeup_latency = 50; - omap3_power_states[OMAP3_STATE_C3].threshold = 300; + omap3_power_states[OMAP3_STATE_C3].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C3].sleep_latency; + omap3_power_states[OMAP3_STATE_C3].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C3].wake_latency; + omap3_power_states[OMAP3_STATE_C3].threshold = + cpuidle_params_table[OMAP3_STATE_C3].threshold; omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET; omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | @@ -212,9 +263,12 @@ void omap_init_power_states(void) /* C4 . MPU OFF + Core inactive */ omap3_power_states[OMAP3_STATE_C4].valid = 1; omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; - omap3_power_states[OMAP3_STATE_C4].sleep_latency = 1500; - omap3_power_states[OMAP3_STATE_C4].wakeup_latency = 1800; - omap3_power_states[OMAP3_STATE_C4].threshold = 4000; + omap3_power_states[OMAP3_STATE_C4].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C4].sleep_latency; + omap3_power_states[OMAP3_STATE_C4].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C4].wake_latency; + omap3_power_states[OMAP3_STATE_C4].threshold = + cpuidle_params_table[OMAP3_STATE_C4].threshold; omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF; omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | @@ -223,9 +277,12 @@ void omap_init_power_states(void) /* C5 . MPU CSWR + Core CSWR*/ omap3_power_states[OMAP3_STATE_C5].valid = 1; omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; - omap3_power_states[OMAP3_STATE_C5].sleep_latency = 2500; - omap3_power_states[OMAP3_STATE_C5].wakeup_latency = 7500; - omap3_power_states[OMAP3_STATE_C5].threshold = 12000; + omap3_power_states[OMAP3_STATE_C5].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C5].sleep_latency; + omap3_power_states[OMAP3_STATE_C5].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C5].wake_latency; + omap3_power_states[OMAP3_STATE_C5].threshold = + cpuidle_params_table[OMAP3_STATE_C5].threshold; omap3_power_states[OMAP3_STATE_C5].mpu_state = PWRDM_POWER_RET; omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | @@ -234,9 +291,12 @@ void omap_init_power_states(void) /* C6 . MPU OFF + Core CSWR */ omap3_power_states[OMAP3_STATE_C6].valid = 1; omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; - omap3_power_states[OMAP3_STATE_C6].sleep_latency = 3000; - omap3_power_states[OMAP3_STATE_C6].wakeup_latency = 8500; - omap3_power_states[OMAP3_STATE_C6].threshold = 15000; + omap3_power_states[OMAP3_STATE_C6].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C6].sleep_latency; + omap3_power_states[OMAP3_STATE_C6].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C6].wake_latency; + omap3_power_states[OMAP3_STATE_C6].threshold = + cpuidle_params_table[OMAP3_STATE_C6].threshold; omap3_power_states[OMAP3_STATE_C6].mpu_state = PWRDM_POWER_OFF; omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | @@ -245,9 +305,12 @@ void omap_init_power_states(void) /* C7 . MPU OFF + Core OFF */ omap3_power_states[OMAP3_STATE_C7].valid = 1; omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; - omap3_power_states[OMAP3_STATE_C7].sleep_latency = 10000; - omap3_power_states[OMAP3_STATE_C7].wakeup_latency = 30000; - omap3_power_states[OMAP3_STATE_C7].threshold = 300000; + omap3_power_states[OMAP3_STATE_C7].sleep_latency = + cpuidle_params_table[OMAP3_STATE_C7].sleep_latency; + omap3_power_states[OMAP3_STATE_C7].wakeup_latency = + cpuidle_params_table[OMAP3_STATE_C7].wake_latency; + omap3_power_states[OMAP3_STATE_C7].threshold = + cpuidle_params_table[OMAP3_STATE_C7].threshold; omap3_power_states[OMAP3_STATE_C7].mpu_state = PWRDM_POWER_OFF; omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 266a5a1..d8d10aa 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c @@ -283,13 +283,14 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sp, struct omap_opp *mpu_opps, struct omap_opp *dsp_opps, struct omap_opp *l3_opps, - struct prm_setup_vc *setup_times) + struct prm_setup_vc *setup_times, + struct cpuidle_params *idle_params) { omap2_mux_init(); #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ /* The OPP tables have to be registered before a clk init */ omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); - omap_pm_early_init(setup_times); + omap_pm_early_init(setup_times, idle_params); pwrdm_init(powerdomains_omap); clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); omapdev_init(omapdevs); diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c index b81ba3b..5c5c59e 100644 --- a/arch/arm/mach-omap2/pm.c +++ b/arch/arm/mach-omap2/pm.c @@ -236,10 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev) return 0; } -void __init omap_pm_early_init(struct prm_setup_vc *setup_times) +void __init omap_pm_early_init(struct prm_setup_vc *setup_times, + struct cpuidle_params *idle_params) { - if (cpu_is_omap34xx()) + if (cpu_is_omap34xx()) { omap3_set_prm_setup_vc(setup_times); + omap3_set_idle_params(idle_params); + } return; } diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h index 0beb32d..8759053 100644 --- a/arch/arm/mach-omap2/pm.h +++ b/arch/arm/mach-omap2/pm.h @@ -31,6 +31,12 @@ struct prm_setup_vc { u16 vdd1_off; }; +struct cpuidle_params { + u32 sleep_latency; + u32 wake_latency; + u32 threshold; +}; + #ifdef CONFIG_ARCH_OMAP3 extern unsigned short enable_dyn_sleep; extern unsigned short enable_off_mode; @@ -43,6 +49,7 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc); +extern void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params); #ifdef CONFIG_CPU_IDLE int omap3_idle_init(void); #else @@ -51,8 +58,10 @@ static inline int omap3_idle_init(void) { return 0; } #else /* CONFIG_ARCH_OMAP3 */ #define omap3_set_prm_setup_vc(setup_vc) do {} while (0); +#define omap3_set_idle_params(parmas, board_params) do {} while (0); #endif /* CONFIG_ARCH_OMAP3 */ + extern int resource_set_opp_level(int res, u32 target_level, int flags); extern int resource_access_opp_lock(int res, int delta); #define resource_lock_opp(res) resource_access_opp_lock(res, 1) @@ -91,6 +100,7 @@ extern unsigned int omap34xx_suspend_sz; extern unsigned int save_secure_ram_context_sz; extern unsigned int omap24xx_cpu_suspend_sz; extern unsigned int omap34xx_cpu_suspend_sz; -void __init omap_pm_early_init(struct prm_setup_vc *setup_times); +void __init omap_pm_early_init(struct prm_setup_vc *setup_times, + struct cpuidle_params *idle_params); #endif diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h index 3582bef..d143bd9 100644 --- a/arch/arm/plat-omap/include/mach/io.h +++ b/arch/arm/plat-omap/include/mach/io.h @@ -225,6 +225,7 @@ struct omap_sdrc_params; struct omap_opp; struct prm_setup_vc; +struct cpuidle_params; extern void omap1_map_common_io(void); extern void omap1_init_common_hw(void); @@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct omap_sdrc_params *sp, struct omap_opp *mpu_opps, struct omap_opp *dsp_opps, struct omap_opp *l3_opps, - struct prm_setup_vc *setup_times); + struct prm_setup_vc *setup_times, + struct cpuidle_params *idle_params); #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) #define __arch_iounmap(v) omap_iounmap(v) -- 1.5.4.7 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files 2009-06-29 14:35 ` [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak @ 2009-06-29 20:18 ` Mike Chan 2009-06-30 11:41 ` Premi, Sanjeev 1 sibling, 0 replies; 7+ messages in thread From: Mike Chan @ 2009-06-29 20:18 UTC (permalink / raw) To: Rajendra Nayak; +Cc: linux-omap On Mon, Jun 29, 2009 at 7:35 AM, Rajendra Nayak<rnayak@ti.com> wrote: > The CPUidle C state latencies and thresholds are dependent > on various board specific details. > Hence this patch makes it possible to configure these values from the > respective board files. > > Signed-off-by: Rajendra Nayak <rnayak@ti.com> > --- I think cpufreq could probably use something similar. The transition latency set in the policy is set in cpu-omap.c and is a hard-coded value. I wonder if its reasonable to piggyback off these values for the transition latencies, or extend the struct to include those? -- Mike > arch/arm/mach-omap2/board-3430sdp.c | 22 ++++++- > arch/arm/mach-omap2/board-apollon.c | 2 +- > arch/arm/mach-omap2/board-generic.c | 2 +- > arch/arm/mach-omap2/board-h4.c | 2 +- > arch/arm/mach-omap2/board-ldp.c | 2 +- > arch/arm/mach-omap2/board-omap3beagle.c | 2 +- > arch/arm/mach-omap2/board-omap3evm.c | 2 +- > arch/arm/mach-omap2/board-overo.c | 3 +- > arch/arm/mach-omap2/board-rx51.c | 2 +- > arch/arm/mach-omap2/board-zoom2.c | 2 +- > arch/arm/mach-omap2/cpuidle34xx.c | 105 ++++++++++++++++++++++++------ > arch/arm/mach-omap2/io.c | 5 +- > arch/arm/mach-omap2/pm.c | 7 ++- > arch/arm/mach-omap2/pm.h | 12 +++- > arch/arm/plat-omap/include/mach/io.h | 4 +- > 15 files changed, 136 insertions(+), 38 deletions(-) > > diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c > index b43cf94..750d841 100644 > --- a/arch/arm/mach-omap2/board-3430sdp.c > +++ b/arch/arm/mach-omap2/board-3430sdp.c > @@ -75,6 +75,24 @@ static struct prm_setup_vc omap3_setuptime_table = { > .vdd1_off = 0x00, > }; > > +/* 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}, > + /* C2 */ > + {10, 10, 30}, > + /* C3 */ > + {50, 50, 300}, > + /* C4 */ > + {1500, 1800, 4000}, > + /* C5 */ > + {2500, 7500, 12000}, > + /* C6 */ > + {3000, 8500, 15000}, > + /* C7 */ > + {10000, 30000, 300000}, > +}; > + > static int sdp3430_keymap[] = { > KEY(0, 0, KEY_LEFT), > KEY(0, 1, KEY_RIGHT), > @@ -191,8 +209,8 @@ static struct platform_device *sdp3430_devices[] __initdata = { > static void __init omap_3430sdp_init_irq(void) > { > omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table, > - &omap3_setuptime_table); > + omap3_dsp_rate_table, omap3_l3_rate_table, > + &omap3_setuptime_table, omap3_cpuidle_params_table); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c > index 293a9b2..fe625a9 100644 > --- a/arch/arm/mach-omap2/board-apollon.c > +++ b/arch/arm/mach-omap2/board-apollon.c > @@ -250,7 +250,7 @@ out: > > static void __init omap_apollon_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > apollon_init_smc91x(); > diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c > index dfc1b49..ecf2c45 100644 > --- a/arch/arm/mach-omap2/board-generic.c > +++ b/arch/arm/mach-omap2/board-generic.c > @@ -33,7 +33,7 @@ > > static void __init omap_generic_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > } > > diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c > index af0ebaf..365bc69 100644 > --- a/arch/arm/mach-omap2/board-h4.c > +++ b/arch/arm/mach-omap2/board-h4.c > @@ -270,7 +270,7 @@ static void __init h4_init_flash(void) > > static void __init omap_h4_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > h4_init_flash(); > diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c > index eb5e2e0..1265a12 100644 > --- a/arch/arm/mach-omap2/board-ldp.c > +++ b/arch/arm/mach-omap2/board-ldp.c > @@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void) > > static void __init omap_ldp_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > ldp_init_smsc911x(); > diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c > index e0be6bd..da1f3f6 100644 > --- a/arch/arm/mach-omap2/board-omap3beagle.c > +++ b/arch/arm/mach-omap2/board-omap3beagle.c > @@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void) > static void __init omap3_beagle_init_irq(void) > { > omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); > omap_init_irq(); > #ifdef CONFIG_OMAP_32K_TIMER > omap2_gp_clockevent_set_gptimer(12); > diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c > index eaab39b..4a287b9 100644 > --- a/arch/arm/mach-omap2/board-omap3evm.c > +++ b/arch/arm/mach-omap2/board-omap3evm.c > @@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = { > static void __init omap3_evm_init_irq(void) > { > omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > omap3evm_init_smc911x(); > diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c > index f159e18..a673921 100644 > --- a/arch/arm/mach-omap2/board-overo.c > +++ b/arch/arm/mach-omap2/board-overo.c > @@ -360,7 +360,8 @@ static int __init overo_i2c_init(void) > > static void __init overo_init_irq(void) > { > - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL); > + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, > + NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c > index 3629a0e..6cb8715 100644 > --- a/arch/arm/mach-omap2/board-rx51.c > +++ b/arch/arm/mach-omap2/board-rx51.c > @@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = { > static void __init rx51_init_irq(void) > { > omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c > index e63bfa0..0fcd0ff 100644 > --- a/arch/arm/mach-omap2/board-zoom2.c > +++ b/arch/arm/mach-omap2/board-zoom2.c > @@ -27,7 +27,7 @@ > static void __init omap_zoom2_init_irq(void) > { > omap2_init_common_hw(NULL, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c > index 7bbec90..3d6c55a 100644 > --- a/arch/arm/mach-omap2/cpuidle34xx.c > +++ b/arch/arm/mach-omap2/cpuidle34xx.c > @@ -60,6 +60,30 @@ struct omap3_processor_cx omap3_power_states[OMAP3_MAX_STATES]; > struct omap3_processor_cx current_cx_state; > struct powerdomain *mpu_pd, *core_pd, *per_pd; > > +/* > + * The latencies/thresholds for various C states have > + * to be configured from the respective board files. > + * These are some default values (which might not provide > + * the best power savings) used on boards which do not > + * pass these details from the board file. > + */ > +static struct cpuidle_params cpuidle_params_table[] = { > + /* C1 */ > + {2, 2, 5}, > + /* C2 */ > + {10, 10, 30}, > + /* C3 */ > + {50, 50, 300}, > + /* C4 */ > + {1500, 1800, 4000}, > + /* C5 */ > + {2500, 7500, 12000}, > + /* C6 */ > + {3000, 8500, 15000}, > + /* C7 */ > + {10000, 30000, 300000}, > +}; > + > static int omap3_idle_bm_check(void) > { > if (!omap3_can_sleep()) > @@ -165,6 +189,24 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev, > > DEFINE_PER_CPU(struct cpuidle_device, omap3_idle_dev); > > +void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params) > +{ > + int i; > + > + if (!cpuidle_board_params) > + return; > + > + for (i = OMAP3_STATE_C1; i < OMAP3_MAX_STATES; i++) { > + cpuidle_params_table[i].sleep_latency = > + cpuidle_board_params[i].sleep_latency; > + cpuidle_params_table[i].wake_latency = > + cpuidle_board_params[i].wake_latency; > + cpuidle_params_table[i].threshold = > + cpuidle_board_params[i].threshold; > + } > + return; > +} > + > /* omap3_init_power_states - Initialises the OMAP3 specific C states. > * > * Below is the desciption of each C state. > @@ -181,9 +223,12 @@ 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].type = OMAP3_STATE_C1; > - omap3_power_states[OMAP3_STATE_C1].sleep_latency = 2; > - omap3_power_states[OMAP3_STATE_C1].wakeup_latency = 2; > - omap3_power_states[OMAP3_STATE_C1].threshold = 5; > + omap3_power_states[OMAP3_STATE_C1].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C1].sleep_latency; > + omap3_power_states[OMAP3_STATE_C1].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C1].wake_latency; > + omap3_power_states[OMAP3_STATE_C1].threshold = > + cpuidle_params_table[OMAP3_STATE_C1].threshold; > omap3_power_states[OMAP3_STATE_C1].mpu_state = PWRDM_POWER_ON; > omap3_power_states[OMAP3_STATE_C1].core_state = PWRDM_POWER_ON; > omap3_power_states[OMAP3_STATE_C1].flags = CPUIDLE_FLAG_TIME_VALID; > @@ -191,9 +236,12 @@ void omap_init_power_states(void) > /* C2 . MPU WFI + Core inactive */ > omap3_power_states[OMAP3_STATE_C2].valid = 1; > omap3_power_states[OMAP3_STATE_C2].type = OMAP3_STATE_C2; > - omap3_power_states[OMAP3_STATE_C2].sleep_latency = 10; > - omap3_power_states[OMAP3_STATE_C2].wakeup_latency = 10; > - omap3_power_states[OMAP3_STATE_C2].threshold = 30; > + omap3_power_states[OMAP3_STATE_C2].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C2].sleep_latency;; > + omap3_power_states[OMAP3_STATE_C2].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C2].wake_latency;; > + omap3_power_states[OMAP3_STATE_C2].threshold = > + cpuidle_params_table[OMAP3_STATE_C2].threshold;; > omap3_power_states[OMAP3_STATE_C2].mpu_state = PWRDM_POWER_ON; > omap3_power_states[OMAP3_STATE_C2].core_state = PWRDM_POWER_ON; > omap3_power_states[OMAP3_STATE_C2].flags = CPUIDLE_FLAG_TIME_VALID; > @@ -201,9 +249,12 @@ void omap_init_power_states(void) > /* C3 . MPU CSWR + Core inactive */ > omap3_power_states[OMAP3_STATE_C3].valid = 1; > omap3_power_states[OMAP3_STATE_C3].type = OMAP3_STATE_C3; > - omap3_power_states[OMAP3_STATE_C3].sleep_latency = 50; > - omap3_power_states[OMAP3_STATE_C3].wakeup_latency = 50; > - omap3_power_states[OMAP3_STATE_C3].threshold = 300; > + omap3_power_states[OMAP3_STATE_C3].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C3].sleep_latency; > + omap3_power_states[OMAP3_STATE_C3].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C3].wake_latency; > + omap3_power_states[OMAP3_STATE_C3].threshold = > + cpuidle_params_table[OMAP3_STATE_C3].threshold; > omap3_power_states[OMAP3_STATE_C3].mpu_state = PWRDM_POWER_RET; > omap3_power_states[OMAP3_STATE_C3].core_state = PWRDM_POWER_ON; > omap3_power_states[OMAP3_STATE_C3].flags = CPUIDLE_FLAG_TIME_VALID | > @@ -212,9 +263,12 @@ void omap_init_power_states(void) > /* C4 . MPU OFF + Core inactive */ > omap3_power_states[OMAP3_STATE_C4].valid = 1; > omap3_power_states[OMAP3_STATE_C4].type = OMAP3_STATE_C4; > - omap3_power_states[OMAP3_STATE_C4].sleep_latency = 1500; > - omap3_power_states[OMAP3_STATE_C4].wakeup_latency = 1800; > - omap3_power_states[OMAP3_STATE_C4].threshold = 4000; > + omap3_power_states[OMAP3_STATE_C4].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C4].sleep_latency; > + omap3_power_states[OMAP3_STATE_C4].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C4].wake_latency; > + omap3_power_states[OMAP3_STATE_C4].threshold = > + cpuidle_params_table[OMAP3_STATE_C4].threshold; > omap3_power_states[OMAP3_STATE_C4].mpu_state = PWRDM_POWER_OFF; > omap3_power_states[OMAP3_STATE_C4].core_state = PWRDM_POWER_ON; > omap3_power_states[OMAP3_STATE_C4].flags = CPUIDLE_FLAG_TIME_VALID | > @@ -223,9 +277,12 @@ void omap_init_power_states(void) > /* C5 . MPU CSWR + Core CSWR*/ > omap3_power_states[OMAP3_STATE_C5].valid = 1; > omap3_power_states[OMAP3_STATE_C5].type = OMAP3_STATE_C5; > - omap3_power_states[OMAP3_STATE_C5].sleep_latency = 2500; > - omap3_power_states[OMAP3_STATE_C5].wakeup_latency = 7500; > - omap3_power_states[OMAP3_STATE_C5].threshold = 12000; > + omap3_power_states[OMAP3_STATE_C5].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C5].sleep_latency; > + omap3_power_states[OMAP3_STATE_C5].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C5].wake_latency; > + omap3_power_states[OMAP3_STATE_C5].threshold = > + cpuidle_params_table[OMAP3_STATE_C5].threshold; > omap3_power_states[OMAP3_STATE_C5].mpu_state = PWRDM_POWER_RET; > omap3_power_states[OMAP3_STATE_C5].core_state = PWRDM_POWER_RET; > omap3_power_states[OMAP3_STATE_C5].flags = CPUIDLE_FLAG_TIME_VALID | > @@ -234,9 +291,12 @@ void omap_init_power_states(void) > /* C6 . MPU OFF + Core CSWR */ > omap3_power_states[OMAP3_STATE_C6].valid = 1; > omap3_power_states[OMAP3_STATE_C6].type = OMAP3_STATE_C6; > - omap3_power_states[OMAP3_STATE_C6].sleep_latency = 3000; > - omap3_power_states[OMAP3_STATE_C6].wakeup_latency = 8500; > - omap3_power_states[OMAP3_STATE_C6].threshold = 15000; > + omap3_power_states[OMAP3_STATE_C6].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C6].sleep_latency; > + omap3_power_states[OMAP3_STATE_C6].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C6].wake_latency; > + omap3_power_states[OMAP3_STATE_C6].threshold = > + cpuidle_params_table[OMAP3_STATE_C6].threshold; > omap3_power_states[OMAP3_STATE_C6].mpu_state = PWRDM_POWER_OFF; > omap3_power_states[OMAP3_STATE_C6].core_state = PWRDM_POWER_RET; > omap3_power_states[OMAP3_STATE_C6].flags = CPUIDLE_FLAG_TIME_VALID | > @@ -245,9 +305,12 @@ void omap_init_power_states(void) > /* C7 . MPU OFF + Core OFF */ > omap3_power_states[OMAP3_STATE_C7].valid = 1; > omap3_power_states[OMAP3_STATE_C7].type = OMAP3_STATE_C7; > - omap3_power_states[OMAP3_STATE_C7].sleep_latency = 10000; > - omap3_power_states[OMAP3_STATE_C7].wakeup_latency = 30000; > - omap3_power_states[OMAP3_STATE_C7].threshold = 300000; > + omap3_power_states[OMAP3_STATE_C7].sleep_latency = > + cpuidle_params_table[OMAP3_STATE_C7].sleep_latency; > + omap3_power_states[OMAP3_STATE_C7].wakeup_latency = > + cpuidle_params_table[OMAP3_STATE_C7].wake_latency; > + omap3_power_states[OMAP3_STATE_C7].threshold = > + cpuidle_params_table[OMAP3_STATE_C7].threshold; > omap3_power_states[OMAP3_STATE_C7].mpu_state = PWRDM_POWER_OFF; > omap3_power_states[OMAP3_STATE_C7].core_state = PWRDM_POWER_OFF; > omap3_power_states[OMAP3_STATE_C7].flags = CPUIDLE_FLAG_TIME_VALID | > diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c > index 266a5a1..d8d10aa 100644 > --- a/arch/arm/mach-omap2/io.c > +++ b/arch/arm/mach-omap2/io.c > @@ -283,13 +283,14 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sp, > struct omap_opp *mpu_opps, > struct omap_opp *dsp_opps, > struct omap_opp *l3_opps, > - struct prm_setup_vc *setup_times) > + struct prm_setup_vc *setup_times, > + struct cpuidle_params *idle_params) > { > omap2_mux_init(); > #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ > /* The OPP tables have to be registered before a clk init */ > omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); > - omap_pm_early_init(setup_times); > + omap_pm_early_init(setup_times, idle_params); > pwrdm_init(powerdomains_omap); > clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); > omapdev_init(omapdevs); > diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c > index b81ba3b..5c5c59e 100644 > --- a/arch/arm/mach-omap2/pm.c > +++ b/arch/arm/mach-omap2/pm.c > @@ -236,10 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev) > return 0; > } > > -void __init omap_pm_early_init(struct prm_setup_vc *setup_times) > +void __init omap_pm_early_init(struct prm_setup_vc *setup_times, > + struct cpuidle_params *idle_params) > { > - if (cpu_is_omap34xx()) > + if (cpu_is_omap34xx()) { > omap3_set_prm_setup_vc(setup_times); > + omap3_set_idle_params(idle_params); > + } > return; > } > > diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h > index 0beb32d..8759053 100644 > --- a/arch/arm/mach-omap2/pm.h > +++ b/arch/arm/mach-omap2/pm.h > @@ -31,6 +31,12 @@ struct prm_setup_vc { > u16 vdd1_off; > }; > > +struct cpuidle_params { > + u32 sleep_latency; > + u32 wake_latency; > + u32 threshold; > +}; > + > #ifdef CONFIG_ARCH_OMAP3 > extern unsigned short enable_dyn_sleep; > extern unsigned short enable_off_mode; > @@ -43,6 +49,7 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); > extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); > extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); > extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc); > +extern void omap3_set_idle_params(struct cpuidle_params *cpuidle_board_params); > #ifdef CONFIG_CPU_IDLE > int omap3_idle_init(void); > #else > @@ -51,8 +58,10 @@ static inline int omap3_idle_init(void) { return 0; } > > #else /* CONFIG_ARCH_OMAP3 */ > #define omap3_set_prm_setup_vc(setup_vc) do {} while (0); > +#define omap3_set_idle_params(parmas, board_params) do {} while (0); > > #endif /* CONFIG_ARCH_OMAP3 */ > + > extern int resource_set_opp_level(int res, u32 target_level, int flags); > extern int resource_access_opp_lock(int res, int delta); > #define resource_lock_opp(res) resource_access_opp_lock(res, 1) > @@ -91,6 +100,7 @@ extern unsigned int omap34xx_suspend_sz; > extern unsigned int save_secure_ram_context_sz; > extern unsigned int omap24xx_cpu_suspend_sz; > extern unsigned int omap34xx_cpu_suspend_sz; > -void __init omap_pm_early_init(struct prm_setup_vc *setup_times); > +void __init omap_pm_early_init(struct prm_setup_vc *setup_times, > + struct cpuidle_params *idle_params); > > #endif > diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h > index 3582bef..d143bd9 100644 > --- a/arch/arm/plat-omap/include/mach/io.h > +++ b/arch/arm/plat-omap/include/mach/io.h > @@ -225,6 +225,7 @@ > struct omap_sdrc_params; > struct omap_opp; > struct prm_setup_vc; > +struct cpuidle_params; > > extern void omap1_map_common_io(void); > extern void omap1_init_common_hw(void); > @@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct omap_sdrc_params *sp, > struct omap_opp *mpu_opps, > struct omap_opp *dsp_opps, > struct omap_opp *l3_opps, > - struct prm_setup_vc *setup_times); > + struct prm_setup_vc *setup_times, > + struct cpuidle_params *idle_params); > > #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) > #define __arch_iounmap(v) omap_iounmap(v) > -- > 1.5.4.7 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files 2009-06-29 14:35 ` [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak 2009-06-29 20:18 ` Mike Chan @ 2009-06-30 11:41 ` Premi, Sanjeev 2009-06-30 22:58 ` Kevin Hilman 1 sibling, 1 reply; 7+ messages in thread From: Premi, Sanjeev @ 2009-06-30 11:41 UTC (permalink / raw) To: Nayak, Rajendra, linux-omap@vger.kernel.org > -----Original Message----- > From: linux-omap-owner@vger.kernel.org > [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Nayak, Rajendra > Sent: Monday, June 29, 2009 8:05 PM > To: linux-omap@vger.kernel.org > Cc: Nayak, Rajendra > Subject: [PATCH 2/2] OMAP3: PM: Configure CPUidle > latencies/thresholds from board files > > The CPUidle C state latencies and thresholds are dependent > on various board specific details. > Hence this patch makes it possible to configure these values from the > respective board files. > > Signed-off-by: Rajendra Nayak <rnayak@ti.com> > --- > arch/arm/mach-omap2/board-3430sdp.c | 22 ++++++- > arch/arm/mach-omap2/board-apollon.c | 2 +- > arch/arm/mach-omap2/board-generic.c | 2 +- > arch/arm/mach-omap2/board-h4.c | 2 +- > arch/arm/mach-omap2/board-ldp.c | 2 +- > arch/arm/mach-omap2/board-omap3beagle.c | 2 +- > arch/arm/mach-omap2/board-omap3evm.c | 2 +- > arch/arm/mach-omap2/board-overo.c | 3 +- > arch/arm/mach-omap2/board-rx51.c | 2 +- > arch/arm/mach-omap2/board-zoom2.c | 2 +- > arch/arm/mach-omap2/cpuidle34xx.c | 105 > ++++++++++++++++++++++++------ > arch/arm/mach-omap2/io.c | 5 +- > arch/arm/mach-omap2/pm.c | 7 ++- > arch/arm/mach-omap2/pm.h | 12 +++- > arch/arm/plat-omap/include/mach/io.h | 4 +- > 15 files changed, 136 insertions(+), 38 deletions(-) > [snip]---[snip] > diff --git a/arch/arm/plat-omap/include/mach/io.h > b/arch/arm/plat-omap/include/mach/io.h > index 3582bef..d143bd9 100644 > --- a/arch/arm/plat-omap/include/mach/io.h > +++ b/arch/arm/plat-omap/include/mach/io.h > @@ -225,6 +225,7 @@ > struct omap_sdrc_params; > struct omap_opp; > struct prm_setup_vc; > +struct cpuidle_params; > > extern void omap1_map_common_io(void); > extern void omap1_init_common_hw(void); > @@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct > omap_sdrc_params *sp, > struct omap_opp *mpu_opps, > struct omap_opp *dsp_opps, > struct omap_opp *l3_opps, > - struct prm_setup_vc *setup_times); > + struct prm_setup_vc *setup_times, > + struct cpuidle_params *idle_params); Rajendra, all, Aren't we 'overloading' omap2_init_common_hw() each time we add another argument to it? Shouldn't we defined define a function specific for PM initialization? Some of the initialization actually doesn't even touch the HW. Best regards, Sanjeev > > #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) > #define __arch_iounmap(v) omap_iounmap(v) > -- > 1.5.4.7 > > -- > To unsubscribe from this list: send the line "unsubscribe > linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds from board files 2009-06-30 11:41 ` Premi, Sanjeev @ 2009-06-30 22:58 ` Kevin Hilman 0 siblings, 0 replies; 7+ messages in thread From: Kevin Hilman @ 2009-06-30 22:58 UTC (permalink / raw) To: Premi, Sanjeev; +Cc: Nayak, Rajendra, linux-omap@vger.kernel.org "Premi, Sanjeev" <premi@ti.com> writes: >> extern void omap1_map_common_io(void); >> extern void omap1_init_common_hw(void); >> @@ -234,7 +235,8 @@ extern void omap2_init_common_hw(struct >> omap_sdrc_params *sp, >> struct omap_opp *mpu_opps, >> struct omap_opp *dsp_opps, >> struct omap_opp *l3_opps, >> - struct prm_setup_vc *setup_times); >> + struct prm_setup_vc *setup_times, >> + struct cpuidle_params *idle_params); > > Rajendra, all, > > Aren't we 'overloading' omap2_init_common_hw() each time we add another > argument to it? > > Shouldn't we defined define a function specific for PM initialization? > Some of the initialization actually doesn't even touch the HW. > Completely agree. We are absolutely overloading init_common_hw() and this is on the list of things I'd like to see changed before those change go upstream. I just haven't got to that yet. I would happily welcome any proposals or cleanups to this. My current feeling is that I think these board-specific settings should just be using platform_driver/platform_device model and then board-specifics could be passed via platform_data. If not settings are given, conservative defaults can be used. But honestly, I haven't given it much more thought, other than I *really* don't like the current overloading of that function. Kevin ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files 2009-06-29 14:35 [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak 2009-06-29 14:35 ` [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak @ 2009-09-30 19:13 ` Kevin Hilman 2009-10-06 6:10 ` Nayak, Rajendra 1 sibling, 1 reply; 7+ messages in thread From: Kevin Hilman @ 2009-09-30 19:13 UTC (permalink / raw) To: Rajendra Nayak; +Cc: linux-omap Rajendra Nayak <rnayak@ti.com> writes: > The setup times to be programmed in the PRM module on OMAP > (for clksetup, voltsetup etc) are board specific. > They depend heavily on the PMIC used and even on different boards > with the same PMIC, they vary based on the sleep/wake > sequence used, system clock speed et al. > > This patch makes it possible for these setup values to be > configured from different board files. > > Signed-off-by: Rajendra Nayak <rnayak@ti.com> Hi Rajendra, Sorry about this, but your series slipped through cracks on my side. I like this approach, but it needs to be rebased against current PM branch since lots of the code that it touches has been reworked. Also, instead of continuing to overload init_common_hw, how about adding something like omap_pm_register() which takes the various rate tables and setup times, or possibly adding the rate tables and setup times as arguments to omap3_pm_earlly_init() and making it explicitly called by board code instead of an arch_initcall(). Kevin > --- > arch/arm/mach-omap2/board-3430sdp.c | 20 +++++++++++++++++++- > arch/arm/mach-omap2/board-apollon.c | 2 +- > arch/arm/mach-omap2/board-generic.c | 2 +- > arch/arm/mach-omap2/board-h4.c | 2 +- > arch/arm/mach-omap2/board-ldp.c | 2 +- > arch/arm/mach-omap2/board-omap3beagle.c | 2 +- > arch/arm/mach-omap2/board-omap3evm.c | 2 +- > arch/arm/mach-omap2/board-overo.c | 2 +- > arch/arm/mach-omap2/board-rx51.c | 2 +- > arch/arm/mach-omap2/board-zoom2.c | 2 +- > arch/arm/mach-omap2/io.c | 5 ++++- > arch/arm/mach-omap2/pm.c | 7 +++++++ > arch/arm/mach-omap2/pm.h | 16 +++++++++------- > arch/arm/mach-omap2/pm34xx.c | 10 ++++++++++ > arch/arm/plat-omap/include/mach/io.h | 4 +++- > 15 files changed, 61 insertions(+), 19 deletions(-) > > diff --git a/arch/arm/mach-omap2/board-3430sdp.c b/arch/arm/mach-omap2/board-3430sdp.c > index e9a4d10..b43cf94 100644 > --- a/arch/arm/mach-omap2/board-3430sdp.c > +++ b/arch/arm/mach-omap2/board-3430sdp.c > @@ -58,6 +58,23 @@ > > #define TWL4030_MSECURE_GPIO 22 > > +/* FIXME: These are not the optimal setup values to be used on 3430sdp*/ > +static struct prm_setup_vc omap3_setuptime_table = { > + .clksetup = 0xff, > + .voltsetup_time1 = 0xfff, > + .voltsetup_time2 = 0xfff, > + .voltoffset = 0xff, > + .voltsetup2 = 0xff, > + .vdd0_on = 0x30, > + .vdd0_onlp = 0x20, > + .vdd0_ret = 0x1e, > + .vdd0_off = 0x00, > + .vdd1_on = 0x2c, > + .vdd1_onlp = 0x20, > + .vdd1_ret = 0x1e, > + .vdd1_off = 0x00, > +}; > + > static int sdp3430_keymap[] = { > KEY(0, 0, KEY_LEFT), > KEY(0, 1, KEY_RIGHT), > @@ -174,7 +191,8 @@ static struct platform_device *sdp3430_devices[] __initdata = { > static void __init omap_3430sdp_init_irq(void) > { > omap2_init_common_hw(hyb18m512160af6_sdrc_params, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table); > + omap3_dsp_rate_table, omap3_l3_rate_table, > + &omap3_setuptime_table); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/board-apollon.c b/arch/arm/mach-omap2/board-apollon.c > index 1a7fb81..293a9b2 100644 > --- a/arch/arm/mach-omap2/board-apollon.c > +++ b/arch/arm/mach-omap2/board-apollon.c > @@ -250,7 +250,7 @@ out: > > static void __init omap_apollon_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > apollon_init_smc91x(); > diff --git a/arch/arm/mach-omap2/board-generic.c b/arch/arm/mach-omap2/board-generic.c > index 23583da..dfc1b49 100644 > --- a/arch/arm/mach-omap2/board-generic.c > +++ b/arch/arm/mach-omap2/board-generic.c > @@ -33,7 +33,7 @@ > > static void __init omap_generic_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > } > > diff --git a/arch/arm/mach-omap2/board-h4.c b/arch/arm/mach-omap2/board-h4.c > index de6adf7..af0ebaf 100644 > --- a/arch/arm/mach-omap2/board-h4.c > +++ b/arch/arm/mach-omap2/board-h4.c > @@ -270,7 +270,7 @@ static void __init h4_init_flash(void) > > static void __init omap_h4_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > h4_init_flash(); > diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c > index 3b662ff..eb5e2e0 100644 > --- a/arch/arm/mach-omap2/board-ldp.c > +++ b/arch/arm/mach-omap2/board-ldp.c > @@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void) > > static void __init omap_ldp_init_irq(void) > { > - omap2_init_common_hw(NULL, NULL, NULL, NULL); > + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > ldp_init_smsc911x(); > diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c > index 36b4bfb..e0be6bd 100644 > --- a/arch/arm/mach-omap2/board-omap3beagle.c > +++ b/arch/arm/mach-omap2/board-omap3beagle.c > @@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void) > static void __init omap3_beagle_init_irq(void) > { > omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > omap_init_irq(); > #ifdef CONFIG_OMAP_32K_TIMER > omap2_gp_clockevent_set_gptimer(12); > diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c > index e300a9e..eaab39b 100644 > --- a/arch/arm/mach-omap2/board-omap3evm.c > +++ b/arch/arm/mach-omap2/board-omap3evm.c > @@ -284,7 +284,7 @@ struct spi_board_info omap3evm_spi_board_info[] = { > static void __init omap3_evm_init_irq(void) > { > omap2_init_common_hw(mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > omap_init_irq(); > omap_gpio_init(); > omap3evm_init_smc911x(); > diff --git a/arch/arm/mach-omap2/board-overo.c b/arch/arm/mach-omap2/board-overo.c > index 0bff181..f159e18 100644 > --- a/arch/arm/mach-omap2/board-overo.c > +++ b/arch/arm/mach-omap2/board-overo.c > @@ -360,7 +360,7 @@ static int __init overo_i2c_init(void) > > static void __init overo_init_irq(void) > { > - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL); > + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, NULL, NULL, NULL); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/board-rx51.c b/arch/arm/mach-omap2/board-rx51.c > index 4733e4e..3629a0e 100644 > --- a/arch/arm/mach-omap2/board-rx51.c > +++ b/arch/arm/mach-omap2/board-rx51.c > @@ -66,7 +66,7 @@ static struct omap_board_config_kernel rx51_config[] = { > static void __init rx51_init_irq(void) > { > omap2_init_common_hw(rx51_get_sdram_timings(), omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/board-zoom2.c b/arch/arm/mach-omap2/board-zoom2.c > index 981f28e..e63bfa0 100644 > --- a/arch/arm/mach-omap2/board-zoom2.c > +++ b/arch/arm/mach-omap2/board-zoom2.c > @@ -27,7 +27,7 @@ > static void __init omap_zoom2_init_irq(void) > { > omap2_init_common_hw(NULL, omap3_mpu_rate_table, > - omap3_dsp_rate_table, omap3_l3_rate_table); > + omap3_dsp_rate_table, omap3_l3_rate_table, NULL); > omap_init_irq(); > omap_gpio_init(); > } > diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c > index 980322d..266a5a1 100644 > --- a/arch/arm/mach-omap2/io.c > +++ b/arch/arm/mach-omap2/io.c > @@ -44,6 +44,7 @@ > > #include <mach/clockdomain.h> > #include "clockdomains.h" > +#include "pm.h" > #endif > /* > * The machine specific code may provide the extra mapping besides the > @@ -281,12 +282,14 @@ static int __init _omap2_init_reprogram_sdrc(void) > void __init omap2_init_common_hw(struct omap_sdrc_params *sp, > struct omap_opp *mpu_opps, > struct omap_opp *dsp_opps, > - struct omap_opp *l3_opps) > + struct omap_opp *l3_opps, > + struct prm_setup_vc *setup_times) > { > omap2_mux_init(); > #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the clkdev is ready */ > /* The OPP tables have to be registered before a clk init */ > omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); > + omap_pm_early_init(setup_times); > pwrdm_init(powerdomains_omap); > clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); > omapdev_init(omapdevs); > diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c > index 1192e01..b81ba3b 100644 > --- a/arch/arm/mach-omap2/pm.c > +++ b/arch/arm/mach-omap2/pm.c > @@ -236,6 +236,13 @@ unsigned get_last_off_on_transaction_id(struct device *dev) > return 0; > } > > +void __init omap_pm_early_init(struct prm_setup_vc *setup_times) > +{ > + if (cpu_is_omap34xx()) > + omap3_set_prm_setup_vc(setup_times); > + return; > +} > + > static int __init omap_pm_init(void) > { > int error = -1; > diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h > index ddc9453..0beb32d 100644 > --- a/arch/arm/mach-omap2/pm.h > +++ b/arch/arm/mach-omap2/pm.h > @@ -13,12 +13,6 @@ > > #include <mach/powerdomain.h> > > -#ifdef CONFIG_ARCH_OMAP3 > -extern unsigned short enable_dyn_sleep; > -extern unsigned short enable_off_mode; > -extern unsigned short voltage_off_while_idle; > -extern void *omap3_secure_ram_storage; > - > struct prm_setup_vc { > u16 clksetup; > u16 voltsetup_time1; > @@ -37,6 +31,11 @@ struct prm_setup_vc { > u16 vdd1_off; > }; > > +#ifdef CONFIG_ARCH_OMAP3 > +extern unsigned short enable_dyn_sleep; > +extern unsigned short enable_off_mode; > +extern unsigned short voltage_off_while_idle; > +extern void *omap3_secure_ram_storage; > extern void omap3_pm_off_mode_enable(int); > extern void omap_sram_idle(void); > extern int omap3_can_sleep(void); > @@ -44,13 +43,15 @@ extern int set_pwrdm_state(struct powerdomain *pwrdm, u32 state); > extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); > extern int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state); > extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc); > - > #ifdef CONFIG_CPU_IDLE > int omap3_idle_init(void); > #else > static inline int omap3_idle_init(void) { return 0; } > #endif > > +#else /* CONFIG_ARCH_OMAP3 */ > +#define omap3_set_prm_setup_vc(setup_vc) do {} while (0); > + > #endif /* CONFIG_ARCH_OMAP3 */ > extern int resource_set_opp_level(int res, u32 target_level, int flags); > extern int resource_access_opp_lock(int res, int delta); > @@ -90,5 +91,6 @@ extern unsigned int omap34xx_suspend_sz; > extern unsigned int save_secure_ram_context_sz; > extern unsigned int omap24xx_cpu_suspend_sz; > extern unsigned int omap34xx_cpu_suspend_sz; > +void __init omap_pm_early_init(struct prm_setup_vc *setup_times); > > #endif > diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c > index 7a4a525..7b05244 100644 > --- a/arch/arm/mach-omap2/pm34xx.c > +++ b/arch/arm/mach-omap2/pm34xx.c > @@ -77,6 +77,13 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm; > static struct powerdomain *core_pwrdm, *per_pwrdm; > static struct powerdomain *cam_pwrdm; > > +/* > + * These values are board specific and have to be passed from > + * the respective board files. > + * The values used here are just worst case values which will > + * be used on boards which do not pass on these values from > + * the board files. > + */ > static struct prm_setup_vc prm_setup = { > .clksetup = 0xff, > .voltsetup_time1 = 0xfff, > @@ -985,6 +992,9 @@ int omap3_pm_set_suspend_state(struct powerdomain *pwrdm, int state) > > void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc) > { > + if (!setup_vc) > + return; > + > prm_setup.clksetup = setup_vc->clksetup; > prm_setup.voltsetup_time1 = setup_vc->voltsetup_time1; > prm_setup.voltsetup_time2 = setup_vc->voltsetup_time2; > diff --git a/arch/arm/plat-omap/include/mach/io.h b/arch/arm/plat-omap/include/mach/io.h > index 142f7e2..3582bef 100644 > --- a/arch/arm/plat-omap/include/mach/io.h > +++ b/arch/arm/plat-omap/include/mach/io.h > @@ -224,6 +224,7 @@ > > struct omap_sdrc_params; > struct omap_opp; > +struct prm_setup_vc; > > extern void omap1_map_common_io(void); > extern void omap1_init_common_hw(void); > @@ -232,7 +233,8 @@ extern void omap2_map_common_io(void); > extern void omap2_init_common_hw(struct omap_sdrc_params *sp, > struct omap_opp *mpu_opps, > struct omap_opp *dsp_opps, > - struct omap_opp *l3_opps); > + struct omap_opp *l3_opps, > + struct prm_setup_vc *setup_times); > > #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) > #define __arch_iounmap(v) omap_iounmap(v) > -- > 1.5.4.7 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-omap" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html ^ permalink raw reply [flat|nested] 7+ messages in thread
* RE: [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files 2009-09-30 19:13 ` [PATCH 1/2] OMAP3: PM: Configure PRM setup times " Kevin Hilman @ 2009-10-06 6:10 ` Nayak, Rajendra 0 siblings, 0 replies; 7+ messages in thread From: Nayak, Rajendra @ 2009-10-06 6:10 UTC (permalink / raw) To: Kevin Hilman; +Cc: linux-omap@vger.kernel.org >-----Original Message----- >From: Kevin Hilman [mailto:khilman@deeprootsystems.com] >Sent: Thursday, October 01, 2009 12:44 AM >To: Nayak, Rajendra >Cc: linux-omap@vger.kernel.org >Subject: Re: [PATCH 1/2] OMAP3: PM: Configure PRM setup times >from board files > >Rajendra Nayak <rnayak@ti.com> writes: > >> The setup times to be programmed in the PRM module on OMAP >> (for clksetup, voltsetup etc) are board specific. >> They depend heavily on the PMIC used and even on different boards >> with the same PMIC, they vary based on the sleep/wake >> sequence used, system clock speed et al. >> >> This patch makes it possible for these setup values to be >> configured from different board files. >> >> Signed-off-by: Rajendra Nayak <rnayak@ti.com> > >Hi Rajendra, > >Sorry about this, but your series slipped through cracks on my side. > >I like this approach, but it needs to be rebased against current PM >branch since lots of the code that it touches has been reworked. > >Also, instead of continuing to overload init_common_hw, how about >adding something like omap_pm_register() which takes the various rate >tables and setup times, or possibly adding the rate tables and setup >times as arguments to omap3_pm_earlly_init() and making it explicitly >called by board code instead of an arch_initcall(). Hi Kevin, Yes, I will rework this patch and repost in a couple days. regards, Rajendra > >Kevin > >> --- >> arch/arm/mach-omap2/board-3430sdp.c | 20 +++++++++++++++++++- >> arch/arm/mach-omap2/board-apollon.c | 2 +- >> arch/arm/mach-omap2/board-generic.c | 2 +- >> arch/arm/mach-omap2/board-h4.c | 2 +- >> arch/arm/mach-omap2/board-ldp.c | 2 +- >> arch/arm/mach-omap2/board-omap3beagle.c | 2 +- >> arch/arm/mach-omap2/board-omap3evm.c | 2 +- >> arch/arm/mach-omap2/board-overo.c | 2 +- >> arch/arm/mach-omap2/board-rx51.c | 2 +- >> arch/arm/mach-omap2/board-zoom2.c | 2 +- >> arch/arm/mach-omap2/io.c | 5 ++++- >> arch/arm/mach-omap2/pm.c | 7 +++++++ >> arch/arm/mach-omap2/pm.h | 16 +++++++++------- >> arch/arm/mach-omap2/pm34xx.c | 10 ++++++++++ >> arch/arm/plat-omap/include/mach/io.h | 4 +++- >> 15 files changed, 61 insertions(+), 19 deletions(-) >> >> diff --git a/arch/arm/mach-omap2/board-3430sdp.c >b/arch/arm/mach-omap2/board-3430sdp.c >> index e9a4d10..b43cf94 100644 >> --- a/arch/arm/mach-omap2/board-3430sdp.c >> +++ b/arch/arm/mach-omap2/board-3430sdp.c >> @@ -58,6 +58,23 @@ >> >> #define TWL4030_MSECURE_GPIO 22 >> >> +/* FIXME: These are not the optimal setup values to be used >on 3430sdp*/ >> +static struct prm_setup_vc omap3_setuptime_table = { >> + .clksetup = 0xff, >> + .voltsetup_time1 = 0xfff, >> + .voltsetup_time2 = 0xfff, >> + .voltoffset = 0xff, >> + .voltsetup2 = 0xff, >> + .vdd0_on = 0x30, >> + .vdd0_onlp = 0x20, >> + .vdd0_ret = 0x1e, >> + .vdd0_off = 0x00, >> + .vdd1_on = 0x2c, >> + .vdd1_onlp = 0x20, >> + .vdd1_ret = 0x1e, >> + .vdd1_off = 0x00, >> +}; >> + >> static int sdp3430_keymap[] = { >> KEY(0, 0, KEY_LEFT), >> KEY(0, 1, KEY_RIGHT), >> @@ -174,7 +191,8 @@ static struct platform_device >*sdp3430_devices[] __initdata = { >> static void __init omap_3430sdp_init_irq(void) >> { >> omap2_init_common_hw(hyb18m512160af6_sdrc_params, >omap3_mpu_rate_table, >> - omap3_dsp_rate_table, omap3_l3_rate_table); >> + omap3_dsp_rate_table, omap3_l3_rate_table, >> + &omap3_setuptime_table); >> omap_init_irq(); >> omap_gpio_init(); >> } >> diff --git a/arch/arm/mach-omap2/board-apollon.c >b/arch/arm/mach-omap2/board-apollon.c >> index 1a7fb81..293a9b2 100644 >> --- a/arch/arm/mach-omap2/board-apollon.c >> +++ b/arch/arm/mach-omap2/board-apollon.c >> @@ -250,7 +250,7 @@ out: >> >> static void __init omap_apollon_init_irq(void) >> { >> - omap2_init_common_hw(NULL, NULL, NULL, NULL); >> + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> apollon_init_smc91x(); >> diff --git a/arch/arm/mach-omap2/board-generic.c >b/arch/arm/mach-omap2/board-generic.c >> index 23583da..dfc1b49 100644 >> --- a/arch/arm/mach-omap2/board-generic.c >> +++ b/arch/arm/mach-omap2/board-generic.c >> @@ -33,7 +33,7 @@ >> >> static void __init omap_generic_init_irq(void) >> { >> - omap2_init_common_hw(NULL, NULL, NULL, NULL); >> + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); >> omap_init_irq(); >> } >> >> diff --git a/arch/arm/mach-omap2/board-h4.c >b/arch/arm/mach-omap2/board-h4.c >> index de6adf7..af0ebaf 100644 >> --- a/arch/arm/mach-omap2/board-h4.c >> +++ b/arch/arm/mach-omap2/board-h4.c >> @@ -270,7 +270,7 @@ static void __init h4_init_flash(void) >> >> static void __init omap_h4_init_irq(void) >> { >> - omap2_init_common_hw(NULL, NULL, NULL, NULL); >> + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> h4_init_flash(); >> diff --git a/arch/arm/mach-omap2/board-ldp.c >b/arch/arm/mach-omap2/board-ldp.c >> index 3b662ff..eb5e2e0 100644 >> --- a/arch/arm/mach-omap2/board-ldp.c >> +++ b/arch/arm/mach-omap2/board-ldp.c >> @@ -270,7 +270,7 @@ static inline void __init ldp_init_smsc911x(void) >> >> static void __init omap_ldp_init_irq(void) >> { >> - omap2_init_common_hw(NULL, NULL, NULL, NULL); >> + omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> ldp_init_smsc911x(); >> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c >b/arch/arm/mach-omap2/board-omap3beagle.c >> index 36b4bfb..e0be6bd 100644 >> --- a/arch/arm/mach-omap2/board-omap3beagle.c >> +++ b/arch/arm/mach-omap2/board-omap3beagle.c >> @@ -289,7 +289,7 @@ static int __init omap3_beagle_i2c_init(void) >> static void __init omap3_beagle_init_irq(void) >> { >> omap2_init_common_hw(mt46h32m32lf6_sdrc_params, >omap3_mpu_rate_table, >> - omap3_dsp_rate_table, omap3_l3_rate_table); >> + omap3_dsp_rate_table, >omap3_l3_rate_table, NULL); >> omap_init_irq(); >> #ifdef CONFIG_OMAP_32K_TIMER >> omap2_gp_clockevent_set_gptimer(12); >> diff --git a/arch/arm/mach-omap2/board-omap3evm.c >b/arch/arm/mach-omap2/board-omap3evm.c >> index e300a9e..eaab39b 100644 >> --- a/arch/arm/mach-omap2/board-omap3evm.c >> +++ b/arch/arm/mach-omap2/board-omap3evm.c >> @@ -284,7 +284,7 @@ struct spi_board_info >omap3evm_spi_board_info[] = { >> static void __init omap3_evm_init_irq(void) >> { >> omap2_init_common_hw(mt46h32m32lf6_sdrc_params, >omap3_mpu_rate_table, >> - omap3_dsp_rate_table, omap3_l3_rate_table); >> + omap3_dsp_rate_table, >omap3_l3_rate_table, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> omap3evm_init_smc911x(); >> diff --git a/arch/arm/mach-omap2/board-overo.c >b/arch/arm/mach-omap2/board-overo.c >> index 0bff181..f159e18 100644 >> --- a/arch/arm/mach-omap2/board-overo.c >> +++ b/arch/arm/mach-omap2/board-overo.c >> @@ -360,7 +360,7 @@ static int __init overo_i2c_init(void) >> >> static void __init overo_init_irq(void) >> { >> - omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, >NULL, NULL); >> + omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, >NULL, NULL, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> } >> diff --git a/arch/arm/mach-omap2/board-rx51.c >b/arch/arm/mach-omap2/board-rx51.c >> index 4733e4e..3629a0e 100644 >> --- a/arch/arm/mach-omap2/board-rx51.c >> +++ b/arch/arm/mach-omap2/board-rx51.c >> @@ -66,7 +66,7 @@ static struct omap_board_config_kernel >rx51_config[] = { >> static void __init rx51_init_irq(void) >> { >> omap2_init_common_hw(rx51_get_sdram_timings(), >omap3_mpu_rate_table, >> - omap3_dsp_rate_table, omap3_l3_rate_table); >> + omap3_dsp_rate_table, >omap3_l3_rate_table, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> } >> diff --git a/arch/arm/mach-omap2/board-zoom2.c >b/arch/arm/mach-omap2/board-zoom2.c >> index 981f28e..e63bfa0 100644 >> --- a/arch/arm/mach-omap2/board-zoom2.c >> +++ b/arch/arm/mach-omap2/board-zoom2.c >> @@ -27,7 +27,7 @@ >> static void __init omap_zoom2_init_irq(void) >> { >> omap2_init_common_hw(NULL, omap3_mpu_rate_table, >> - omap3_dsp_rate_table, omap3_l3_rate_table); >> + omap3_dsp_rate_table, >omap3_l3_rate_table, NULL); >> omap_init_irq(); >> omap_gpio_init(); >> } >> diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c >> index 980322d..266a5a1 100644 >> --- a/arch/arm/mach-omap2/io.c >> +++ b/arch/arm/mach-omap2/io.c >> @@ -44,6 +44,7 @@ >> >> #include <mach/clockdomain.h> >> #include "clockdomains.h" >> +#include "pm.h" >> #endif >> /* >> * The machine specific code may provide the extra mapping >besides the >> @@ -281,12 +282,14 @@ static int __init >_omap2_init_reprogram_sdrc(void) >> void __init omap2_init_common_hw(struct omap_sdrc_params *sp, >> struct omap_opp *mpu_opps, >> struct omap_opp *dsp_opps, >> - struct omap_opp *l3_opps) >> + struct omap_opp *l3_opps, >> + struct prm_setup_vc *setup_times) >> { >> omap2_mux_init(); >> #ifndef CONFIG_ARCH_OMAP4 /* FIXME: Remove this once the >clkdev is ready */ >> /* The OPP tables have to be registered before a clk init */ >> omap_pm_if_early_init(mpu_opps, dsp_opps, l3_opps); >> + omap_pm_early_init(setup_times); >> pwrdm_init(powerdomains_omap); >> clkdm_init(clockdomains_omap, clkdm_pwrdm_autodeps); >> omapdev_init(omapdevs); >> diff --git a/arch/arm/mach-omap2/pm.c b/arch/arm/mach-omap2/pm.c >> index 1192e01..b81ba3b 100644 >> --- a/arch/arm/mach-omap2/pm.c >> +++ b/arch/arm/mach-omap2/pm.c >> @@ -236,6 +236,13 @@ unsigned >get_last_off_on_transaction_id(struct device *dev) >> return 0; >> } >> >> +void __init omap_pm_early_init(struct prm_setup_vc *setup_times) >> +{ >> + if (cpu_is_omap34xx()) >> + omap3_set_prm_setup_vc(setup_times); >> + return; >> +} >> + >> static int __init omap_pm_init(void) >> { >> int error = -1; >> diff --git a/arch/arm/mach-omap2/pm.h b/arch/arm/mach-omap2/pm.h >> index ddc9453..0beb32d 100644 >> --- a/arch/arm/mach-omap2/pm.h >> +++ b/arch/arm/mach-omap2/pm.h >> @@ -13,12 +13,6 @@ >> >> #include <mach/powerdomain.h> >> >> -#ifdef CONFIG_ARCH_OMAP3 >> -extern unsigned short enable_dyn_sleep; >> -extern unsigned short enable_off_mode; >> -extern unsigned short voltage_off_while_idle; >> -extern void *omap3_secure_ram_storage; >> - >> struct prm_setup_vc { >> u16 clksetup; >> u16 voltsetup_time1; >> @@ -37,6 +31,11 @@ struct prm_setup_vc { >> u16 vdd1_off; >> }; >> >> +#ifdef CONFIG_ARCH_OMAP3 >> +extern unsigned short enable_dyn_sleep; >> +extern unsigned short enable_off_mode; >> +extern unsigned short voltage_off_while_idle; >> +extern void *omap3_secure_ram_storage; >> extern void omap3_pm_off_mode_enable(int); >> extern void omap_sram_idle(void); >> extern int omap3_can_sleep(void); >> @@ -44,13 +43,15 @@ extern int set_pwrdm_state(struct >powerdomain *pwrdm, u32 state); >> extern int omap3_pm_get_suspend_state(struct powerdomain *pwrdm); >> extern int omap3_pm_set_suspend_state(struct powerdomain >*pwrdm, int state); >> extern void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc); >> - >> #ifdef CONFIG_CPU_IDLE >> int omap3_idle_init(void); >> #else >> static inline int omap3_idle_init(void) { return 0; } >> #endif >> >> +#else /* CONFIG_ARCH_OMAP3 */ >> +#define omap3_set_prm_setup_vc(setup_vc) do {} while (0); >> + >> #endif /* CONFIG_ARCH_OMAP3 */ >> extern int resource_set_opp_level(int res, u32 >target_level, int flags); >> extern int resource_access_opp_lock(int res, int delta); >> @@ -90,5 +91,6 @@ extern unsigned int omap34xx_suspend_sz; >> extern unsigned int save_secure_ram_context_sz; >> extern unsigned int omap24xx_cpu_suspend_sz; >> extern unsigned int omap34xx_cpu_suspend_sz; >> +void __init omap_pm_early_init(struct prm_setup_vc *setup_times); >> >> #endif >> diff --git a/arch/arm/mach-omap2/pm34xx.c >b/arch/arm/mach-omap2/pm34xx.c >> index 7a4a525..7b05244 100644 >> --- a/arch/arm/mach-omap2/pm34xx.c >> +++ b/arch/arm/mach-omap2/pm34xx.c >> @@ -77,6 +77,13 @@ static struct powerdomain *mpu_pwrdm, *neon_pwrdm; >> static struct powerdomain *core_pwrdm, *per_pwrdm; >> static struct powerdomain *cam_pwrdm; >> >> +/* >> + * These values are board specific and have to be passed from >> + * the respective board files. >> + * The values used here are just worst case values which will >> + * be used on boards which do not pass on these values from >> + * the board files. >> + */ >> static struct prm_setup_vc prm_setup = { >> .clksetup = 0xff, >> .voltsetup_time1 = 0xfff, >> @@ -985,6 +992,9 @@ int omap3_pm_set_suspend_state(struct >powerdomain *pwrdm, int state) >> >> void omap3_set_prm_setup_vc(struct prm_setup_vc *setup_vc) >> { >> + if (!setup_vc) >> + return; >> + >> prm_setup.clksetup = setup_vc->clksetup; >> prm_setup.voltsetup_time1 = setup_vc->voltsetup_time1; >> prm_setup.voltsetup_time2 = setup_vc->voltsetup_time2; >> diff --git a/arch/arm/plat-omap/include/mach/io.h >b/arch/arm/plat-omap/include/mach/io.h >> index 142f7e2..3582bef 100644 >> --- a/arch/arm/plat-omap/include/mach/io.h >> +++ b/arch/arm/plat-omap/include/mach/io.h >> @@ -224,6 +224,7 @@ >> >> struct omap_sdrc_params; >> struct omap_opp; >> +struct prm_setup_vc; >> >> extern void omap1_map_common_io(void); >> extern void omap1_init_common_hw(void); >> @@ -232,7 +233,8 @@ extern void omap2_map_common_io(void); >> extern void omap2_init_common_hw(struct omap_sdrc_params *sp, >> struct omap_opp *mpu_opps, >> struct omap_opp *dsp_opps, >> - struct omap_opp *l3_opps); >> + struct omap_opp *l3_opps, >> + struct prm_setup_vc *setup_times); >> >> #define __arch_ioremap(p,s,t) omap_ioremap(p,s,t) >> #define __arch_iounmap(v) omap_iounmap(v) >> -- >> 1.5.4.7 >> >> -- >> To unsubscribe from this list: send the line "unsubscribe >linux-omap" in >> the body of a message to majordomo@vger.kernel.org >> More majordomo info at http://vger.kernel.org/majordomo-info.html > > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-10-06 6:11 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-06-29 14:35 [PATCH 1/2] OMAP3: PM: Configure PRM setup times from board files Rajendra Nayak 2009-06-29 14:35 ` [PATCH 2/2] OMAP3: PM: Configure CPUidle latencies/thresholds " Rajendra Nayak 2009-06-29 20:18 ` Mike Chan 2009-06-30 11:41 ` Premi, Sanjeev 2009-06-30 22:58 ` Kevin Hilman 2009-09-30 19:13 ` [PATCH 1/2] OMAP3: PM: Configure PRM setup times " Kevin Hilman 2009-10-06 6:10 ` Nayak, Rajendra
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox