aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-iop/time.c
diff options
context:
space:
mode:
authorMikael Pettersson <mikpe@it.uu.se>2009-10-29 14:46:55 -0400
committerDan Williams <dan.j.williams@intel.com>2009-10-29 14:46:55 -0400
commit980f2296b5a8dfe589f023fd34229dcfdcf280fa (patch)
tree033746bf0eb178c0c86ddb365a0d93645c3e930f /arch/arm/plat-iop/time.c
parent469d30448dad13600cdd246024f9db8e80614c45 (diff)
iop: enable generic time
This updates the IOP platform to use the kernel's generic time framework. With clockevent support in place, this reduces to selecting GENERIC_TIME and removing the platform's private timer ->offset() operation (iop_gettimeoffset). Tested on n2100, compile-tested for all plat-iop machines. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'arch/arm/plat-iop/time.c')
-rw-r--r--arch/arm/plat-iop/time.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c
index a550e96394ab..aaaef3b4bc65 100644
--- a/arch/arm/plat-iop/time.c
+++ b/arch/arm/plat-iop/time.c
@@ -140,33 +140,6 @@ static void __init iop_clockevent_set_hz(struct clock_event_device *ce, unsigned
140 ce->name, ce->shift, ce->mult); 140 ce->name, ce->shift, ce->mult);
141} 141}
142 142
143static unsigned long ticks_per_usec;
144static unsigned long next_jiffy_time;
145
146unsigned long iop_gettimeoffset(void)
147{
148 unsigned long offset, temp;
149
150 /* enable cp6, if necessary, to avoid taking the overhead of an
151 * undefined instruction trap
152 */
153 asm volatile (
154 "mrc p15, 0, %0, c15, c1, 0\n\t"
155 "tst %0, #(1 << 6)\n\t"
156 "orreq %0, %0, #(1 << 6)\n\t"
157 "mcreq p15, 0, %0, c15, c1, 0\n\t"
158#ifdef CONFIG_CPU_XSCALE
159 "mrceq p15, 0, %0, c15, c1, 0\n\t"
160 "moveq %0, %0\n\t"
161 "subeq pc, pc, #4\n\t"
162#endif
163 : "=r"(temp) : : "cc");
164
165 offset = next_jiffy_time - read_tcr1();
166
167 return offset / ticks_per_usec;
168}
169
170static irqreturn_t 143static irqreturn_t
171iop_timer_interrupt(int irq, void *dev_id) 144iop_timer_interrupt(int irq, void *dev_id)
172{ 145{
@@ -196,8 +169,6 @@ void __init iop_init_time(unsigned long tick_rate)
196 u32 timer_ctl; 169 u32 timer_ctl;
197 170
198 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ); 171 ticks_per_jiffy = DIV_ROUND_CLOSEST(tick_rate, HZ);
199 ticks_per_usec = tick_rate / 1000000;
200 next_jiffy_time = 0xffffffff;
201 iop_tick_rate = tick_rate; 172 iop_tick_rate = tick_rate;
202 173
203 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED | 174 timer_ctl = IOP_TMR_EN | IOP_TMR_PRIVILEGED |