aboutsummaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--arch/arm/Kconfig1
-rw-r--r--arch/arm/include/asm/hardware/iop3xx.h1
-rw-r--r--arch/arm/mach-iop13xx/include/mach/time.h1
-rw-r--r--arch/arm/mach-iop13xx/iq81340mc.c1
-rw-r--r--arch/arm/mach-iop13xx/iq81340sc.c1
-rw-r--r--arch/arm/mach-iop32x/em7210.c1
-rw-r--r--arch/arm/mach-iop32x/glantank.c1
-rw-r--r--arch/arm/mach-iop32x/iq31244.c1
-rw-r--r--arch/arm/mach-iop32x/iq80321.c1
-rw-r--r--arch/arm/mach-iop32x/n2100.c1
-rw-r--r--arch/arm/mach-iop33x/iq80331.c1
-rw-r--r--arch/arm/mach-iop33x/iq80332.c1
-rw-r--r--arch/arm/plat-iop/time.c29
13 files changed, 1 insertions, 40 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index e732fcc30526..455284edda25 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -811,6 +811,7 @@ config ARCH_ACORN
811config PLAT_IOP 811config PLAT_IOP
812 bool 812 bool
813 select GENERIC_CLOCKEVENTS 813 select GENERIC_CLOCKEVENTS
814 select GENERIC_TIME
814 815
815config PLAT_ORION 816config PLAT_ORION
816 bool 817 bool
diff --git a/arch/arm/include/asm/hardware/iop3xx.h b/arch/arm/include/asm/hardware/iop3xx.h
index 34601b952045..5daea2961d48 100644
--- a/arch/arm/include/asm/hardware/iop3xx.h
+++ b/arch/arm/include/asm/hardware/iop3xx.h
@@ -234,7 +234,6 @@ extern int iop3xx_get_init_atu(void);
234void iop3xx_map_io(void); 234void iop3xx_map_io(void);
235void iop_init_cp6_handler(void); 235void iop_init_cp6_handler(void);
236void iop_init_time(unsigned long tickrate); 236void iop_init_time(unsigned long tickrate);
237unsigned long iop_gettimeoffset(void);
238 237
239static inline u32 read_tmr0(void) 238static inline u32 read_tmr0(void)
240{ 239{
diff --git a/arch/arm/mach-iop13xx/include/mach/time.h b/arch/arm/mach-iop13xx/include/mach/time.h
index b2fb17b35423..f1c00d6d560b 100644
--- a/arch/arm/mach-iop13xx/include/mach/time.h
+++ b/arch/arm/mach-iop13xx/include/mach/time.h
@@ -20,7 +20,6 @@
20#define IOP13XX_CORE_FREQ_1200 (5 << 16) 20#define IOP13XX_CORE_FREQ_1200 (5 << 16)
21 21
22void iop_init_time(unsigned long tickrate); 22void iop_init_time(unsigned long tickrate);
23unsigned long iop_gettimeoffset(void);
24 23
25static inline unsigned long iop13xx_core_freq(void) 24static inline unsigned long iop13xx_core_freq(void)
26{ 25{
diff --git a/arch/arm/mach-iop13xx/iq81340mc.c b/arch/arm/mach-iop13xx/iq81340mc.c
index 5051c03d437c..f91f3154577d 100644
--- a/arch/arm/mach-iop13xx/iq81340mc.c
+++ b/arch/arm/mach-iop13xx/iq81340mc.c
@@ -87,7 +87,6 @@ static void __init iq81340mc_timer_init(void)
87 87
88static struct sys_timer iq81340mc_timer = { 88static struct sys_timer iq81340mc_timer = {
89 .init = iq81340mc_timer_init, 89 .init = iq81340mc_timer_init,
90 .offset = iop_gettimeoffset,
91}; 90};
92 91
93MACHINE_START(IQ81340MC, "Intel IQ81340MC") 92MACHINE_START(IQ81340MC, "Intel IQ81340MC")
diff --git a/arch/arm/mach-iop13xx/iq81340sc.c b/arch/arm/mach-iop13xx/iq81340sc.c
index bc443073a8e3..ddb7a3435de9 100644
--- a/arch/arm/mach-iop13xx/iq81340sc.c
+++ b/arch/arm/mach-iop13xx/iq81340sc.c
@@ -89,7 +89,6 @@ static void __init iq81340sc_timer_init(void)
89 89
90static struct sys_timer iq81340sc_timer = { 90static struct sys_timer iq81340sc_timer = {
91 .init = iq81340sc_timer_init, 91 .init = iq81340sc_timer_init,
92 .offset = iop_gettimeoffset,
93}; 92};
94 93
95MACHINE_START(IQ81340SC, "Intel IQ81340SC") 94MACHINE_START(IQ81340SC, "Intel IQ81340SC")
diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c
index 3ad4696ade42..2bef9b6e1cc9 100644
--- a/arch/arm/mach-iop32x/em7210.c
+++ b/arch/arm/mach-iop32x/em7210.c
@@ -42,7 +42,6 @@ static void __init em7210_timer_init(void)
42 42
43static struct sys_timer em7210_timer = { 43static struct sys_timer em7210_timer = {
44 .init = em7210_timer_init, 44 .init = em7210_timer_init,
45 .offset = iop_gettimeoffset,
46}; 45};
47 46
48/* 47/*
diff --git a/arch/arm/mach-iop32x/glantank.c b/arch/arm/mach-iop32x/glantank.c
index a9c2dfdb2507..93370a46b620 100644
--- a/arch/arm/mach-iop32x/glantank.c
+++ b/arch/arm/mach-iop32x/glantank.c
@@ -47,7 +47,6 @@ static void __init glantank_timer_init(void)
47 47
48static struct sys_timer glantank_timer = { 48static struct sys_timer glantank_timer = {
49 .init = glantank_timer_init, 49 .init = glantank_timer_init,
50 .offset = iop_gettimeoffset,
51}; 50};
52 51
53 52
diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index dd1cd9904518..a7a08dda7f33 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -78,7 +78,6 @@ static void __init iq31244_timer_init(void)
78 78
79static struct sys_timer iq31244_timer = { 79static struct sys_timer iq31244_timer = {
80 .init = iq31244_timer_init, 80 .init = iq31244_timer_init,
81 .offset = iop_gettimeoffset,
82}; 81};
83 82
84 83
diff --git a/arch/arm/mach-iop32x/iq80321.c b/arch/arm/mach-iop32x/iq80321.c
index fbe27798759d..0200f80c1e17 100644
--- a/arch/arm/mach-iop32x/iq80321.c
+++ b/arch/arm/mach-iop32x/iq80321.c
@@ -46,7 +46,6 @@ static void __init iq80321_timer_init(void)
46 46
47static struct sys_timer iq80321_timer = { 47static struct sys_timer iq80321_timer = {
48 .init = iq80321_timer_init, 48 .init = iq80321_timer_init,
49 .offset = iop_gettimeoffset,
50}; 49};
51 50
52 51
diff --git a/arch/arm/mach-iop32x/n2100.c b/arch/arm/mach-iop32x/n2100.c
index d2e427899729..2a5c637639bb 100644
--- a/arch/arm/mach-iop32x/n2100.c
+++ b/arch/arm/mach-iop32x/n2100.c
@@ -53,7 +53,6 @@ static void __init n2100_timer_init(void)
53 53
54static struct sys_timer n2100_timer = { 54static struct sys_timer n2100_timer = {
55 .init = n2100_timer_init, 55 .init = n2100_timer_init,
56 .offset = iop_gettimeoffset,
57}; 56};
58 57
59 58
diff --git a/arch/arm/mach-iop33x/iq80331.c b/arch/arm/mach-iop33x/iq80331.c
index d51e10cddf20..394e95a30b75 100644
--- a/arch/arm/mach-iop33x/iq80331.c
+++ b/arch/arm/mach-iop33x/iq80331.c
@@ -48,7 +48,6 @@ static void __init iq80331_timer_init(void)
48 48
49static struct sys_timer iq80331_timer = { 49static struct sys_timer iq80331_timer = {
50 .init = iq80331_timer_init, 50 .init = iq80331_timer_init,
51 .offset = iop_gettimeoffset,
52}; 51};
53 52
54 53
diff --git a/arch/arm/mach-iop33x/iq80332.c b/arch/arm/mach-iop33x/iq80332.c
index 92fb44cdbcad..a40badf126c2 100644
--- a/arch/arm/mach-iop33x/iq80332.c
+++ b/arch/arm/mach-iop33x/iq80332.c
@@ -48,7 +48,6 @@ static void __init iq80332_timer_init(void)
48 48
49static struct sys_timer iq80332_timer = { 49static struct sys_timer iq80332_timer = {
50 .init = iq80332_timer_init, 50 .init = iq80332_timer_init,
51 .offset = iop_gettimeoffset,
52}; 51};
53 52
54 53
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 |