diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-11-29 01:03:35 +0000 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-12-29 12:35:55 +0000 |
commit | 6cefe92f2991c2bcd8f3a16faa9f4e3c91be48f2 (patch) | |
tree | 1c7d462d06d651137c9c823f049da77c58d0ee18 /arch/arm/mach-footbridge/dc21285-timer.c | |
parent | e68f31f4520ea5d1ddbcaddb320ef0b4201eef3c (diff) | |
download | blackbird-op-linux-6cefe92f2991c2bcd8f3a16faa9f4e3c91be48f2.tar.gz blackbird-op-linux-6cefe92f2991c2bcd8f3a16faa9f4e3c91be48f2.zip |
ARM: footbridge: add sched_clock implementation
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-footbridge/dc21285-timer.c')
-rw-r--r-- | arch/arm/mach-footbridge/dc21285-timer.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/mach-footbridge/dc21285-timer.c b/arch/arm/mach-footbridge/dc21285-timer.c index 9ee78f7b4990..785e4199f9cd 100644 --- a/arch/arm/mach-footbridge/dc21285-timer.c +++ b/arch/arm/mach-footbridge/dc21285-timer.c @@ -9,6 +9,7 @@ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <linux/sched_clock.h> #include <asm/irq.h> @@ -104,3 +105,19 @@ void __init footbridge_timer_init(void) ce->cpumask = cpumask_of(smp_processor_id()); clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff); } + +static u32 notrace footbridge_read_sched_clock(void) +{ + return ~*CSR_TIMER3_VALUE; +} + +void __init footbridge_sched_clock(void) +{ + unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16); + + *CSR_TIMER3_LOAD = 0; + *CSR_TIMER3_CLR = 0; + *CSR_TIMER3_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_DIV16; + + setup_sched_clock(footbridge_read_sched_clock, 24, rate); +} |