aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-tegra/timer.c
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2011-02-21 20:04:37 -0500
committerColin Cross <ccross@android.com>2011-02-22 17:48:27 -0500
commit62248ae826f51ac2e3d3902c0a657043d95b731c (patch)
treeb548a9107602f615d996b75aa40141cb2c8697bc /arch/arm/mach-tegra/timer.c
parent0cf6230af909a86f81907455eca2a5c9b8f68fe6 (diff)
ARM: tegra: timer: Enable timer and rtc clocks
Enable the timer and rtc clocks to prevent them being turned off by the bootloader clock disabling code. Signed-off-by: Colin Cross <ccross@android.com> Acked-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch/arm/mach-tegra/timer.c')
-rw-r--r--arch/arm/mach-tegra/timer.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/arm/mach-tegra/timer.c b/arch/arm/mach-tegra/timer.c
index ffa6a6859746..0fcb1eb4214d 100644
--- a/arch/arm/mach-tegra/timer.c
+++ b/arch/arm/mach-tegra/timer.c
@@ -18,6 +18,7 @@
18 */ 18 */
19 19
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/err.h>
21#include <linux/sched.h> 22#include <linux/sched.h>
22#include <linux/time.h> 23#include <linux/time.h>
23#include <linux/interrupt.h> 24#include <linux/interrupt.h>
@@ -193,9 +194,22 @@ static struct irqaction tegra_timer_irq = {
193 194
194static void __init tegra_init_timer(void) 195static void __init tegra_init_timer(void)
195{ 196{
197 struct clk *clk;
196 unsigned long rate = clk_measure_input_freq(); 198 unsigned long rate = clk_measure_input_freq();
197 int ret; 199 int ret;
198 200
201 clk = clk_get_sys("timer", NULL);
202 BUG_ON(IS_ERR(clk));
203 clk_enable(clk);
204
205 /*
206 * rtc registers are used by read_persistent_clock, keep the rtc clock
207 * enabled
208 */
209 clk = clk_get_sys("rtc-tegra", NULL);
210 BUG_ON(IS_ERR(clk));
211 clk_enable(clk);
212
199#ifdef CONFIG_HAVE_ARM_TWD 213#ifdef CONFIG_HAVE_ARM_TWD
200 twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600); 214 twd_base = IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x600);
201#endif 215#endif
@@ -239,8 +253,6 @@ static void __init tegra_init_timer(void)
239 tegra_clockevent.cpumask = cpu_all_mask; 253 tegra_clockevent.cpumask = cpu_all_mask;
240 tegra_clockevent.irq = tegra_timer_irq.irq; 254 tegra_clockevent.irq = tegra_timer_irq.irq;
241 clockevents_register_device(&tegra_clockevent); 255 clockevents_register_device(&tegra_clockevent);
242
243 return;
244} 256}
245 257
246struct sys_timer tegra_timer = { 258struct sys_timer tegra_timer = {