diff options
author | Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 2011-05-30 18:22:13 +0200 |
---|---|---|
committer | said m bagheri <ebgheri@steludxu2848.(none)> | 2011-06-17 13:42:07 +0200 |
commit | 740ab5a58314ca198e4cae4852118848396902e6 (patch) | |
tree | 4fd83af6f7c99ebf0d0b08fee1014abc5793fe5c | |
parent | 4a6bf31a7bea76c93a35d85e9badb37f94c62b89 (diff) |
arm: ux500: turn off some more clocks at startup
This patch disables the following clocks at initialization time:
bmlclk, dsialtclk, hsitxclk, ipi2cclk, and lcdclk.
Also, all the clock state initialization is moved to a late_inicall,
since some of the things done require the PRCMU driver to be fully
up and running.
ST Ericsson ID: 337707
ST Ericsson FOSS-OUT ID: trivial
ST Ericsson Linux-next: probably
Change-Id: I583b026b5936327cfd2aa76e5d0ce3256dafb66e
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/24203
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
-rw-r--r-- | arch/arm/mach-ux500/clock-db8500.c | 76 |
1 files changed, 47 insertions, 29 deletions
diff --git a/arch/arm/mach-ux500/clock-db8500.c b/arch/arm/mach-ux500/clock-db8500.c index 58bd646b478..afdd12f6406 100644 --- a/arch/arm/mach-ux500/clock-db8500.c +++ b/arch/arm/mach-ux500/clock-db8500.c @@ -1304,6 +1304,53 @@ static void u8500_amba_clk_enable(void) } } +static int __init init_clock_states(void) +{ + /* + * 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); + if (cpu_is_u8500() && !ux500_is_svp()) + clk_enable(&p6_rng_clk); + /* + * Disable clocks that are on at boot, but should be off. + */ + if (!clk_enable(&bmlclk)) + clk_disable(&bmlclk); + if (!clk_enable(&dsialtclk)) + clk_disable(&dsialtclk); + if (!clk_enable(&hsirxclk)) + clk_disable(&hsirxclk); + if (!clk_enable(&hsitxclk)) + clk_disable(&hsitxclk); + if (!clk_enable(&ipi2cclk)) + clk_disable(&ipi2cclk); + if (!clk_enable(&lcdclk)) + clk_disable(&lcdclk); + if (!clk_enable(&per7clk)) + clk_disable(&per7clk); + /* + * APEATCLK and APETRACECLK are enabled at boot and needed + * in order to debug with lauterbach + */ + if (!clk_enable(&apeatclk)) { +#ifdef CONFIG_UX500_DEBUG_NO_LAUTERBACH + clk_disable(&apeatclk); +#endif + } + if (!clk_enable(&apetraceclk)) { +#ifdef CONFIG_UX500_DEBUG_NO_LAUTERBACH + clk_disable(&apetraceclk); +#endif + } + return 0; +} +late_initcall(init_clock_states); + int __init db8500_clk_init(void) { if (cpu_is_u8500ed()) { @@ -1357,34 +1404,5 @@ int __init db8500_clk_init(void) if (cpu_is_u8500()) u8500_amba_clk_enable(); - /* - * 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); - if (cpu_is_u8500() && !ux500_is_svp()) - clk_enable(&p6_rng_clk); - - /* - * APEATCLK and APETRACECLK are enabled at boot and needed - * in order to debug with lauterbach - */ - clk_enable(&apeatclk); - clk_enable(&apetraceclk); -#ifdef CONFIG_UX500_DEBUG_NO_LAUTERBACH - clk_disable(&apeatclk); - clk_disable(&apetraceclk); -#endif - /* periph 7's clock is enabled at boot, but should be off */ - clk_enable(&per7clk); - clk_disable(&per7clk); - - /* the hsirx clock is enabled at boot, but should be off */ - clk_enable(&hsirxclk); - clk_disable(&hsirxclk); - return 0; } |