diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2009-10-29 14:46:55 -0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-10-29 14:46:55 -0400 |
commit | 980f2296b5a8dfe589f023fd34229dcfdcf280fa (patch) | |
tree | 033746bf0eb178c0c86ddb365a0d93645c3e930f /arch/arm | |
parent | 469d30448dad13600cdd246024f9db8e80614c45 (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')
-rw-r--r-- | arch/arm/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/include/asm/hardware/iop3xx.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop13xx/include/mach/time.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop13xx/iq81340mc.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop13xx/iq81340sc.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/em7210.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/glantank.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/iq31244.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/iq80321.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop32x/n2100.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop33x/iq80331.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-iop33x/iq80332.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-iop/time.c | 29 |
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 | |||
811 | config PLAT_IOP | 811 | config PLAT_IOP |
812 | bool | 812 | bool |
813 | select GENERIC_CLOCKEVENTS | 813 | select GENERIC_CLOCKEVENTS |
814 | select GENERIC_TIME | ||
814 | 815 | ||
815 | config PLAT_ORION | 816 | config 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); | |||
234 | void iop3xx_map_io(void); | 234 | void iop3xx_map_io(void); |
235 | void iop_init_cp6_handler(void); | 235 | void iop_init_cp6_handler(void); |
236 | void iop_init_time(unsigned long tickrate); | 236 | void iop_init_time(unsigned long tickrate); |
237 | unsigned long iop_gettimeoffset(void); | ||
238 | 237 | ||
239 | static inline u32 read_tmr0(void) | 238 | static 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 | ||
22 | void iop_init_time(unsigned long tickrate); | 22 | void iop_init_time(unsigned long tickrate); |
23 | unsigned long iop_gettimeoffset(void); | ||
24 | 23 | ||
25 | static inline unsigned long iop13xx_core_freq(void) | 24 | static 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 | ||
88 | static struct sys_timer iq81340mc_timer = { | 88 | static struct sys_timer iq81340mc_timer = { |
89 | .init = iq81340mc_timer_init, | 89 | .init = iq81340mc_timer_init, |
90 | .offset = iop_gettimeoffset, | ||
91 | }; | 90 | }; |
92 | 91 | ||
93 | MACHINE_START(IQ81340MC, "Intel IQ81340MC") | 92 | MACHINE_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 | ||
90 | static struct sys_timer iq81340sc_timer = { | 90 | static struct sys_timer iq81340sc_timer = { |
91 | .init = iq81340sc_timer_init, | 91 | .init = iq81340sc_timer_init, |
92 | .offset = iop_gettimeoffset, | ||
93 | }; | 92 | }; |
94 | 93 | ||
95 | MACHINE_START(IQ81340SC, "Intel IQ81340SC") | 94 | MACHINE_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 | ||
43 | static struct sys_timer em7210_timer = { | 43 | static 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 | ||
48 | static struct sys_timer glantank_timer = { | 48 | static 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 | ||
79 | static struct sys_timer iq31244_timer = { | 79 | static 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 | ||
47 | static struct sys_timer iq80321_timer = { | 47 | static 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 | ||
54 | static struct sys_timer n2100_timer = { | 54 | static 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 | ||
49 | static struct sys_timer iq80331_timer = { | 49 | static 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 | ||
49 | static struct sys_timer iq80332_timer = { | 49 | static 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 | ||
143 | static unsigned long ticks_per_usec; | ||
144 | static unsigned long next_jiffy_time; | ||
145 | |||
146 | unsigned 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 | |||
170 | static irqreturn_t | 143 | static irqreturn_t |
171 | iop_timer_interrupt(int irq, void *dev_id) | 144 | iop_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 | |