Commit a9d6d15131b0519363b0c94734ee80955c411093

Authored by Linus Walleij
Committed by Russell King
1 parent f9d4861fc3

ARM: 7310/1: integrator: implement sched_clock across all boards

Now that we can select a sched_clock at runtime, let's implement
it for the Integrator AP, default-select the one found in all
other board it for all plat-versatile boards and make the right
clock kick in at runtime.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

Showing 3 changed files with 9 additions and 1 deletions Side-by-side Diff

arch/arm/mach-integrator/Kconfig
... ... @@ -5,6 +5,7 @@
5 5 config ARCH_INTEGRATOR_AP
6 6 bool "Support Integrator/AP and Integrator/PP2 platforms"
7 7 select CLKSRC_MMIO
  8 + select HAVE_SCHED_CLOCK
8 9 select MIGHT_HAVE_PCI
9 10 select SERIAL_AMBA_PL010
10 11 select SERIAL_AMBA_PL010_CONSOLE
arch/arm/mach-integrator/integrator_ap.c
... ... @@ -42,6 +42,7 @@
42 42 #include <asm/setup.h>
43 43 #include <asm/param.h> /* HZ */
44 44 #include <asm/mach-types.h>
  45 +#include <asm/sched_clock.h>
45 46  
46 47 #include <mach/lm.h>
47 48  
... ... @@ -325,6 +326,11 @@
325 326  
326 327 static unsigned long timer_reload;
327 328  
  329 +static u32 notrace integrator_read_sched_clock(void)
  330 +{
  331 + return -readl((void __iomem *) TIMER2_VA_BASE + TIMER_VALUE);
  332 +}
  333 +
328 334 static void integrator_clocksource_init(unsigned long inrate)
329 335 {
330 336 void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
... ... @@ -341,6 +347,7 @@
341 347  
342 348 clocksource_mmio_init(base + TIMER_VALUE, "timer2",
343 349 rate, 200, 16, clocksource_mmio_readl_down);
  350 + setup_sched_clock(integrator_read_sched_clock, 16, rate);
344 351 }
345 352  
346 353 static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;
arch/arm/plat-versatile/Kconfig
... ... @@ -11,7 +11,7 @@
11 11 depends on ARCH_REALVIEW || ARCH_VERSATILE
12 12  
13 13 config PLAT_VERSATILE_SCHED_CLOCK
14   - def_bool y if !ARCH_INTEGRATOR_AP
  14 + def_bool y
15 15 select HAVE_SCHED_CLOCK
16 16  
17 17 endif