aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/m68knommu/platform/68328/timers.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/arch/m68knommu/platform/68328/timers.c b/arch/m68knommu/platform/68328/timers.c
index 0396476f955d..04cbc661d4bd 100644
--- a/arch/m68knommu/platform/68328/timers.c
+++ b/arch/m68knommu/platform/68328/timers.c
@@ -53,18 +53,28 @@
53 53
54/***************************************************************************/ 54/***************************************************************************/
55 55
56static irqreturn_t hw_tick(int irq, void *dummy)
57{
58 /* Reset Timer1 */
59 TSTAT &= 0;
60
61 return arch_timer_interrupt(irq, dummy);
62}
63
64/***************************************************************************/
65
56static struct irqaction m68328_timer_irq = { 66static struct irqaction m68328_timer_irq = {
57 .name = "timer", 67 .name = "timer",
58 .flags = IRQF_DISABLED | IRQF_TIMER, 68 .flags = IRQF_DISABLED | IRQF_TIMER,
69 .handler = hw_tick,
59}; 70};
60 71
61void m68328_timer_init(irq_handler_t timer_routine) 72void hw_timer_init(void)
62{ 73{
63 /* disable timer 1 */ 74 /* disable timer 1 */
64 TCTL = 0; 75 TCTL = 0;
65 76
66 /* set ISR */ 77 /* set ISR */
67 m68328_timer_irq.handler = timer_routine;
68 setup_irq(TMR_IRQ_NUM, &m68328_timer_irq); 78 setup_irq(TMR_IRQ_NUM, &m68328_timer_irq);
69 79
70 /* Restart mode, Enable int, Set clock source */ 80 /* Restart mode, Enable int, Set clock source */
@@ -78,14 +88,7 @@ void m68328_timer_init(irq_handler_t timer_routine)
78 88
79/***************************************************************************/ 89/***************************************************************************/
80 90
81void m68328_timer_tick(void) 91unsigned long hw_timer_offset(void)
82{
83 /* Reset Timer1 */
84 TSTAT &= 0;
85}
86/***************************************************************************/
87
88unsigned long m68328_timer_gettimeoffset(void)
89{ 92{
90 unsigned long ticks = TCN, offset = 0; 93 unsigned long ticks = TCN, offset = 0;
91 94