diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-11-28 20:03:35 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-12-29 07:35:55 -0500 |
commit | 6cefe92f2991c2bcd8f3a16faa9f4e3c91be48f2 (patch) | |
tree | 1c7d462d06d651137c9c823f049da77c58d0ee18 /arch/arm/mach-footbridge | |
parent | e68f31f4520ea5d1ddbcaddb320ef0b4201eef3c (diff) |
ARM: footbridge: add sched_clock implementation
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-footbridge')
-rw-r--r-- | arch/arm/mach-footbridge/common.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/dc21285-timer.c | 17 | ||||
-rw-r--r-- | arch/arm/mach-footbridge/ebsa285.c | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/mach-footbridge/common.h b/arch/arm/mach-footbridge/common.h index 56607b3a773e..b911e5587ecf 100644 --- a/arch/arm/mach-footbridge/common.h +++ b/arch/arm/mach-footbridge/common.h | |||
@@ -10,3 +10,5 @@ extern void footbridge_init_irq(void); | |||
10 | 10 | ||
11 | extern void isa_init_irq(unsigned int irq); | 11 | extern void isa_init_irq(unsigned int irq); |
12 | extern void footbridge_restart(enum reboot_mode, const char *); | 12 | extern void footbridge_restart(enum reboot_mode, const char *); |
13 | |||
14 | extern void footbridge_sched_clock(void); | ||
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 @@ | |||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/interrupt.h> | 10 | #include <linux/interrupt.h> |
11 | #include <linux/irq.h> | 11 | #include <linux/irq.h> |
12 | #include <linux/sched_clock.h> | ||
12 | 13 | ||
13 | #include <asm/irq.h> | 14 | #include <asm/irq.h> |
14 | 15 | ||
@@ -104,3 +105,19 @@ void __init footbridge_timer_init(void) | |||
104 | ce->cpumask = cpumask_of(smp_processor_id()); | 105 | ce->cpumask = cpumask_of(smp_processor_id()); |
105 | clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff); | 106 | clockevents_config_and_register(ce, mem_fclk_21285, 0x4, 0xffffff); |
106 | } | 107 | } |
108 | |||
109 | static u32 notrace footbridge_read_sched_clock(void) | ||
110 | { | ||
111 | return ~*CSR_TIMER3_VALUE; | ||
112 | } | ||
113 | |||
114 | void __init footbridge_sched_clock(void) | ||
115 | { | ||
116 | unsigned rate = DIV_ROUND_CLOSEST(mem_fclk_21285, 16); | ||
117 | |||
118 | *CSR_TIMER3_LOAD = 0; | ||
119 | *CSR_TIMER3_CLR = 0; | ||
120 | *CSR_TIMER3_CNTL = TIMER_CNTL_ENABLE | TIMER_CNTL_DIV16; | ||
121 | |||
122 | setup_sched_clock(footbridge_read_sched_clock, 24, rate); | ||
123 | } | ||
diff --git a/arch/arm/mach-footbridge/ebsa285.c b/arch/arm/mach-footbridge/ebsa285.c index 1a7235fb52ac..3ff7a0c30a0f 100644 --- a/arch/arm/mach-footbridge/ebsa285.c +++ b/arch/arm/mach-footbridge/ebsa285.c | |||
@@ -104,6 +104,7 @@ MACHINE_START(EBSA285, "EBSA285") | |||
104 | .video_start = 0x000a0000, | 104 | .video_start = 0x000a0000, |
105 | .video_end = 0x000bffff, | 105 | .video_end = 0x000bffff, |
106 | .map_io = footbridge_map_io, | 106 | .map_io = footbridge_map_io, |
107 | .init_early = footbridge_sched_clock, | ||
107 | .init_irq = footbridge_init_irq, | 108 | .init_irq = footbridge_init_irq, |
108 | .init_time = footbridge_timer_init, | 109 | .init_time = footbridge_timer_init, |
109 | .restart = footbridge_restart, | 110 | .restart = footbridge_restart, |