From f356a0b59447c8ecdf16a05a1d852eddb5328d3a Mon Sep 17 00:00:00 2001 From: Tony Lindgren Date: Thu, 9 Jun 2005 17:31:56 -0700 Subject: [PATCH] ARM: OMAP: Reset more bootloader clocks during early init Added omap_searly_clk_reset() that gets called before clocks are initialized. Another round of bootloader clock resets is still done after module inits are done. --- arch/arm/mach-omap/clock.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-omap/clock.c b/arch/arm/mach-omap/clock.c index c8e8a67a47f..e2a2ce64a51 100644 --- a/arch/arm/mach-omap/clock.c +++ b/arch/arm/mach-omap/clock.c @@ -1125,7 +1125,18 @@ void clk_unregister(struct clk *clk) } EXPORT_SYMBOL(clk_unregister); - +#ifdef CONFIG_OMAP_RESET_CLOCKS +/* + * Resets some clocks that may be left on from bootloader, + * but leaves serial clocks on. See also omap_late_clk_reset(). + */ +static inline void omap_early_clk_reset(void) +{ + omap_writel(0x3 << 29, MOD_CONF_CTRL_0); +} +#else +#define omap_early_clk_reset() {} +#endif int __init clk_init(void) { @@ -1133,6 +1144,8 @@ int __init clk_init(void) const struct omap_clock_config *info; int crystal_type = 0; /* Default 12 MHz */ + omap_early_clk_reset(); + for (clkp = onchip_clks; clkp < onchip_clks+ARRAY_SIZE(onchip_clks); clkp++) { if (((*clkp)->flags &CLOCK_IN_OMAP1510) && cpu_is_omap1510()) { clk_register(*clkp); @@ -1252,7 +1265,7 @@ int __init clk_init(void) #ifdef CONFIG_OMAP_RESET_CLOCKS -static int __init omap_clk_reset(void) +static int __init omap_late_clk_reset(void) { /* Turn off all unused clocks */ struct clk *p; @@ -1305,6 +1318,6 @@ static int __init omap_clk_reset(void) return 0; } -late_initcall(omap_clk_reset); +late_initcall(omap_late_clk_reset); #endif -- 2.41.1