diff options
author | Ranjan Kumar <ranjan.kumar@stericsson.com> | 2011-09-06 19:40:09 +0530 |
---|---|---|
committer | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-09-22 15:41:10 +0530 |
commit | 4ec93058a619acfafcb3ed307b04a21bf8fdaa09 (patch) | |
tree | e40c4463b11ee494cc52b28503de4fb1cffc844f | |
parent | a83b09df14230c2da61773dadb5018370ef8c256 (diff) |
U5500: Disable the unused clocks at startup
Disables some of the peripheral clocks which are not required at the
startup. Mainly added a function init_clock_states() which does this
job.
ST-Ericsson Linux next: NA
ST-Ericsson ID: 358241
ST-Ericsson FOSS-OUT ID: Trivial
Signed-off-by: Ranjan Kumar <ranjan.kumar@stericsson.com>
Change-Id: Ice4f355b9cb8f2d885b603fafdd84cd8affa8ae5
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30259
Tested-by: Ranjan KUMAR <ranjan.kumar@stericsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
-rw-r--r-- | arch/arm/mach-ux500/clock-db5500.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/arm/mach-ux500/clock-db5500.c b/arch/arm/mach-ux500/clock-db5500.c index b247719ab42..ae499aa8999 100644 --- a/arch/arm/mach-ux500/clock-db5500.c +++ b/arch/arm/mach-ux500/clock-db5500.c @@ -741,6 +741,57 @@ static void configure_clkouts(void) DB5500_CLKOUT_REF_CLK_SEL0, 0)); } +static struct clk *db5500_clks_tobe_disabled[] __initdata = { + &siaclk, + &sgaclk, + &sdmmcclk, + &p1_pclk0, + &p1_pclk6, + &p3_keypad_clk, + &p3_pclk1, + &p5_pclk0, + &p5_pclk11, + &p5_pclk12, + &p5_pclk13, + &p5_pclk14, + &p6_pclk4, + &p6_pclk5, + &p6_pclk7, + &p5_uart1_clk, + &p5_uart2_clk, + &p5_uart3_clk, + &p5_sdi1_clk, + &p5_sdi3_clk, + &p5_sdi4_clk, + &p5_i2c3_clk, + &p5_irrc_clk, + &p5_irda_clk, +}; + +static int __init init_clock_states(void) +{ + int i = 0; + /* + * The following clks are shared with secure world. + * Currently this leads to a limitation where we need to + * enable them at all times. + */ + clk_enable(&p6_pclk1); + clk_enable(&p6_pclk2); + clk_enable(&p6_pclk3); + clk_enable(&p6_rng_clk); + + /* + * Disable clocks that are on at boot, but should be off. + */ + for (i = 0; i < ARRAY_SIZE(db5500_clks_tobe_disabled); i++) { + if (!clk_enable(db5500_clks_tobe_disabled[i])) + clk_disable(db5500_clks_tobe_disabled[i]); + } + return 0; +} +late_initcall(init_clock_states); + int __init db5500_clk_init(void) { if (ux500_is_svp()) { |