ARM: OMAP4: Add local timer support for Device Tree
authorSantosh Shilimkar <santosh.shilimkar@ti.com>
Wed, 4 Jul 2012 13:02:32 +0000 (18:32 +0530)
committerBenoit Cousson <b-cousson@ti.com>
Fri, 7 Sep 2012 17:18:43 +0000 (19:18 +0200)
Add cortex-a9 local timer support for all OMAP4 based
SOCs using DT.

Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Benoit Cousson <b-cousson@ti.com>
arch/arm/boot/dts/omap4.dtsi
arch/arm/mach-omap2/timer.c

index cb18d2a2971cad2b42aa42d3e0b8296e1406c83d..2b670ab86eae37363f650878051c24ff0b2c77c9 100644 (file)
                cache-level = <2>;
        };
 
+       local-timer@0x48240600 {
+               compatible = "arm,cortex-a9-twd-timer";
+               reg = <0x48240600 0x20>;
+               interrupts = <1 13 0x304>;
+       };
+
        /*
         * The soc node represents the soc top level view. It is uses for IPs
         * that are not memory mapped in the MPU view or for the MPU itself.
index 2ff6d41ec6c6c004ace041b525ec1821d6389653..31f9c936125fd186d5fc647a601c3017cc91c2d6 100644 (file)
@@ -36,6 +36,7 @@
 #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>
@@ -386,6 +387,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);