aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/time.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/kernel/time.c')
-rw-r--r--arch/arc/kernel/time.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/arc/kernel/time.c b/arch/arc/kernel/time.c
index 09f4309aa2c0..0e51e69cf30d 100644
--- a/arch/arc/kernel/time.c
+++ b/arch/arc/kernel/time.c
@@ -44,13 +44,24 @@
44#include <asm/clk.h> 44#include <asm/clk.h>
45#include <asm/mach_desc.h> 45#include <asm/mach_desc.h>
46 46
47/* Timer related Aux registers */
48#define ARC_REG_TIMER0_LIMIT 0x23 /* timer 0 limit */
49#define ARC_REG_TIMER0_CTRL 0x22 /* timer 0 control */
50#define ARC_REG_TIMER0_CNT 0x21 /* timer 0 count */
51#define ARC_REG_TIMER1_LIMIT 0x102 /* timer 1 limit */
52#define ARC_REG_TIMER1_CTRL 0x101 /* timer 1 control */
53#define ARC_REG_TIMER1_CNT 0x100 /* timer 1 count */
54
55#define TIMER_CTRL_IE (1 << 0) /* Interupt when Count reachs limit */
56#define TIMER_CTRL_NH (1 << 1) /* Count only when CPU NOT halted */
57
47#define ARC_TIMER_MAX 0xFFFFFFFF 58#define ARC_TIMER_MAX 0xFFFFFFFF
48 59
49/********** Clock Source Device *********/ 60/********** Clock Source Device *********/
50 61
51#ifdef CONFIG_ARC_HAS_RTSC 62#ifdef CONFIG_ARC_HAS_RTSC
52 63
53int __cpuinit arc_counter_setup(void) 64int arc_counter_setup(void)
54{ 65{
55 /* RTSC insn taps into cpu clk, needs no setup */ 66 /* RTSC insn taps into cpu clk, needs no setup */
56 67
@@ -105,7 +116,7 @@ static bool is_usable_as_clocksource(void)
105/* 116/*
106 * set 32bit TIMER1 to keep counting monotonically and wraparound 117 * set 32bit TIMER1 to keep counting monotonically and wraparound
107 */ 118 */
108int __cpuinit arc_counter_setup(void) 119int arc_counter_setup(void)
109{ 120{
110 write_aux_reg(ARC_REG_TIMER1_LIMIT, ARC_TIMER_MAX); 121 write_aux_reg(ARC_REG_TIMER1_LIMIT, ARC_TIMER_MAX);
111 write_aux_reg(ARC_REG_TIMER1_CNT, 0); 122 write_aux_reg(ARC_REG_TIMER1_CNT, 0);
@@ -212,7 +223,7 @@ static struct irqaction arc_timer_irq = {
212 * Setup the local event timer for @cpu 223 * Setup the local event timer for @cpu
213 * N.B. weak so that some exotic ARC SoCs can completely override it 224 * N.B. weak so that some exotic ARC SoCs can completely override it
214 */ 225 */
215void __attribute__((weak)) __cpuinit arc_local_timer_setup(unsigned int cpu) 226void __attribute__((weak)) arc_local_timer_setup(unsigned int cpu)
216{ 227{
217 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu); 228 struct clock_event_device *clk = &per_cpu(arc_clockevent_device, cpu);
218 229