Merge branch 'for_3.7/omap5_arch_timer' of git://github.com/SantoshShilimkar/linux...
[linux-3.10.git] / arch / arm / mach-omap2 / timer.c
index 2c5a45d..a9c9b3d 100644 (file)
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/slab.h>
+#include <linux/of.h>
 
 #include <asm/mach/time.h>
-#include <plat/dmtimer.h>
 #include <asm/smp_twd.h>
 #include <asm/sched_clock.h>
+
 #include <asm/arch_timer.h>
-#include "common.h"
 #include <plat/omap_hwmod.h>
 #include <plat/omap_device.h>
+#include <plat/dmtimer.h>
 #include <plat/omap-pm.h>
 
+#include "soc.h"
+#include "common.h"
 #include "powerdomain.h"
 
 /* Parent clocks, eventually these will come from the clock framework */
@@ -464,8 +467,7 @@ OMAP_SYS_TIMER(3_am33xx)
 #ifdef CONFIG_ARCH_OMAP4
 #ifdef CONFIG_LOCAL_TIMERS
 static DEFINE_TWD_LOCAL_TIMER(twd_local_timer,
-                             OMAP44XX_LOCAL_TWD_BASE,
-                             OMAP44XX_IRQ_LOCALTIMER);
+                             OMAP44XX_LOCAL_TWD_BASE, 29 + OMAP_INTC_START);
 #endif
 
 static void __init omap4_timer_init(void)
@@ -477,6 +479,11 @@ static void __init omap4_timer_init(void)
        if (omap_rev() != OMAP4430_REV_ES1_0) {
                int err;
 
+               if (of_have_populated_dt()) {
+                       twd_local_timer_of_register();
+                       return;
+               }
+
                err = twd_local_timer_register(&twd_local_timer);
                if (err)
                        pr_err("twd_local_timer_register failed %d\n", err);