diff options
author | Greg Ungerer <gerg@snapgear.com> | 2007-10-23 14:37:54 +1000 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-23 08:32:35 -0700 |
commit | 2f2c2679893c963bd90c5e1c0669b97fd87d1c4a (patch) | |
tree | e999c52741b86aef2ad5bcb4ef4e1aeb44613f1d /arch/m68knommu/platform | |
parent | 49aa49bfd40d718095669c1c70c9d167b814e29b (diff) | |
download | talos-op-linux-2f2c2679893c963bd90c5e1c0669b97fd87d1c4a.tar.gz talos-op-linux-2f2c2679893c963bd90c5e1c0669b97fd87d1c4a.zip |
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/platform')
-rw-r--r-- | arch/m68knommu/platform/5206/config.c | 9 | ||||
-rw-r--r-- | arch/m68knommu/platform/5206e/config.c | 10 | ||||
-rw-r--r-- | arch/m68knommu/platform/520x/config.c | 8 | ||||
-rw-r--r-- | arch/m68knommu/platform/523x/config.c | 8 | ||||
-rw-r--r-- | arch/m68knommu/platform/5249/config.c | 10 | ||||
-rw-r--r-- | arch/m68knommu/platform/5272/config.c | 10 | ||||
-rw-r--r-- | arch/m68knommu/platform/527x/config.c | 8 | ||||
-rw-r--r-- | arch/m68knommu/platform/528x/config.c | 8 | ||||
-rw-r--r-- | arch/m68knommu/platform/5307/config.c | 10 | ||||
-rw-r--r-- | arch/m68knommu/platform/5307/pit.c | 15 | ||||
-rw-r--r-- | arch/m68knommu/platform/5307/timers.c | 19 | ||||
-rw-r--r-- | arch/m68knommu/platform/532x/config.c | 10 | ||||
-rw-r--r-- | arch/m68knommu/platform/5407/config.c | 10 |
13 files changed, 21 insertions, 114 deletions
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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcftimer.h> @@ -25,9 +22,6 @@ /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -97,9 +91,6 @@ int mcf_timerirqpending(int timer) void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; } 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> -#include <asm/mcftimer.h> #include <asm/mcfsim.h> #include <asm/mcfdma.h> /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -102,9 +95,6 @@ void config_BSP(char *commandp, int size) commandp[size-1] = 0; #endif /* CONFIG_NETtel */ - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; } 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]; /***************************************************************************/ -void coldfire_pit_tick(void); -void coldfire_pit_init(irq_handler_t handler); -unsigned long coldfire_pit_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -47,10 +44,7 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { - mach_sched_init = coldfire_pit_init; - mach_tick = coldfire_pit_tick; - mach_gettimeoffset = coldfire_pit_offset; - mach_reset = coldfire_reset; + mach_reset = coldfire_reset; } /***************************************************************************/ 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> @@ -26,9 +24,6 @@ /***************************************************************************/ -void coldfire_pit_tick(void); -void coldfire_pit_init(irq_handler_t handler); -unsigned long coldfire_pit_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -62,9 +57,6 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); - mach_sched_init = coldfire_pit_init; - mach_tick = coldfire_pit_tick; - mach_gettimeoffset = coldfire_pit_offset; mach_reset = coldfire_reset; } 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> -#include <asm/mcftimer.h> #include <asm/mcfsim.h> #include <asm/mcfdma.h> /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -95,9 +88,6 @@ int mcf_timerirqpending(int timer) void config_BSP(char *commandp, int size) { mcf_setimr(MCFSIM_IMR_MASKALL); - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; } 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> -#include <asm/mcftimer.h> #include <asm/mcfsim.h> #include <asm/mcfdma.h> /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); extern unsigned int mcf_timervector; @@ -128,9 +121,6 @@ void config_BSP(char *commandp, int size) mcf_timervector = 69; mcf_profilevector = 70; - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; } 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> @@ -26,9 +24,6 @@ /***************************************************************************/ -void coldfire_pit_tick(void); -void coldfire_pit_init(irq_handler_t handler); -unsigned long coldfire_pit_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -62,9 +57,6 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); - mach_sched_init = coldfire_pit_init; - mach_tick = coldfire_pit_tick; - mach_gettimeoffset = coldfire_pit_offset; mach_reset = coldfire_reset; } 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> #include <asm/mcfsim.h> @@ -26,9 +24,6 @@ /***************************************************************************/ -void coldfire_pit_tick(void); -void coldfire_pit_init(irq_handler_t handler); -unsigned long coldfire_pit_offset(void); void coldfire_reset(void); /***************************************************************************/ @@ -62,9 +57,6 @@ void mcf_autovector(unsigned int vec) void config_BSP(char *commandp, int size) { mcf_disableall(); - mach_sched_init = coldfire_pit_init; - mach_tick = coldfire_pit_tick; - mach_gettimeoffset = coldfire_pit_offset; mach_reset = coldfire_reset; } 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> -#include <asm/mcftimer.h> #include <asm/mcfsim.h> #include <asm/mcfdma.h> #include <asm/mcfwdebug.h> /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); extern unsigned int mcf_timervector; @@ -122,9 +115,6 @@ void config_BSP(char *commandp, int size) mcf_timerlevel = 6; #endif - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; #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 @@ #include <linux/init.h> #include <linux/interrupt.h> #include <linux/irq.h> +#include <asm/machdep.h> #include <asm/io.h> #include <asm/coldfire.h> #include <asm/mcfpit.h> @@ -31,28 +32,30 @@ /***************************************************************************/ -void coldfire_pit_tick(void) +static irqreturn_t hw_tick(int irq, void *dummy) { unsigned short pcsr; /* Reset the ColdFire timer */ pcsr = __raw_readw(TA(MCFPIT_PCSR)); __raw_writew(pcsr | MCFPIT_PCSR_PIF, TA(MCFPIT_PCSR)); + + return arch_timer_interrupt(irq, dummy); } /***************************************************************************/ static struct irqaction coldfire_pit_irq = { - .name = "timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .name = "timer", + .flags = IRQF_DISABLED | IRQF_TIMER, + .handler = hw_tick, }; -void coldfire_pit_init(irq_handler_t handler) +void hw_timer_init(void) { volatile unsigned char *icrp; volatile unsigned long *imrp; - coldfire_pit_irq.handler = handler; setup_irq(MCFINT_VECBASE + MCFINT_PIT1, &coldfire_pit_irq); icrp = (volatile unsigned char *) (MCF_IPSBAR + MCFICM_INTC0 + @@ -71,7 +74,7 @@ void coldfire_pit_init(irq_handler_t handler) /***************************************************************************/ -unsigned long coldfire_pit_offset(void) +unsigned long hw_timer_offset(void) { volatile unsigned long *ipr; 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 @@ /***************************************************************************/ #include <linux/kernel.h> +#include <linux/init.h> #include <linux/sched.h> -#include <linux/param.h> #include <linux/interrupt.h> -#include <linux/init.h> #include <linux/irq.h> #include <asm/io.h> #include <asm/traps.h> @@ -54,24 +53,28 @@ extern int mcf_timerirqpending(int timer); /***************************************************************************/ -void coldfire_tick(void) +static irqreturn_t hw_tick(int irq, void *dummy) { /* Reset the ColdFire timer */ __raw_writeb(MCFTIMER_TER_CAP | MCFTIMER_TER_REF, TA(MCFTIMER_TER)); + + return arch_timer_interrupt(irq, dummy); } /***************************************************************************/ static struct irqaction coldfire_timer_irq = { - .name = "timer", - .flags = IRQF_DISABLED | IRQF_TIMER, + .name = "timer", + .flags = IRQF_DISABLED | IRQF_TIMER, + .handler = hw_tick, }; +/***************************************************************************/ + static int ticks_per_intr; -void coldfire_timer_init(irq_handler_t handler) +void hw_timer_init(void) { - coldfire_timer_irq.handler = handler; setup_irq(mcf_timervector, &coldfire_timer_irq); __raw_writew(MCFTIMER_TMR_DISABLE, TA(MCFTIMER_TMR)); @@ -89,7 +92,7 @@ void coldfire_timer_init(irq_handler_t handler) /***************************************************************************/ -unsigned long coldfire_timer_offset(void) +unsigned long hw_timer_offset(void) { unsigned long tcn, offset; 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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> -#include <asm/mcftimer.h> #include <asm/mcfsim.h> #include <asm/mcfdma.h> #include <asm/mcfwdebug.h> /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); extern unsigned int mcf_timervector; @@ -104,9 +97,6 @@ void config_BSP(char *commandp, int size) mcf_timervector = 64+32; mcf_profilevector = 64+33; - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; #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 @@ /***************************************************************************/ #include <linux/kernel.h> -#include <linux/sched.h> #include <linux/param.h> #include <linux/init.h> #include <linux/interrupt.h> -#include <asm/irq.h> #include <asm/dma.h> -#include <asm/traps.h> #include <asm/machdep.h> #include <asm/coldfire.h> -#include <asm/mcftimer.h> #include <asm/mcfsim.h> #include <asm/mcfdma.h> /***************************************************************************/ -void coldfire_tick(void); -void coldfire_timer_init(irq_handler_t handler); -unsigned long coldfire_timer_offset(void); void coldfire_reset(void); extern unsigned int mcf_timervector; @@ -108,9 +101,6 @@ void config_BSP(char *commandp, int size) mcf_timerlevel = 6; #endif - mach_sched_init = coldfire_timer_init; - mach_tick = coldfire_tick; - mach_gettimeoffset = coldfire_timer_offset; mach_reset = coldfire_reset; } |