diff options
author | Graf Yang <graf.yang@analog.com> | 2009-05-15 07:01:59 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-06-12 06:11:37 -0400 |
commit | 1fa9be72b558c39459f98835eb86dbb4ef4da30b (patch) | |
tree | f0b71c7b7a3639285c64e3f3cbc449c3ff9eee3b /arch/blackfin/kernel/time.c | |
parent | 555487bbb63f527e63fecbff48c86e2c07ce5024 (diff) |
Blackfin: add support for gptimer0 as a tick source
For systems where the core cycles are not a usable tick source (like SMP
or cycles gets updated), enable gptimer0 as an alternative.
Signed-off-by: Graf Yang <graf.yang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel/time.c')
-rw-r--r-- | arch/blackfin/kernel/time.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c index 1bbacfbd4c5d..daa02d45f03d 100644 --- a/arch/blackfin/kernel/time.c +++ b/arch/blackfin/kernel/time.c | |||
@@ -31,7 +31,7 @@ static struct irqaction bfin_timer_irq = { | |||
31 | #endif | 31 | #endif |
32 | }; | 32 | }; |
33 | 33 | ||
34 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) | 34 | #if defined(CONFIG_TICKSOURCE_GPTMR0) || defined(CONFIG_IPIPE) |
35 | void __init setup_system_timer0(void) | 35 | void __init setup_system_timer0(void) |
36 | { | 36 | { |
37 | /* Power down the core timer, just to play safe. */ | 37 | /* Power down the core timer, just to play safe. */ |
@@ -74,7 +74,7 @@ void __init setup_core_timer(void) | |||
74 | static void __init | 74 | static void __init |
75 | time_sched_init(irqreturn_t(*timer_routine) (int, void *)) | 75 | time_sched_init(irqreturn_t(*timer_routine) (int, void *)) |
76 | { | 76 | { |
77 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) | 77 | #if defined(CONFIG_TICKSOURCE_GPTMR0) || defined(CONFIG_IPIPE) |
78 | setup_system_timer0(); | 78 | setup_system_timer0(); |
79 | bfin_timer_irq.handler = timer_routine; | 79 | bfin_timer_irq.handler = timer_routine; |
80 | setup_irq(IRQ_TIMER0, &bfin_timer_irq); | 80 | setup_irq(IRQ_TIMER0, &bfin_timer_irq); |
@@ -94,7 +94,7 @@ static unsigned long gettimeoffset(void) | |||
94 | unsigned long offset; | 94 | unsigned long offset; |
95 | unsigned long clocks_per_jiffy; | 95 | unsigned long clocks_per_jiffy; |
96 | 96 | ||
97 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE) | 97 | #if defined(CONFIG_TICKSOURCE_GPTMR0) || defined(CONFIG_IPIPE) |
98 | clocks_per_jiffy = bfin_read_TIMER0_PERIOD(); | 98 | clocks_per_jiffy = bfin_read_TIMER0_PERIOD(); |
99 | offset = bfin_read_TIMER0_COUNTER() / \ | 99 | offset = bfin_read_TIMER0_COUNTER() / \ |
100 | (((clocks_per_jiffy + 1) * HZ) / USEC_PER_SEC); | 100 | (((clocks_per_jiffy + 1) * HZ) / USEC_PER_SEC); |
@@ -133,7 +133,7 @@ irqreturn_t timer_interrupt(int irq, void *dummy) | |||
133 | static long last_rtc_update; | 133 | static long last_rtc_update; |
134 | 134 | ||
135 | write_seqlock(&xtime_lock); | 135 | write_seqlock(&xtime_lock); |
136 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE) | 136 | #if defined(CONFIG_TICKSOURCE_GPTMR0) && !defined(CONFIG_IPIPE) |
137 | /* | 137 | /* |
138 | * TIMIL0 is latched in __ipipe_grab_irq() when the I-Pipe is | 138 | * TIMIL0 is latched in __ipipe_grab_irq() when the I-Pipe is |
139 | * enabled. | 139 | * enabled. |
@@ -159,7 +159,7 @@ irqreturn_t timer_interrupt(int irq, void *dummy) | |||
159 | /* Do it again in 60s. */ | 159 | /* Do it again in 60s. */ |
160 | last_rtc_update = xtime.tv_sec - 600; | 160 | last_rtc_update = xtime.tv_sec - 600; |
161 | } | 161 | } |
162 | #if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE) | 162 | #if defined(CONFIG_TICKSOURCE_GPTMR0) && !defined(CONFIG_IPIPE) |
163 | set_gptimer_status(0, TIMER_STATUS_TIMIL0); | 163 | set_gptimer_status(0, TIMER_STATUS_TIMIL0); |
164 | } | 164 | } |
165 | #endif | 165 | #endif |