omap:pm: cleanup omap3_[mpu|dsp|l3]_rate_table
cover omap:pm: cleanup omap3_[mpu|dsp|l3]_rate_table
With the pm-wip-opp branch, we can do further cleanups with the omap2_init_common_hw
Since the inits of mpu_opps etc are happening at omap3_pm_init_opp_table, we can just quit doing a double init
Nishanth Menon (2):
io: remove redundant params in omap2_init_common_hw
omap3: pm: remove omap3_[mpu|dsp|l3]_rate_tables
arch/arm/mach-omap2/board-3430sdp.c | 3 +-- arch/arm/mach-omap2/board-3630sdp.c | 4 +--- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 3 +-- 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 | 3 +-- arch/arm/mach-omap2/board-omap3evm.c | 3 +-- arch/arm/mach-omap2/board-omap3pandora.c | 3 +-- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 5 +---- arch/arm/mach-omap2/board-zoom2.c | 3 +-- arch/arm/mach-omap2/board-zoom3.c | 4 +--- arch/arm/mach-omap2/io.c | 5 +---- arch/arm/mach-omap2/pm34xx.c | 15 +++------------ arch/arm/plat-omap/include/plat/io.h | 5 +---- 17 files changed, 19 insertions(+), 47 deletions(-)
Regards,
Nishanth Menon
PS: my vacation is on for the next 2 weeks, see you all next year. happy hacking..
PATCH 1/2 io: remove redundant params in omap2_init_common_hw
dsp_opp, mpu_opp, l3_opps are now not used by omap2_init_common_hw, remove them
--- arch/arm/mach-omap2/board-3430sdp.c | 3 +-- arch/arm/mach-omap2/board-3630sdp.c | 4 +--- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 3 +-- 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 | 3 +-- arch/arm/mach-omap2/board-omap3evm.c | 3 +-- arch/arm/mach-omap2/board-omap3pandora.c | 3 +-- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 5 +---- arch/arm/mach-omap2/board-zoom2.c | 3 +-- arch/arm/mach-omap2/board-zoom3.c | 4 +--- arch/arm/mach-omap2/io.c | 5 +---- arch/arm/plat-omap/include/plat/io.h | 5 +---- 16 files changed, 16 insertions(+), 35 deletions(-)
arch/arm/mach-omap2/board-3430sdp.c +1 -2
@@ -345,8 +345,7 @@ static void __init omap_3430sdp_init_irq(void)omap3_pm_init_opp_table ();omap3_pm_init_cpuidle (omap3_cpuidle_params_table);omap3_pm_init_vc (&omap3_setuptime_table); -omap2_init_common_hw (hyb18m512160af6_sdrc_params,NULL , omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); +omap2_init_common_hw (hyb18m512160af6_sdrc_params,NULL );omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-3630sdp.c +1 -3
@@ -86,9 +86,7 @@ static void __init omap_sdp_init_irq(void)/* TODO: Add RET, OFF, cpu_idle params */ omap2_init_common_hw (h8mbx00u0mer0em_sdrc_params, - h8mbx00u0mer0em_sdrc_params, - omap3_mpu_rate_table, omap3_dsp_rate_table, - omap3_l3_rate_table); + h8mbx00u0mer0em_sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-apollon.c +1 -1
@@ -277,7 +277,7 @@ static void __init omap_apollon_init_irq(void) { omap_board_config = apollon_config; omap_board_config_size =ARRAY_SIZE (apollon_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq ();omap_gpio_init ();apollon_init_smc91x ();
arch/arm/mach-omap2/board-cm-t35.c +1 -2
@@ -471,8 +471,7 @@ static void __init cm_t35_init_irq(void) omap_board_config_size =ARRAY_SIZE (cm_t35_config);omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, -NULL ,NULL ,NULL ); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-generic.c +1 -1
@@ -38,7 +38,7 @@ static void __init omap_generic_init_irq(void) { omap_board_config = generic_config; omap_board_config_size =ARRAY_SIZE (generic_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq (); }
arch/arm/mach-omap2/board-h4.c +1 -1
@@ -313,7 +313,7 @@ static void __init omap_h4_init_irq(void) { omap_board_config = h4_config; omap_board_config_size =ARRAY_SIZE (h4_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq ();omap_gpio_init ();h4_init_flash ();
arch/arm/mach-omap2/board-ldp.c +1 -1
@@ -290,7 +290,7 @@ static void __init omap_ldp_init_irq(void) { omap_board_config = ldp_config; omap_board_config_size =ARRAY_SIZE (ldp_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq ();omap_gpio_init ();ldp_init_smsc911x ();
arch/arm/mach-omap2/board-omap3beagle.c +1 -2
@@ -363,8 +363,7 @@ static void __init omap3_beagle_init_irq(void) omap_board_config_size =ARRAY_SIZE (omap3_beagle_config);omap3_pm_init_opp_table ();omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + mt46h32m32lf6_sdrc_params);omap_init_irq ();#ifdef CONFIG_OMAP_32K_TIMER omap2_gp_clockevent_set_gptimer (12 );
arch/arm/mach-omap2/board-omap3evm.c +1 -2
@@ -405,8 +405,7 @@ static void __init omap3_evm_init_irq(void) omap_board_config = omap3_evm_config; omap_board_config_size =ARRAY_SIZE (omap3_evm_config);omap3_pm_init_opp_table (); -omap2_init_common_hw (mt46h32m32lf6_sdrc_params,NULL , omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); +omap2_init_common_hw (mt46h32m32lf6_sdrc_params,NULL );omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-omap3pandora.c +1 -2
@@ -371,8 +371,7 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {static void __init omap3pandora_init_irq (void ) {omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, -NULL ,NULL ,NULL ); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-overo.c +1 -1
@@ -385,7 +385,7 @@ static void __init overo_init_irq(void) omap_board_config = overo_config; omap_board_config_size =ARRAY_SIZE (overo_config);omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params,NULL ,NULL ,NULL ); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-rx51.c +1 -4
@@ -108,10 +108,7 @@ static void __init rx51_init_irq(void)omap3_pm_init_opp_table ();omap3_pm_init_cpuidle (rx51_cpuidle_params); sdrc_params =rx51_get_sdram_timings (); -omap2_init_common_hw (sdrc_params, sdrc_params, - omap3_mpu_rate_table, - omap3_dsp_rate_table, - omap3_l3_rate_table); +omap2_init_common_hw (sdrc_params, sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-zoom2.c +1 -2
@@ -32,8 +32,7 @@ static void __init omap_zoom2_init_irq(void) {omap3_pm_init_opp_table ();omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/board-zoom3.c +1 -3
@@ -44,9 +44,7 @@ static void __init omap_zoom_init_irq(void)/* TODO: Add RET, OFF, cpu_idle params */ omap2_init_common_hw (h8mbx00u0mer0em_sdrc_params, - h8mbx00u0mer0em_sdrc_params, - omap3_mpu_rate_table, omap3_dsp_rate_table, - omap3_l3_rate_table); + h8mbx00u0mer0em_sdrc_params);omap_init_irq ();omap_gpio_init (); }
arch/arm/mach-omap2/io.c +1 -4
@@ -302,10 +302,7 @@ static int __init _omap2_init_reprogram_sdrc(void) }void __init omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0, -struct omap_sdrc_params *sdrc_cs1, -struct omap_opp *mpu_opps, -struct omap_opp *dsp_opps, -struct omap_opp *l3_opps) +struct omap_sdrc_params *sdrc_cs1) {struct omap_hwmod **hwmods =NULL ;
arch/arm/plat-omap/include/plat/io.h +1 -4
@@ -275,10 +275,7 @@ extern void omap1_init_common_hw(void);extern void omap2_map_common_io (void );extern void omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0, -struct omap_sdrc_params *sdrc_cs1, -struct omap_opp *mpu_opps, -struct omap_opp *dsp_opps, -struct omap_opp *l3_opps); +struct omap_sdrc_params *sdrc_cs1);#define __arch_ioremap (p,s,t) omap_ioremap(p,s,t)#define __arch_iounmap (v) omap_iounmap(v)
Signature · 1 line
1.6.3.3
PATCH 2/2 omap3: pm: remove omap3_[mpu|dsp|l3]_rate_tables
since _rate_tables are initializing mpu_opps, dsp_opps and l3_opps it makes no sense in having these initialize just once. optimize these out
--- arch/arm/mach-omap2/pm34xx.c | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-)
arch/arm/mach-omap2/pm34xx.c +3 -12
@@ -189,11 +189,6 @@ static struct omap_opp_def __initdata omap36xx_dsp_rate_table[] = { OMAP_OPP_DEF(0, 0, 0) }; -/* OMAP3 Rate Table */ -struct omap_opp *omap3_mpu_rate_table; -struct omap_opp *omap3_dsp_rate_table; -struct omap_opp *omap3_l3_rate_table; -static inline void omap3_per_save_context (void ) {omap_gpio_save_context ();
@@ -1365,9 +1360,9 @@ void __init omap3_pm_init_opp_table(void)omap36xx_dsp_rate_table };struct omap_opp **omap3_rate_tables[] = { - &omap3_mpu_rate_table, - &omap3_l3_rate_table, - &omap3_dsp_rate_table + &mpu_opps, + &dsp_opps, + &l3_opps }; omap3_opp_def_list = cpu_is_omap3630() ? omap36xx_opp_def_list :
@@ -1377,10 +1372,6 @@ void __init omap3_pm_init_opp_table(void)/* We dont want half configured system at the moment */ BUG_ON (IS_ERR (omap3_rate_tables[i])); } - - mpu_opps = omap3_mpu_rate_table; - dsp_opps = omap3_dsp_rate_table; - l3_opps = omap3_l3_rate_table; }static int __init omap3_pm_early_init (void )
Signature · 1 line
1.6.3.3
Re: [PATCH 1/2] io: remove redundant params in omap2_init_common_hw
In reply to Nishanth MenonReview
Quoted 2 lines
(quoted diff) +1
-1- omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL);
A call to a function with NULL parameters suggests that the function is doing more than it should. I think omap2_init_common_hw and omap2_sdrc_init, _omap2_init_reprogram_sdrc, gpmc init can be separated from omap2_init_common_hw. If you are refactoring the code may be this should be taken care as well.
Re: [PATCH 1/2] io: remove redundant params in omap2_init_common_hw
Quoted 6 lines · Romit Dasgupta
Review
Quoted 2 lines
(quoted diff) +1
-1- omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL); + omap2_init_common_hw(NULL, NULL);A call to a function with NULL parameters suggests that the function is doing more than it should.
Not necessarily. It can also suggest that this board does not want to override any default settings.
Quoted 6 lines
I think
omap2_init_common_hwandomap2_sdrc_init,_omap2_init_reprogram_sdrc, gpmc init can be separated fromomap2_init_common_hw.If you are refactoring the code may be this should be taken care as well.
In this case, Nishanth is not refactoring, he's just removing some code added earlier in the PM branch that is no longer needed.
A patch to do what you suggest (which is a good idea) should be a separate patch and generated against l-o master.
Kevin
Re: [PATCH 1/2] io: remove redundant params in omap2_init_common_hw
In reply to Nishanth MenonQuoted 5 lines · Nishanth Menon
dsp_opp,mpu_opp,l3_oppsare now not used byomap2_init_common_hw, remove themSigned-off-by Nishanth Menon <[email protected]>Cc Ambresh k <[email protected]>
Once I merge the new OPP layer, I'm planning to do the equivalent of this patch in the PM branch simply by dropping the original patch that added it to the PM branch in the first place.
Kevin
Quoted 248 lines
--- arch/arm/mach-omap2/board-3430sdp.c | 3 +-- arch/arm/mach-omap2/board-3630sdp.c | 4 +--- arch/arm/mach-omap2/board-apollon.c | 2 +- arch/arm/mach-omap2/board-cm-t35.c | 3 +-- 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 | 3 +-- arch/arm/mach-omap2/board-omap3evm.c | 3 +-- arch/arm/mach-omap2/board-omap3pandora.c | 3 +-- arch/arm/mach-omap2/board-overo.c | 2 +- arch/arm/mach-omap2/board-rx51.c | 5 +---- arch/arm/mach-omap2/board-zoom2.c | 3 +-- arch/arm/mach-omap2/board-zoom3.c | 4 +--- arch/arm/mach-omap2/io.c | 5 +---- arch/arm/plat-omap/include/plat/io.h | 5 +---- 16 files changed, 16 insertions(+), 35 deletions(-)arch/arm/mach-omap2/board-3430sdp.c +1
-2@@ -345,8 +345,7 @@ static void __init omap_3430sdp_init_irq(void)omap3_pm_init_opp_table ();omap3_pm_init_cpuidle (omap3_cpuidle_params_table);omap3_pm_init_vc (&omap3_setuptime_table); -omap2_init_common_hw (hyb18m512160af6_sdrc_params,NULL , omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); +omap2_init_common_hw (hyb18m512160af6_sdrc_params,NULL );omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-3630sdp.c +1
-3@@ -86,9 +86,7 @@ static void __init omap_sdp_init_irq(void)/* TODO: Add RET, OFF, cpu_idle params */ omap2_init_common_hw (h8mbx00u0mer0em_sdrc_params, - h8mbx00u0mer0em_sdrc_params, - omap3_mpu_rate_table, omap3_dsp_rate_table, - omap3_l3_rate_table); + h8mbx00u0mer0em_sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-apollon.c +1
-1@@ -277,7 +277,7 @@ static void __init omap_apollon_init_irq(void) { omap_board_config = apollon_config; omap_board_config_size =ARRAY_SIZE (apollon_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq ();omap_gpio_init ();apollon_init_smc91x ();arch/arm/mach-omap2/board-cm-t35.c +1
-2@@ -471,8 +471,7 @@ static void __init cm_t35_init_irq(void) omap_board_config_size =ARRAY_SIZE (cm_t35_config);omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, -NULL ,NULL ,NULL ); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-generic.c +1
-1@@ -38,7 +38,7 @@ static void __init omap_generic_init_irq(void) { omap_board_config = generic_config; omap_board_config_size =ARRAY_SIZE (generic_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq (); }arch/arm/mach-omap2/board-h4.c +1
-1@@ -313,7 +313,7 @@ static void __init omap_h4_init_irq(void) { omap_board_config = h4_config; omap_board_config_size =ARRAY_SIZE (h4_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq ();omap_gpio_init ();h4_init_flash ();arch/arm/mach-omap2/board-ldp.c +1
-1@@ -290,7 +290,7 @@ static void __init omap_ldp_init_irq(void) { omap_board_config = ldp_config; omap_board_config_size =ARRAY_SIZE (ldp_config); -omap2_init_common_hw (NULL ,NULL ,NULL ,NULL ,NULL ); +omap2_init_common_hw (NULL ,NULL );omap_init_irq ();omap_gpio_init ();ldp_init_smsc911x ();arch/arm/mach-omap2/board-omap3beagle.c +1
-2@@ -363,8 +363,7 @@ static void __init omap3_beagle_init_irq(void) omap_board_config_size =ARRAY_SIZE (omap3_beagle_config);omap3_pm_init_opp_table ();omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + mt46h32m32lf6_sdrc_params);omap_init_irq ();#ifdef CONFIG_OMAP_32K_TIMER omap2_gp_clockevent_set_gptimer (12 );arch/arm/mach-omap2/board-omap3evm.c +1
-2@@ -405,8 +405,7 @@ static void __init omap3_evm_init_irq(void) omap_board_config = omap3_evm_config; omap_board_config_size =ARRAY_SIZE (omap3_evm_config);omap3_pm_init_opp_table (); -omap2_init_common_hw (mt46h32m32lf6_sdrc_params,NULL , omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); +omap2_init_common_hw (mt46h32m32lf6_sdrc_params,NULL );omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-omap3pandora.c +1
-2@@ -371,8 +371,7 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {static void __init omap3pandora_init_irq (void ) {omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, -NULL ,NULL ,NULL ); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-overo.c +1
-1@@ -385,7 +385,7 @@ static void __init overo_init_irq(void) omap_board_config = overo_config; omap_board_config_size =ARRAY_SIZE (overo_config);omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params,NULL ,NULL ,NULL ); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-rx51.c +1
-4@@ -108,10 +108,7 @@ static void __init rx51_init_irq(void)omap3_pm_init_opp_table ();omap3_pm_init_cpuidle (rx51_cpuidle_params); sdrc_params =rx51_get_sdram_timings (); -omap2_init_common_hw (sdrc_params, sdrc_params, - omap3_mpu_rate_table, - omap3_dsp_rate_table, - omap3_l3_rate_table); +omap2_init_common_hw (sdrc_params, sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-zoom2.c +1
-2@@ -32,8 +32,7 @@ static void __init omap_zoom2_init_irq(void) {omap3_pm_init_opp_table ();omap2_init_common_hw (mt46h32m32lf6_sdrc_params, - mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table, - omap3_dsp_rate_table, omap3_l3_rate_table); + mt46h32m32lf6_sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/board-zoom3.c +1
-3@@ -44,9 +44,7 @@ static void __init omap_zoom_init_irq(void)/* TODO: Add RET, OFF, cpu_idle params */ omap2_init_common_hw (h8mbx00u0mer0em_sdrc_params, - h8mbx00u0mer0em_sdrc_params, - omap3_mpu_rate_table, omap3_dsp_rate_table, - omap3_l3_rate_table); + h8mbx00u0mer0em_sdrc_params);omap_init_irq ();omap_gpio_init (); }arch/arm/mach-omap2/io.c +1
-4@@ -302,10 +302,7 @@ static int __init _omap2_init_reprogram_sdrc(void) }void __init omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0, -struct omap_sdrc_params *sdrc_cs1, -struct omap_opp *mpu_opps, -struct omap_opp *dsp_opps, -struct omap_opp *l3_opps) +struct omap_sdrc_params *sdrc_cs1) {struct omap_hwmod **hwmods =NULL ;arch/arm/plat-omap/include/plat/io.h +1
-4@@ -275,10 +275,7 @@ extern void omap1_init_common_hw(void);extern void omap2_map_common_io (void );extern void omap2_init_common_hw (struct omap_sdrc_params *sdrc_cs0, -struct omap_sdrc_params *sdrc_cs1, -struct omap_opp *mpu_opps, -struct omap_opp *dsp_opps, -struct omap_opp *l3_opps); +struct omap_sdrc_params *sdrc_cs1);#define __arch_ioremap (p,s,t) omap_ioremap(p,s,t)#define __arch_iounmap (v) omap_iounmap(v)Signature · 1 line
1.6.3.3