Commit a9d6d15131b0519363b0c94734ee80955c411093
Committed by
Russell King
1 parent
f9d4861fc3
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
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
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; |