]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: plat-nomadik: MTU sched_clock as an option
authorMattias Wallin <mattias.wallin@stericsson.com>
Fri, 27 May 2011 08:29:25 +0000 (10:29 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 22 Sep 2011 13:42:33 +0000 (15:42 +0200)
This patch makes it possible to configure away the sched_clock
part of the MTU timer.

Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Jonas Aberg <jonas.aberg@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
arch/arm/plat-nomadik/Kconfig
arch/arm/plat-nomadik/timer.c

index ce659015535e4a86bc6e708fa3abcc2e59742ec0..bca4914b4b9dab344f19c6fd6eb84a084e91030d 100644 (file)
@@ -15,10 +15,16 @@ if PLAT_NOMADIK
 
 config HAS_MTU
        bool
-       select HAVE_SCHED_CLOCK
        help
          Support for Multi Timer Unit. MTU provides access
          to multiple interrupt generating programmable
          32-bit free running decrementing counters.
 
+config NOMADIK_MTU_SCHED_CLOCK
+       bool
+       depends on HAS_MTU
+       select HAVE_SCHED_CLOCK
+       help
+         Use the Multi Timer Unit as the sched_clock.
+
 endif
index ef74e157a9d5d0074e8b58d94863301603348624..bd638c552f04825e26f94c376913d44a6e474e92 100644 (file)
@@ -24,7 +24,7 @@
 #include <plat/mtu.h>
 
 void __iomem *mtu_base; /* Assigned by machine code */
-
+#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
 /*
  * Override the global weak sched_clock symbol with this
  * local implementation which uses the clocksource to get some
@@ -48,7 +48,7 @@ static void notrace nomadik_update_sched_clock(void)
        u32 cyc = -readl(mtu_base + MTU_VAL(0));
        update_sched_clock(&cd, cyc, (u32)~0);
 }
-
+#endif
 /* Clockevent device: use one-shot mode */
 static void nmdk_clkevt_mode(enum clock_event_mode mode,
                             struct clock_event_device *dev)
@@ -153,9 +153,9 @@ void __init nmdk_timer_init(void)
                        rate, 200, 32, clocksource_mmio_readl_down))
                pr_err("timer: failed to initialize clock source %s\n",
                       "mtu_0");
-
+#ifdef CONFIG_NOMADIK_MTU_SCHED_CLOCK
        init_sched_clock(&cd, nomadik_update_sched_clock, 32, rate);
-
+#endif
        /* Timer 1 is used for events */
 
        clockevents_calc_mult_shift(&nmdk_clkevt, rate, MTU_MIN_RANGE);