]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ARM: versatile: use OF init for sp804 timer
authorRob Herring <rob.herring@calxeda.com>
Wed, 13 Mar 2013 22:07:44 +0000 (17:07 -0500)
committerRob Herring <rob.herring@calxeda.com>
Thu, 11 Apr 2013 20:11:21 +0000 (15:11 -0500)
Enable DT based init for the sp804 timers on versatile DT platform.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
arch/arm/boot/dts/versatile-ab.dts
arch/arm/mach-versatile/core.c
arch/arm/mach-versatile/versatile_dt.c

index e2fe3195c0d109c6a31853455171627724c2e2d8..dde75ae8b4b10a071c80f3b79ec0f0d0a2f9e060 100644 (file)
                        interrupts = <0>;
                };
 
+               timer@101e2000 {
+                       compatible = "arm,sp804", "arm,primecell";
+                       reg = <0x101e2000 0x1000>;
+                       interrupts = <4>;
+               };
+
+               timer@101e3000 {
+                       compatible = "arm,sp804", "arm,primecell";
+                       reg = <0x101e3000 0x1000>;
+                       interrupts = <5>;
+               };
+
                gpio0: gpio@101e4000 {
                        compatible = "arm,pl061", "arm,primecell";
                        reg = <0x101e4000 0x1000>;
index 25160aeaa3b7fe30b9e0cd26cc5e5449b444ca5f..54bb80b012aceca7fdf925fd249b96abda646ece 100644 (file)
@@ -749,12 +749,25 @@ void versatile_restart(char mode, const char *cmd)
 /* Early initializations */
 void __init versatile_init_early(void)
 {
+       u32 val;
        void __iomem *sys = __io_address(VERSATILE_SYS_BASE);
 
        osc4_clk.vcoreg = sys + VERSATILE_SYS_OSCCLCD_OFFSET;
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
        versatile_sched_clock_init(sys + VERSATILE_SYS_24MHz_OFFSET, 24000000);
+
+       /*
+        * set clock frequency:
+        *      VERSATILE_REFCLK is 32KHz
+        *      VERSATILE_TIMCLK is 1MHz
+        */
+       val = readl(__io_address(VERSATILE_SCTL_BASE));
+       writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
+              (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) |
+              (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
+              (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
+              __io_address(VERSATILE_SCTL_BASE));
 }
 
 void __init versatile_init(void)
@@ -785,19 +798,6 @@ void __init versatile_init(void)
  */
 void __init versatile_timer_init(void)
 {
-       u32 val;
-
-       /* 
-        * set clock frequency: 
-        *      VERSATILE_REFCLK is 32KHz
-        *      VERSATILE_TIMCLK is 1MHz
-        */
-       val = readl(__io_address(VERSATILE_SCTL_BASE));
-       writel((VERSATILE_TIMCLK << VERSATILE_TIMER1_EnSel) |
-              (VERSATILE_TIMCLK << VERSATILE_TIMER2_EnSel) | 
-              (VERSATILE_TIMCLK << VERSATILE_TIMER3_EnSel) |
-              (VERSATILE_TIMCLK << VERSATILE_TIMER4_EnSel) | val,
-              __io_address(VERSATILE_SCTL_BASE));
 
        /*
         * Initialise to a known state (all timers off)
index 2558f2e957c37cb63f32d1efd8c2d487e3add7b7..3621b000a0f6ea04ce2d0de62ed5ffde114003d0 100644 (file)
@@ -45,7 +45,6 @@ DT_MACHINE_START(VERSATILE_PB, "ARM-Versatile (Device Tree Support)")
        .map_io         = versatile_map_io,
        .init_early     = versatile_init_early,
        .init_irq       = versatile_init_irq,
-       .init_time      = versatile_timer_init,
        .init_machine   = versatile_dt_init,
        .dt_compat      = versatile_dt_match,
        .restart        = versatile_restart,