aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/time.c
diff options
context:
space:
mode:
authorYi Li <yi.li@analog.com>2009-01-07 10:14:39 -0500
committerBryan Wu <cooloney@kernel.org>2009-01-07 10:14:39 -0500
commit6a01f230339321292cf065551f8cf55361052461 (patch)
tree7ac2ac8fc9f05a7315ef6a7f6f0a387433c62c14 /arch/blackfin/kernel/time.c
parent5105432a3201e3f0e6c219cd0a74feee1e5e262b (diff)
Blackfin arch: merge adeos blackfin part to arch/blackfin/
[Mike Frysinger <vapier.adi@gmail.com>: - handle bf531/bf532/bf534/bf536 variants in ipipe.h - cleanup IPIPE logic for bfin_set_irq_handler() - cleanup ipipe asm code a bit and add missing ENDPROC() - simplify IPIPE code in trap_c - unify some of the IPIPE code and fix style - simplify DO_IRQ_L1 handling with ipipe code - revert IRQ_SW_INT# addition from ipipe merge - remove duplicate get_{c,s}clk() prototypes ] Signed-off-by: Yi Li <yi.li@analog.com> Signed-off-by: Mike Frysinger <vapier.adi@gmail.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin/kernel/time.c')
-rw-r--r--arch/blackfin/kernel/time.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/arch/blackfin/kernel/time.c b/arch/blackfin/kernel/time.c
index ec4dfa38eb0a..172b4c588467 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#ifdef CONFIG_TICK_SOURCE_SYSTMR0 34#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || defined(CONFIG_IPIPE)
35void __init setup_system_timer0(void) 35void __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)
74static void __init 74static void __init
75time_sched_init(irqreturn_t(*timer_routine) (int, void *)) 75time_sched_init(irqreturn_t(*timer_routine) (int, void *))
76{ 76{
77#ifdef CONFIG_TICK_SOURCE_SYSTMR0 77#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || 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#ifdef CONFIG_TICK_SOURCE_SYSTMR0 97#if defined(CONFIG_TICK_SOURCE_SYSTMR0) || 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,8 @@ 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#ifdef CONFIG_TICK_SOURCE_SYSTMR0 136#if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE)
137/* FIXME: Here TIMIL0 is not set when IPIPE enabled, why? */
137 if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) { 138 if (get_gptimer_status(0) & TIMER_STATUS_TIMIL0) {
138#endif 139#endif
139 do_timer(1); 140 do_timer(1);
@@ -155,13 +156,17 @@ irqreturn_t timer_interrupt(int irq, void *dummy)
155 /* Do it again in 60s. */ 156 /* Do it again in 60s. */
156 last_rtc_update = xtime.tv_sec - 600; 157 last_rtc_update = xtime.tv_sec - 600;
157 } 158 }
158#ifdef CONFIG_TICK_SOURCE_SYSTMR0 159#if defined(CONFIG_TICK_SOURCE_SYSTMR0) && !defined(CONFIG_IPIPE)
159 set_gptimer_status(0, TIMER_STATUS_TIMIL0); 160 set_gptimer_status(0, TIMER_STATUS_TIMIL0);
160 } 161 }
161#endif 162#endif
162 write_sequnlock(&xtime_lock); 163 write_sequnlock(&xtime_lock);
163 164
165#ifdef CONFIG_IPIPE
166 update_root_process_times(get_irq_regs());
167#else
164 update_process_times(user_mode(get_irq_regs())); 168 update_process_times(user_mode(get_irq_regs()));
169#endif
165 profile_tick(CPU_PROFILING); 170 profile_tick(CPU_PROFILING);
166 171
167 return IRQ_HANDLED; 172 return IRQ_HANDLED;