aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2007-10-23 00:37:54 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-23 11:32:35 -0400
commit2f2c2679893c963bd90c5e1c0669b97fd87d1c4a (patch)
treee999c52741b86aef2ad5bcb4ef4e1aeb44613f1d /arch/m68knommu
parent49aa49bfd40d718095669c1c70c9d167b814e29b (diff)
m68knommu: cleanup m68knommu timer code
Reduce the function pointer mess of the m68knommu timer code by calling directly to the local hardware's timer setup, and expose the local common timer interrupt handler to the lower level hardware timer. Ultimately this will save definitions of all these functions across all the platform code to setup the function pointers (which for any given m68knommu CPU family member can be only one set of hardware timer functions). Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/kernel/setup.c9
-rw-r--r--arch/m68knommu/kernel/time.c22
-rw-r--r--arch/m68knommu/platform/5206/config.c9
-rw-r--r--arch/m68knommu/platform/5206e/config.c10
-rw-r--r--arch/m68knommu/platform/520x/config.c8
-rw-r--r--arch/m68knommu/platform/523x/config.c8
-rw-r--r--arch/m68knommu/platform/5249/config.c10
-rw-r--r--arch/m68knommu/platform/5272/config.c10
-rw-r--r--arch/m68knommu/platform/527x/config.c8
-rw-r--r--arch/m68knommu/platform/528x/config.c8
-rw-r--r--arch/m68knommu/platform/5307/config.c10
-rw-r--r--arch/m68knommu/platform/5307/pit.c15
-rw-r--r--arch/m68knommu/platform/5307/timers.c19
-rw-r--r--arch/m68knommu/platform/532x/config.c10
-rw-r--r--arch/m68knommu/platform/5407/config.c10
15 files changed, 29 insertions, 137 deletions
diff --git a/arch/m68knommu/kernel/setup.c b/arch/m68knommu/kernel/setup.c
index de7732903763..74bf94948ec2 100644
--- a/arch/m68knommu/kernel/setup.c
+++ b/arch/m68knommu/kernel/setup.c
@@ -273,12 +273,3 @@ struct seq_operations cpuinfo_op = {
273 .show = show_cpuinfo, 273 .show = show_cpuinfo,
274}; 274};
275 275
276void arch_gettod(int *year, int *mon, int *day, int *hour,
277 int *min, int *sec)
278{
279 if (mach_gettod)
280 mach_gettod(year, mon, day, hour, min, sec);
281 else
282 *year = *mon = *day = *hour = *min = *sec = 0;
283}
284
diff --git a/arch/m68knommu/kernel/time.c b/arch/m68knommu/kernel/time.c
index 467053da2d08..77e5375a2dd5 100644
--- a/arch/m68knommu/kernel/time.c
+++ b/arch/m68knommu/kernel/time.c
@@ -27,7 +27,6 @@
27 27
28#define TICK_SIZE (tick_nsec / 1000) 28#define TICK_SIZE (tick_nsec / 1000)
29 29
30
31static inline int set_rtc_mmss(unsigned long nowtime) 30static inline int set_rtc_mmss(unsigned long nowtime)
32{ 31{
33 if (mach_set_clock_mmss) 32 if (mach_set_clock_mmss)
@@ -39,15 +38,11 @@ static inline int set_rtc_mmss(unsigned long nowtime)
39 * timer_interrupt() needs to keep up the real-time clock, 38 * timer_interrupt() needs to keep up the real-time clock,
40 * as well as call the "do_timer()" routine every clocktick 39 * as well as call the "do_timer()" routine every clocktick
41 */ 40 */
42static irqreturn_t timer_interrupt(int irq, void *dummy) 41irqreturn_t arch_timer_interrupt(int irq, void *dummy)
43{ 42{
44 /* last time the cmos clock got updated */ 43 /* last time the cmos clock got updated */
45 static long last_rtc_update=0; 44 static long last_rtc_update=0;
46 45
47 /* may need to kick the hardware timer */
48 if (mach_tick)
49 mach_tick();
50
51 write_seqlock(&xtime_lock); 46 write_seqlock(&xtime_lock);
52 47
53 do_timer(1); 48 do_timer(1);
@@ -103,10 +98,10 @@ void time_init(void)
103{ 98{
104 unsigned int year, mon, day, hour, min, sec; 99 unsigned int year, mon, day, hour, min, sec;
105 100
106 extern void arch_gettod(int *year, int *mon, int *day, int *hour, 101 if (mach_gettod)
107 int *min, int *sec); 102 mach_gettod(&year, &mon, &day, &hour, &min, &sec);
108 103 else
109 arch_gettod(&year, &mon, &day, &hour, &min, &sec); 104 year = mon = day = hour = min = sec = 0;
110 105
111 if ((year += 1900) < 1970) 106 if ((year += 1900) < 1970)
112 year += 100; 107 year += 100;
@@ -114,7 +109,7 @@ void time_init(void)
114 xtime.tv_nsec = 0; 109 xtime.tv_nsec = 0;
115 wall_to_monotonic.tv_sec = -xtime.tv_sec; 110 wall_to_monotonic.tv_sec = -xtime.tv_sec;
116 111
117 mach_sched_init(timer_interrupt); 112 hw_timer_init();
118} 113}
119 114
120/* 115/*
@@ -128,7 +123,7 @@ void do_gettimeofday(struct timeval *tv)
128 123
129 do { 124 do {
130 seq = read_seqbegin_irqsave(&xtime_lock, flags); 125 seq = read_seqbegin_irqsave(&xtime_lock, flags);
131 usec = mach_gettimeoffset ? mach_gettimeoffset() : 0; 126 usec = hw_timer_offset();
132 sec = xtime.tv_sec; 127 sec = xtime.tv_sec;
133 usec += (xtime.tv_nsec / 1000); 128 usec += (xtime.tv_nsec / 1000);
134 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); 129 } while (read_seqretry_irqrestore(&xtime_lock, seq, flags));
@@ -160,8 +155,7 @@ int do_settimeofday(struct timespec *tv)
160 * Discover what correction gettimeofday 155 * Discover what correction gettimeofday
161 * would have done, and then undo it! 156 * would have done, and then undo it!
162 */ 157 */
163 if (mach_gettimeoffset) 158 nsec -= (hw_timer_offset() * 1000);
164 nsec -= (mach_gettimeoffset() * 1000);
165 159
166 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); 160 wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec);
167 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); 161 wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec);
diff --git a/arch/m68knommu/platform/5206/config.c b/arch/m68knommu/platform/5206/config.c
index d0f2dc5cb5a1..b3c4dd4cc135 100644
--- a/arch/m68knommu/platform/5206/config.c
+++ b/arch/m68knommu/platform/5206/config.c
@@ -10,13 +10,10 @@
10/***************************************************************************/ 10/***************************************************************************/
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/param.h> 13#include <linux/param.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/interrupt.h> 15#include <linux/interrupt.h>
17#include <asm/irq.h>
18#include <asm/dma.h> 16#include <asm/dma.h>
19#include <asm/traps.h>
20#include <asm/machdep.h> 17#include <asm/machdep.h>
21#include <asm/coldfire.h> 18#include <asm/coldfire.h>
22#include <asm/mcftimer.h> 19#include <asm/mcftimer.h>
@@ -25,9 +22,6 @@
25 22
26/***************************************************************************/ 23/***************************************************************************/
27 24
28void coldfire_tick(void);
29void coldfire_timer_init(irq_handler_t handler);
30unsigned long coldfire_timer_offset(void);
31void coldfire_reset(void); 25void coldfire_reset(void);
32 26
33/***************************************************************************/ 27/***************************************************************************/
@@ -97,9 +91,6 @@ int mcf_timerirqpending(int timer)
97void config_BSP(char *commandp, int size) 91void config_BSP(char *commandp, int size)
98{ 92{
99 mcf_setimr(MCFSIM_IMR_MASKALL); 93 mcf_setimr(MCFSIM_IMR_MASKALL);
100 mach_sched_init = coldfire_timer_init;
101 mach_tick = coldfire_tick;
102 mach_gettimeoffset = coldfire_timer_offset;
103 mach_reset = coldfire_reset; 94 mach_reset = coldfire_reset;
104} 95}
105 96
diff --git a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c
index 425703fb6cee..f84a4aea8cb6 100644
--- a/arch/m68knommu/platform/5206e/config.c
+++ b/arch/m68knommu/platform/5206e/config.c
@@ -9,23 +9,16 @@
9/***************************************************************************/ 9/***************************************************************************/
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/sched.h>
13#include <linux/param.h> 12#include <linux/param.h>
14#include <linux/interrupt.h> 13#include <linux/interrupt.h>
15#include <asm/irq.h>
16#include <asm/dma.h> 14#include <asm/dma.h>
17#include <asm/traps.h>
18#include <asm/machdep.h> 15#include <asm/machdep.h>
19#include <asm/coldfire.h> 16#include <asm/coldfire.h>
20#include <asm/mcftimer.h>
21#include <asm/mcfsim.h> 17#include <asm/mcfsim.h>
22#include <asm/mcfdma.h> 18#include <asm/mcfdma.h>
23 19
24/***************************************************************************/ 20/***************************************************************************/
25 21
26void coldfire_tick(void);
27void coldfire_timer_init(irq_handler_t handler);
28unsigned long coldfire_timer_offset(void);
29void coldfire_reset(void); 22void coldfire_reset(void);
30 23
31/***************************************************************************/ 24/***************************************************************************/
@@ -102,9 +95,6 @@ void config_BSP(char *commandp, int size)
102 commandp[size-1] = 0; 95 commandp[size-1] = 0;
103#endif /* CONFIG_NETtel */ 96#endif /* CONFIG_NETtel */
104 97
105 mach_sched_init = coldfire_timer_init;
106 mach_tick = coldfire_tick;
107 mach_gettimeoffset = coldfire_timer_offset;
108 mach_reset = coldfire_reset; 98 mach_reset = coldfire_reset;
109} 99}
110 100
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c
index a2c95bebd004..6edbd41261cc 100644
--- a/arch/m68knommu/platform/520x/config.c
+++ b/arch/m68knommu/platform/520x/config.c
@@ -27,9 +27,6 @@ unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS];
27 27
28/***************************************************************************/ 28/***************************************************************************/
29 29
30void coldfire_pit_tick(void);
31void coldfire_pit_init(irq_handler_t handler);
32unsigned long coldfire_pit_offset(void);
33void coldfire_reset(void); 30void coldfire_reset(void);
34 31
35/***************************************************************************/ 32/***************************************************************************/
@@ -47,10 +44,7 @@ void mcf_autovector(unsigned int vec)
47 44
48void config_BSP(char *commandp, int size) 45void config_BSP(char *commandp, int size)
49{ 46{
50 mach_sched_init = coldfire_pit_init; 47 mach_reset = coldfire_reset;
51 mach_tick = coldfire_pit_tick;
52 mach_gettimeoffset = coldfire_pit_offset;
53 mach_reset = coldfire_reset;
54} 48}
55 49
56/***************************************************************************/ 50/***************************************************************************/
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c
index 0a3af05a434b..e7f80c8e8636 100644
--- a/arch/m68knommu/platform/523x/config.c
+++ b/arch/m68knommu/platform/523x/config.c
@@ -13,12 +13,10 @@
13/***************************************************************************/ 13/***************************************************************************/
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/param.h> 16#include <linux/param.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <asm/dma.h> 19#include <asm/dma.h>
21#include <asm/traps.h>
22#include <asm/machdep.h> 20#include <asm/machdep.h>
23#include <asm/coldfire.h> 21#include <asm/coldfire.h>
24#include <asm/mcfsim.h> 22#include <asm/mcfsim.h>
@@ -26,9 +24,6 @@
26 24
27/***************************************************************************/ 25/***************************************************************************/
28 26
29void coldfire_pit_tick(void);
30void coldfire_pit_init(irq_handler_t handler);
31unsigned long coldfire_pit_offset(void);
32void coldfire_reset(void); 27void coldfire_reset(void);
33 28
34/***************************************************************************/ 29/***************************************************************************/
@@ -62,9 +57,6 @@ void mcf_autovector(unsigned int vec)
62void config_BSP(char *commandp, int size) 57void config_BSP(char *commandp, int size)
63{ 58{
64 mcf_disableall(); 59 mcf_disableall();
65 mach_sched_init = coldfire_pit_init;
66 mach_tick = coldfire_pit_tick;
67 mach_gettimeoffset = coldfire_pit_offset;
68 mach_reset = coldfire_reset; 60 mach_reset = coldfire_reset;
69} 61}
70 62
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c
index dc2c362590c2..d4d39435cb15 100644
--- a/arch/m68knommu/platform/5249/config.c
+++ b/arch/m68knommu/platform/5249/config.c
@@ -9,24 +9,17 @@
9/***************************************************************************/ 9/***************************************************************************/
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/sched.h>
13#include <linux/param.h> 12#include <linux/param.h>
14#include <linux/init.h> 13#include <linux/init.h>
15#include <linux/interrupt.h> 14#include <linux/interrupt.h>
16#include <asm/irq.h>
17#include <asm/dma.h> 15#include <asm/dma.h>
18#include <asm/traps.h>
19#include <asm/machdep.h> 16#include <asm/machdep.h>
20#include <asm/coldfire.h> 17#include <asm/coldfire.h>
21#include <asm/mcftimer.h>
22#include <asm/mcfsim.h> 18#include <asm/mcfsim.h>
23#include <asm/mcfdma.h> 19#include <asm/mcfdma.h>
24 20
25/***************************************************************************/ 21/***************************************************************************/
26 22
27void coldfire_tick(void);
28void coldfire_timer_init(irq_handler_t handler);
29unsigned long coldfire_timer_offset(void);
30void coldfire_reset(void); 23void coldfire_reset(void);
31 24
32/***************************************************************************/ 25/***************************************************************************/
@@ -95,9 +88,6 @@ int mcf_timerirqpending(int timer)
95void config_BSP(char *commandp, int size) 88void config_BSP(char *commandp, int size)
96{ 89{
97 mcf_setimr(MCFSIM_IMR_MASKALL); 90 mcf_setimr(MCFSIM_IMR_MASKALL);
98 mach_sched_init = coldfire_timer_init;
99 mach_tick = coldfire_tick;
100 mach_gettimeoffset = coldfire_timer_offset;
101 mach_reset = coldfire_reset; 91 mach_reset = coldfire_reset;
102} 92}
103 93
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index 1365a8300d5d..634a6375e4a5 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -10,24 +10,17 @@
10/***************************************************************************/ 10/***************************************************************************/
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/param.h> 13#include <linux/param.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/interrupt.h> 15#include <linux/interrupt.h>
17#include <asm/irq.h>
18#include <asm/dma.h> 16#include <asm/dma.h>
19#include <asm/traps.h>
20#include <asm/machdep.h> 17#include <asm/machdep.h>
21#include <asm/coldfire.h> 18#include <asm/coldfire.h>
22#include <asm/mcftimer.h>
23#include <asm/mcfsim.h> 19#include <asm/mcfsim.h>
24#include <asm/mcfdma.h> 20#include <asm/mcfdma.h>
25 21
26/***************************************************************************/ 22/***************************************************************************/
27 23
28void coldfire_tick(void);
29void coldfire_timer_init(irq_handler_t handler);
30unsigned long coldfire_timer_offset(void);
31void coldfire_reset(void); 24void coldfire_reset(void);
32 25
33extern unsigned int mcf_timervector; 26extern unsigned int mcf_timervector;
@@ -128,9 +121,6 @@ void config_BSP(char *commandp, int size)
128 121
129 mcf_timervector = 69; 122 mcf_timervector = 69;
130 mcf_profilevector = 70; 123 mcf_profilevector = 70;
131 mach_sched_init = coldfire_timer_init;
132 mach_tick = coldfire_tick;
133 mach_gettimeoffset = coldfire_timer_offset;
134 mach_reset = coldfire_reset; 124 mach_reset = coldfire_reset;
135} 125}
136 126
diff --git a/arch/m68knommu/platform/527x/config.c b/arch/m68knommu/platform/527x/config.c
index 1b820441419a..9cbfbc68ae4f 100644
--- a/arch/m68knommu/platform/527x/config.c
+++ b/arch/m68knommu/platform/527x/config.c
@@ -13,12 +13,10 @@
13/***************************************************************************/ 13/***************************************************************************/
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/param.h> 16#include <linux/param.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <asm/dma.h> 19#include <asm/dma.h>
21#include <asm/traps.h>
22#include <asm/machdep.h> 20#include <asm/machdep.h>
23#include <asm/coldfire.h> 21#include <asm/coldfire.h>
24#include <asm/mcfsim.h> 22#include <asm/mcfsim.h>
@@ -26,9 +24,6 @@
26 24
27/***************************************************************************/ 25/***************************************************************************/
28 26
29void coldfire_pit_tick(void);
30void coldfire_pit_init(irq_handler_t handler);
31unsigned long coldfire_pit_offset(void);
32void coldfire_reset(void); 27void coldfire_reset(void);
33 28
34/***************************************************************************/ 29/***************************************************************************/
@@ -62,9 +57,6 @@ void mcf_autovector(unsigned int vec)
62void config_BSP(char *commandp, int size) 57void config_BSP(char *commandp, int size)
63{ 58{
64 mcf_disableall(); 59 mcf_disableall();
65 mach_sched_init = coldfire_pit_init;
66 mach_tick = coldfire_pit_tick;
67 mach_gettimeoffset = coldfire_pit_offset;
68 mach_reset = coldfire_reset; 60 mach_reset = coldfire_reset;
69} 61}
70 62
diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c
index a089e9513699..acbd43486d97 100644
--- a/arch/m68knommu/platform/528x/config.c
+++ b/arch/m68knommu/platform/528x/config.c
@@ -13,12 +13,10 @@
13/***************************************************************************/ 13/***************************************************************************/
14 14
15#include <linux/kernel.h> 15#include <linux/kernel.h>
16#include <linux/sched.h>
17#include <linux/param.h> 16#include <linux/param.h>
18#include <linux/init.h> 17#include <linux/init.h>
19#include <linux/interrupt.h> 18#include <linux/interrupt.h>
20#include <asm/dma.h> 19#include <asm/dma.h>
21#include <asm/traps.h>
22#include <asm/machdep.h> 20#include <asm/machdep.h>
23#include <asm/coldfire.h> 21#include <asm/coldfire.h>
24#include <asm/mcfsim.h> 22#include <asm/mcfsim.h>
@@ -26,9 +24,6 @@
26 24
27/***************************************************************************/ 25/***************************************************************************/
28 26
29void coldfire_pit_tick(void);
30void coldfire_pit_init(irq_handler_t handler);
31unsigned long coldfire_pit_offset(void);
32void coldfire_reset(void); 27void coldfire_reset(void);
33 28
34/***************************************************************************/ 29/***************************************************************************/
@@ -62,9 +57,6 @@ void mcf_autovector(unsigned int vec)
62void config_BSP(char *commandp, int size) 57void config_BSP(char *commandp, int size)
63{ 58{
64 mcf_disableall(); 59 mcf_disableall();
65 mach_sched_init = coldfire_pit_init;
66 mach_tick = coldfire_pit_tick;
67 mach_gettimeoffset = coldfire_pit_offset;
68 mach_reset = coldfire_reset; 60 mach_reset = coldfire_reset;
69} 61}
70 62
diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c
index e3461619fd65..6040821e637d 100644
--- a/arch/m68knommu/platform/5307/config.c
+++ b/arch/m68knommu/platform/5307/config.c
@@ -10,25 +10,18 @@
10/***************************************************************************/ 10/***************************************************************************/
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/param.h> 13#include <linux/param.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/interrupt.h> 15#include <linux/interrupt.h>
17#include <asm/irq.h>
18#include <asm/dma.h> 16#include <asm/dma.h>
19#include <asm/traps.h>
20#include <asm/machdep.h> 17#include <asm/machdep.h>
21#include <asm/coldfire.h> 18#include <asm/coldfire.h>
22#include <asm/mcftimer.h>
23#include <asm/mcfsim.h> 19#include <asm/mcfsim.h>
24#include <asm/mcfdma.h> 20#include <asm/mcfdma.h>
25#include <asm/mcfwdebug.h> 21#include <asm/mcfwdebug.h>
26 22
27/***************************************************************************/ 23/***************************************************************************/
28 24
29void coldfire_tick(void);
30void coldfire_timer_init(irq_handler_t handler);
31unsigned long coldfire_timer_offset(void);
32void coldfire_reset(void); 25void coldfire_reset(void);
33 26
34extern unsigned int mcf_timervector; 27extern unsigned int mcf_timervector;
@@ -122,9 +115,6 @@ void config_BSP(char *commandp, int size)
122 mcf_timerlevel = 6; 115 mcf_timerlevel = 6;
123#endif 116#endif
124 117
125 mach_sched_init = coldfire_timer_init;
126 mach_tick = coldfire_tick;
127 mach_gettimeoffset = coldfire_timer_offset;
128 mach_reset = coldfire_reset; 118 mach_reset = coldfire_reset;
129 119
130#ifdef MCF_BDM_DISABLE 120#ifdef MCF_BDM_DISABLE
diff --git a/arch/m68knommu/platform/5307/pit.c b/arch/m68knommu/platform/5307/pit.c
index f18352fa35a6..173b754d1cda 100644
--- a/arch/m68knommu/platform/5307/pit.c
+++ b/arch/m68knommu/platform/5307/pit.c
@@ -17,6 +17,7 @@
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/interrupt.h> 18#include <linux/interrupt.h>
19#include <linux/irq.h> 19#include <linux/irq.h>
20#include <asm/machdep.h>
20#include <asm/io.h> 21#include <asm/io.h>
21#include <asm/coldfire.h> 22#include <asm/coldfire.h>
22#include <asm/mcfpit.h> 23#include <asm/mcfpit.h>
@@ -31,28 +32,30 @@
31 32
32/***************************************************************************/ 33/***************************************************************************/
33 34
34void coldfire_pit_tick(void) 35static irqreturn_t hw_tick(int irq, void *dummy)
35{ 36{
36 unsigned short pcsr; 37 unsigned short pcsr;
37 38
38 /* Reset the ColdFire timer */ 39 /* Reset the ColdFire timer */
39 pcsr = __raw_readw(TA(MCFPIT_PCSR)); 40 pcsr = __raw_readw(TA(MCFPIT_PCSR));
40 __raw_writew(pcsr | MCFPIT_PCSR_PIF, TA(MCFPIT_PCSR)); 41 __raw_writew(pcsr | MCFPIT_PCSR_PIF, TA(MCFPIT_PCSR));
42
43 return arch_timer_interrupt(irq, dummy);
41} 44}
42 45
43/***************************************************************************/ 46/***************************************************************************/
44 47
45static struct irqaction coldfire_pit_irq = { 48static struct irqaction coldfire_pit_irq = {
46 .name = "timer", 49 .name = "timer",
47 .flags = IRQF_DISABLED | IRQF_TIMER, 50 .flags = IRQF_DISABLED | IRQF_TIMER,
51 .handler = hw_tick,
48}; 52};
49 53
50void coldfire_pit_init(irq_handler_t handler) 54void hw_timer_init(void)
51{ 55{
52 volatile unsigned char *icrp; 56 volatile unsigned char *icrp;
53 volatile unsigned long *imrp; 57 volatile unsigned long *imrp;
54 58
55 coldfire_pit_irq.handler = handler;
56 setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &coldfire_pit_irq); 59 setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &coldfire_pit_irq);
57 60
58 icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + 61 icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 +
@@ -71,7 +74,7 @@ void coldfire_pit_init(irq_handler_t handler)
71 74
72/***************************************************************************/ 75/***************************************************************************/
73 76
74unsigned long coldfire_pit_offset(void) 77unsigned long hw_timer_offset(void)
75{ 78{
76 volatile unsigned long *ipr; 79 volatile unsigned long *ipr;
77 unsigned long pmr, pcntr, offset; 80 unsigned long pmr, pcntr, offset;
diff --git a/arch/m68knommu/platform/5307/timers.c b/arch/m68knommu/platform/5307/timers.c
index 64bd0ff9029e..489dec85c859 100644
--- a/arch/m68knommu/platform/5307/timers.c
+++ b/arch/m68knommu/platform/5307/timers.c
@@ -9,10 +9,9 @@
9/***************************************************************************/ 9/***************************************************************************/
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/init.h>
12#include <linux/sched.h> 13#include <linux/sched.h>
13#include <linux/param.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <linux/init.h>
16#include <linux/irq.h> 15#include <linux/irq.h>
17#include <asm/io.h> 16#include <asm/io.h>
18#include <asm/traps.h> 17#include <asm/traps.h>
@@ -54,24 +53,28 @@ extern int mcf_timerirqpending(int timer);
54 53
55/***************************************************************************/ 54/***************************************************************************/
56 55
57void coldfire_tick(void) 56static irqreturn_t hw_tick(int irq, void *dummy)
58{ 57{
59 /* Reset the ColdFire timer */ 58 /* Reset the ColdFire timer */
60 __raw_writeb(MCFTIMER_TER_CAP | MCFTIMER_TER_REF, TA(MCFTIMER_TER)); 59 __raw_writeb(MCFTIMER_TER_CAP | MCFTIMER_TER_REF, TA(MCFTIMER_TER));
60
61 return arch_timer_interrupt(irq, dummy);
61} 62}
62 63
63/***************************************************************************/ 64/***************************************************************************/
64 65
65static struct irqaction coldfire_timer_irq = { 66static struct irqaction coldfire_timer_irq = {
66 .name = "timer", 67 .name = "timer",
67 .flags = IRQF_DISABLED | IRQF_TIMER, 68 .flags = IRQF_DISABLED | IRQF_TIMER,
69 .handler = hw_tick,
68}; 70};
69 71
72/***************************************************************************/
73
70static int ticks_per_intr; 74static int ticks_per_intr;
71 75
72void coldfire_timer_init(irq_handler_t handler) 76void hw_timer_init(void)
73{ 77{
74 coldfire_timer_irq.handler = handler;
75 setup_irq(mcf_timervector, &coldfire_timer_irq); 78 setup_irq(mcf_timervector, &coldfire_timer_irq);
76 79
77 __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR)); 80 __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR));
@@ -89,7 +92,7 @@ void coldfire_timer_init(irq_handler_t handler)
89 92
90/***************************************************************************/ 93/***************************************************************************/
91 94
92unsigned long coldfire_timer_offset(void) 95unsigned long hw_timer_offset(void)
93{ 96{
94 unsigned long tcn, offset; 97 unsigned long tcn, offset;
95 98
diff --git a/arch/m68knommu/platform/532x/config.c b/arch/m68knommu/platform/532x/config.c
index b32c6425f821..f77328b7b6db 100644
--- a/arch/m68knommu/platform/532x/config.c
+++ b/arch/m68knommu/platform/532x/config.c
@@ -18,25 +18,18 @@
18/***************************************************************************/ 18/***************************************************************************/
19 19
20#include <linux/kernel.h> 20#include <linux/kernel.h>
21#include <linux/sched.h>
22#include <linux/param.h> 21#include <linux/param.h>
23#include <linux/init.h> 22#include <linux/init.h>
24#include <linux/interrupt.h> 23#include <linux/interrupt.h>
25#include <asm/irq.h>
26#include <asm/dma.h> 24#include <asm/dma.h>
27#include <asm/traps.h>
28#include <asm/machdep.h> 25#include <asm/machdep.h>
29#include <asm/coldfire.h> 26#include <asm/coldfire.h>
30#include <asm/mcftimer.h>
31#include <asm/mcfsim.h> 27#include <asm/mcfsim.h>
32#include <asm/mcfdma.h> 28#include <asm/mcfdma.h>
33#include <asm/mcfwdebug.h> 29#include <asm/mcfwdebug.h>
34 30
35/***************************************************************************/ 31/***************************************************************************/
36 32
37void coldfire_tick(void);
38void coldfire_timer_init(irq_handler_t handler);
39unsigned long coldfire_timer_offset(void);
40void coldfire_reset(void); 33void coldfire_reset(void);
41 34
42extern unsigned int mcf_timervector; 35extern unsigned int mcf_timervector;
@@ -104,9 +97,6 @@ void config_BSP(char *commandp, int size)
104 97
105 mcf_timervector = 64+32; 98 mcf_timervector = 64+32;
106 mcf_profilevector = 64+33; 99 mcf_profilevector = 64+33;
107 mach_sched_init = coldfire_timer_init;
108 mach_tick = coldfire_tick;
109 mach_gettimeoffset = coldfire_timer_offset;
110 mach_reset = coldfire_reset; 100 mach_reset = coldfire_reset;
111 101
112#ifdef MCF_BDM_DISABLE 102#ifdef MCF_BDM_DISABLE
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c
index e692536817d8..2d3b62eba7ca 100644
--- a/arch/m68knommu/platform/5407/config.c
+++ b/arch/m68knommu/platform/5407/config.c
@@ -10,24 +10,17 @@
10/***************************************************************************/ 10/***************************************************************************/
11 11
12#include <linux/kernel.h> 12#include <linux/kernel.h>
13#include <linux/sched.h>
14#include <linux/param.h> 13#include <linux/param.h>
15#include <linux/init.h> 14#include <linux/init.h>
16#include <linux/interrupt.h> 15#include <linux/interrupt.h>
17#include <asm/irq.h>
18#include <asm/dma.h> 16#include <asm/dma.h>
19#include <asm/traps.h>
20#include <asm/machdep.h> 17#include <asm/machdep.h>
21#include <asm/coldfire.h> 18#include <asm/coldfire.h>
22#include <asm/mcftimer.h>
23#include <asm/mcfsim.h> 19#include <asm/mcfsim.h>
24#include <asm/mcfdma.h> 20#include <asm/mcfdma.h>
25 21
26/***************************************************************************/ 22/***************************************************************************/
27 23
28void coldfire_tick(void);
29void coldfire_timer_init(irq_handler_t handler);
30unsigned long coldfire_timer_offset(void);
31void coldfire_reset(void); 24void coldfire_reset(void);
32 25
33extern unsigned int mcf_timervector; 26extern unsigned int mcf_timervector;
@@ -108,9 +101,6 @@ void config_BSP(char *commandp, int size)
108 mcf_timerlevel = 6; 101 mcf_timerlevel = 6;
109#endif 102#endif
110 103
111 mach_sched_init = coldfire_timer_init;
112 mach_tick = coldfire_tick;
113 mach_gettimeoffset = coldfire_timer_offset;
114 mach_reset = coldfire_reset; 104 mach_reset = coldfire_reset;
115} 105}
116 106