Skip to content

Commit 7e6a3d4

Browse files
Greg UngererLinus Torvalds
authored andcommitted
m68knommu: cleanup 68360 startup code
Clean up 68360 timer support code. Removed header includes not needed. Remove use of old m68knommu timer function pointers. Use common function naming for 68328 timer functions. Signed-off-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8467571 commit 7e6a3d4

File tree

1 file changed

+16
-35
lines changed

1 file changed

+16
-35
lines changed

arch/m68knommu/platform/68360/config.c

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
#include <linux/types.h>
1515
#include <linux/kernel.h>
1616
#include <linux/mm.h>
17-
#include <linux/tty.h>
18-
#include <linux/console.h>
1917
#include <linux/interrupt.h>
2018
#include <linux/irq.h>
2119

@@ -40,23 +38,31 @@ extern void m360_cpm_reset(void);
4038

4139
unsigned long int system_clock;
4240

43-
void M68360_init_IRQ(void);
44-
4541
extern QUICC *pquicc;
4642

4743
/* TODO DON"T Hard Code this */
4844
/* calculate properly using the right PLL and prescaller */
4945
// unsigned int system_clock = 33000000l;
5046
extern unsigned long int system_clock; //In kernel setup.c
5147

52-
extern void config_M68360_irq(void);
48+
49+
static irqreturn_t hw_tick(int irq, void *dummy)
50+
{
51+
/* Reset Timer1 */
52+
/* TSTAT &= 0; */
53+
54+
pquicc->timer_ter1 = 0x0002; /* clear timer event */
55+
56+
return arch_timer_interrupt(irq, dummy);
57+
}
5358

5459
static struct irqaction m68360_timer_irq = {
55-
.name = "timer",
56-
.flags = IRQF_DISABLED | IRQF_TIMER,
60+
.name = "timer",
61+
.flags = IRQF_DISABLED | IRQF_TIMER,
62+
.handler = hw_tick,
5763
};
5864

59-
void BSP_sched_init(irq_handler_t timer_routine)
65+
void hw_timer_init(void)
6066
{
6167
unsigned char prescaler;
6268
unsigned short tgcr_save;
@@ -90,24 +96,14 @@ void BSP_sched_init(irq_handler_t timer_routine)
9096
pquicc->timer_ter1 = 0x0003; /* clear timer events */
9197

9298
/* enable timer 1 interrupt in CIMR */
93-
m68360_timer_irq.handler = timer_routine;
9499
setup_irq(CPMVEC_TIMER1, &m68360_timer_irq);
95100

96101
/* Start timer 1: */
97102
tgcr_save = (pquicc->timer_tgcr & 0xfff0) | 0x0001;
98103
pquicc->timer_tgcr = tgcr_save;
99104
}
100105

101-
102-
void BSP_tick(void)
103-
{
104-
/* Reset Timer1 */
105-
/* TSTAT &= 0; */
106-
107-
pquicc->timer_ter1 = 0x0002; /* clear timer event */
108-
}
109-
110-
unsigned long BSP_gettimeoffset (void)
106+
unsigned long hw_timer_offset(void)
111107
{
112108
return 0;
113109
}
@@ -117,17 +113,7 @@ void BSP_gettod (int *yearp, int *monp, int *dayp,
117113
{
118114
}
119115

120-
int BSP_hwclk(int op, struct rtc_time *t)
121-
{
122-
if (!op) {
123-
/* read */
124-
} else {
125-
/* write */
126-
}
127-
return 0;
128-
}
129-
130-
int BSP_set_clock_mmss (unsigned long nowtime)
116+
int BSP_set_clock_mmss(unsigned long nowtime)
131117
{
132118
#if 0
133119
short real_seconds = nowtime % 60, real_minutes = (nowtime / 60) % 60;
@@ -200,11 +186,6 @@ void config_BSP(char *command, int len)
200186
scc1_hwaddr = "\00\01\02\03\04\05";
201187
#endif
202188

203-
mach_sched_init = BSP_sched_init;
204-
mach_tick = BSP_tick;
205-
mach_gettimeoffset = BSP_gettimeoffset;
206189
mach_gettod = BSP_gettod;
207-
mach_hwclk = NULL;
208-
mach_set_clock_mmss = NULL;
209190
mach_reset = BSP_reset;
210191
}

0 commit comments

Comments
 (0)