Skip to content

Commit a9d6d15

Browse files
linuswRussell King
authored andcommitted
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 <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent f9d4861 commit a9d6d15

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

arch/arm/mach-integrator/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ menu "Integrator Options"
55
config ARCH_INTEGRATOR_AP
66
bool "Support Integrator/AP and Integrator/PP2 platforms"
77
select CLKSRC_MMIO
8+
select HAVE_SCHED_CLOCK
89
select MIGHT_HAVE_PCI
910
select SERIAL_AMBA_PL010
1011
select SERIAL_AMBA_PL010_CONSOLE

arch/arm/mach-integrator/integrator_ap.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <asm/setup.h>
4343
#include <asm/param.h> /* HZ */
4444
#include <asm/mach-types.h>
45+
#include <asm/sched_clock.h>
4546

4647
#include <mach/lm.h>
4748

@@ -325,6 +326,11 @@ static void __init ap_init(void)
325326

326327
static unsigned long timer_reload;
327328

329+
static u32 notrace integrator_read_sched_clock(void)
330+
{
331+
return -readl((void __iomem *) TIMER2_VA_BASE + TIMER_VALUE);
332+
}
333+
328334
static void integrator_clocksource_init(unsigned long inrate)
329335
{
330336
void __iomem *base = (void __iomem *)TIMER2_VA_BASE;
@@ -341,6 +347,7 @@ static void integrator_clocksource_init(unsigned long inrate)
341347

342348
clocksource_mmio_init(base + TIMER_VALUE, "timer2",
343349
rate, 200, 16, clocksource_mmio_readl_down);
350+
setup_sched_clock(integrator_read_sched_clock, 16, rate);
344351
}
345352

346353
static void __iomem * const clkevt_base = (void __iomem *)TIMER1_VA_BASE;

arch/arm/plat-versatile/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config PLAT_VERSATILE_LEDS
1111
depends on ARCH_REALVIEW || ARCH_VERSATILE
1212

1313
config PLAT_VERSATILE_SCHED_CLOCK
14-
def_bool y if !ARCH_INTEGRATOR_AP
14+
def_bool y
1515
select HAVE_SCHED_CLOCK
1616

1717
endif

0 commit comments

Comments
 (0)