diff options
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/apollo/config.c | 24 | ||||
-rw-r--r-- | arch/m68k/apollo/dn_ints.c | 137 |
2 files changed, 33 insertions, 128 deletions
diff --git a/arch/m68k/apollo/config.c b/arch/m68k/apollo/config.c index d401962d9b25..99c70978aafa 100644 --- a/arch/m68k/apollo/config.c +++ b/arch/m68k/apollo/config.c | |||
@@ -28,11 +28,6 @@ u_long apollo_model; | |||
28 | 28 | ||
29 | extern void dn_sched_init(irqreturn_t (*handler)(int,void *,struct pt_regs *)); | 29 | extern void dn_sched_init(irqreturn_t (*handler)(int,void *,struct pt_regs *)); |
30 | extern void dn_init_IRQ(void); | 30 | extern void dn_init_IRQ(void); |
31 | extern int dn_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id); | ||
32 | extern void dn_free_irq(unsigned int irq, void *dev_id); | ||
33 | extern void dn_enable_irq(unsigned int); | ||
34 | extern void dn_disable_irq(unsigned int); | ||
35 | extern int show_dn_interrupts(struct seq_file *, void *); | ||
36 | extern unsigned long dn_gettimeoffset(void); | 31 | extern unsigned long dn_gettimeoffset(void); |
37 | extern int dn_dummy_hwclk(int, struct rtc_time *); | 32 | extern int dn_dummy_hwclk(int, struct rtc_time *); |
38 | extern int dn_dummy_set_clock_mmss(unsigned long); | 33 | extern int dn_dummy_set_clock_mmss(unsigned long); |
@@ -40,13 +35,11 @@ extern void dn_dummy_reset(void); | |||
40 | extern void dn_dummy_waitbut(void); | 35 | extern void dn_dummy_waitbut(void); |
41 | extern struct fb_info *dn_fb_init(long *); | 36 | extern struct fb_info *dn_fb_init(long *); |
42 | extern void dn_dummy_debug_init(void); | 37 | extern void dn_dummy_debug_init(void); |
43 | extern void dn_dummy_video_setup(char *,int *); | ||
44 | extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp); | 38 | extern irqreturn_t dn_process_int(int irq, struct pt_regs *fp); |
45 | #ifdef CONFIG_HEARTBEAT | 39 | #ifdef CONFIG_HEARTBEAT |
46 | static void dn_heartbeat(int on); | 40 | static void dn_heartbeat(int on); |
47 | #endif | 41 | #endif |
48 | static irqreturn_t dn_timer_int(int irq,void *, struct pt_regs *); | 42 | static irqreturn_t dn_timer_int(int irq,void *, struct pt_regs *); |
49 | static irqreturn_t (*sched_timer_handler)(int, void *, struct pt_regs *)=NULL; | ||
50 | static void dn_get_model(char *model); | 43 | static void dn_get_model(char *model); |
51 | static const char *apollo_models[] = { | 44 | static const char *apollo_models[] = { |
52 | [APOLLO_DN3000-APOLLO_DN3000] = "DN3000 (Otter)", | 45 | [APOLLO_DN3000-APOLLO_DN3000] = "DN3000 (Otter)", |
@@ -164,17 +157,10 @@ void config_apollo(void) { | |||
164 | 157 | ||
165 | mach_sched_init=dn_sched_init; /* */ | 158 | mach_sched_init=dn_sched_init; /* */ |
166 | mach_init_IRQ=dn_init_IRQ; | 159 | mach_init_IRQ=dn_init_IRQ; |
167 | mach_default_handler=NULL; | ||
168 | mach_request_irq = dn_request_irq; | ||
169 | mach_free_irq = dn_free_irq; | ||
170 | enable_irq = dn_enable_irq; | ||
171 | disable_irq = dn_disable_irq; | ||
172 | mach_get_irq_list = show_dn_interrupts; | ||
173 | mach_gettimeoffset = dn_gettimeoffset; | 160 | mach_gettimeoffset = dn_gettimeoffset; |
174 | mach_max_dma_address = 0xffffffff; | 161 | mach_max_dma_address = 0xffffffff; |
175 | mach_hwclk = dn_dummy_hwclk; /* */ | 162 | mach_hwclk = dn_dummy_hwclk; /* */ |
176 | mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ | 163 | mach_set_clock_mmss = dn_dummy_set_clock_mmss; /* */ |
177 | mach_process_int = dn_process_int; | ||
178 | mach_reset = dn_dummy_reset; /* */ | 164 | mach_reset = dn_dummy_reset; /* */ |
179 | #ifdef CONFIG_HEARTBEAT | 165 | #ifdef CONFIG_HEARTBEAT |
180 | mach_heartbeat = dn_heartbeat; | 166 | mach_heartbeat = dn_heartbeat; |
@@ -189,11 +175,13 @@ void config_apollo(void) { | |||
189 | 175 | ||
190 | } | 176 | } |
191 | 177 | ||
192 | irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) { | 178 | irqreturn_t dn_timer_int(int irq, void *dev_id, struct pt_regs *fp) |
179 | { | ||
180 | irqreturn_t (*timer_handler)(int, void *, struct pt_regs *) = dev_id; | ||
193 | 181 | ||
194 | volatile unsigned char x; | 182 | volatile unsigned char x; |
195 | 183 | ||
196 | sched_timer_handler(irq,dev_id,fp); | 184 | timer_handler(irq, dev_id, fp); |
197 | 185 | ||
198 | x=*(volatile unsigned char *)(timer+3); | 186 | x=*(volatile unsigned char *)(timer+3); |
199 | x=*(volatile unsigned char *)(timer+5); | 187 | x=*(volatile unsigned char *)(timer+5); |
@@ -217,9 +205,7 @@ void dn_sched_init(irqreturn_t (*timer_routine)(int, void *, struct pt_regs *)) | |||
217 | printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3)); | 205 | printk("*(0x10803) %02x\n",*(volatile unsigned char *)(timer+0x3)); |
218 | #endif | 206 | #endif |
219 | 207 | ||
220 | sched_timer_handler=timer_routine; | 208 | request_irq(IRQ_APOLLO, dn_timer_int, 0, "time", timer_routine); |
221 | request_irq(0,dn_timer_int,0,NULL,NULL); | ||
222 | |||
223 | } | 209 | } |
224 | 210 | ||
225 | unsigned long dn_gettimeoffset(void) { | 211 | unsigned long dn_gettimeoffset(void) { |
diff --git a/arch/m68k/apollo/dn_ints.c b/arch/m68k/apollo/dn_ints.c index a31259359a12..9fe07803797b 100644 --- a/arch/m68k/apollo/dn_ints.c +++ b/arch/m68k/apollo/dn_ints.c | |||
@@ -1,125 +1,44 @@ | |||
1 | #include <linux/types.h> | 1 | #include <linux/interrupt.h> |
2 | #include <linux/kernel.h> | ||
3 | #include <linux/jiffies.h> | ||
4 | #include <linux/kernel_stat.h> | ||
5 | #include <linux/timer.h> | ||
6 | 2 | ||
7 | #include <asm/system.h> | ||
8 | #include <asm/irq.h> | 3 | #include <asm/irq.h> |
9 | #include <asm/traps.h> | 4 | #include <asm/traps.h> |
10 | #include <asm/page.h> | ||
11 | #include <asm/machdep.h> | ||
12 | #include <asm/apollohw.h> | 5 | #include <asm/apollohw.h> |
13 | #include <asm/errno.h> | ||
14 | 6 | ||
15 | static irq_handler_t dn_irqs[16]; | 7 | void dn_process_int(unsigned int irq, struct pt_regs *fp) |
16 | |||
17 | irqreturn_t dn_process_int(int irq, struct pt_regs *fp) | ||
18 | { | 8 | { |
19 | irqreturn_t res = IRQ_NONE; | 9 | m68k_handle_int(irq, fp); |
20 | |||
21 | if(dn_irqs[irq-160].handler) { | ||
22 | res = dn_irqs[irq-160].handler(irq,dn_irqs[irq-160].dev_id,fp); | ||
23 | } else { | ||
24 | printk("spurious irq %d occurred\n",irq); | ||
25 | } | ||
26 | |||
27 | *(volatile unsigned char *)(pica)=0x20; | ||
28 | *(volatile unsigned char *)(picb)=0x20; | ||
29 | |||
30 | return res; | ||
31 | } | ||
32 | |||
33 | void dn_init_IRQ(void) { | ||
34 | |||
35 | int i; | ||
36 | |||
37 | for(i=0;i<16;i++) { | ||
38 | dn_irqs[i].handler=NULL; | ||
39 | dn_irqs[i].flags=IRQ_FLG_STD; | ||
40 | dn_irqs[i].dev_id=NULL; | ||
41 | dn_irqs[i].devname=NULL; | ||
42 | } | ||
43 | |||
44 | } | ||
45 | |||
46 | int dn_request_irq(unsigned int irq, irqreturn_t (*handler)(int, void *, struct pt_regs *), unsigned long flags, const char *devname, void *dev_id) { | ||
47 | |||
48 | if((irq<0) || (irq>15)) { | ||
49 | printk("Trying to request invalid IRQ\n"); | ||
50 | return -ENXIO; | ||
51 | } | ||
52 | |||
53 | if(!dn_irqs[irq].handler) { | ||
54 | dn_irqs[irq].handler=handler; | ||
55 | dn_irqs[irq].flags=IRQ_FLG_STD; | ||
56 | dn_irqs[irq].dev_id=dev_id; | ||
57 | dn_irqs[irq].devname=devname; | ||
58 | if(irq<8) | ||
59 | *(volatile unsigned char *)(pica+1)&=~(1<<irq); | ||
60 | else | ||
61 | *(volatile unsigned char *)(picb+1)&=~(1<<(irq-8)); | ||
62 | |||
63 | return 0; | ||
64 | } | ||
65 | else { | ||
66 | printk("Trying to request already assigned irq %d\n",irq); | ||
67 | return -ENXIO; | ||
68 | } | ||
69 | |||
70 | } | ||
71 | |||
72 | void dn_free_irq(unsigned int irq, void *dev_id) { | ||
73 | |||
74 | if((irq<0) || (irq>15)) { | ||
75 | printk("Trying to free invalid IRQ\n"); | ||
76 | return ; | ||
77 | } | ||
78 | |||
79 | if(irq<8) | ||
80 | *(volatile unsigned char *)(pica+1)|=(1<<irq); | ||
81 | else | ||
82 | *(volatile unsigned char *)(picb+1)|=(1<<(irq-8)); | ||
83 | |||
84 | dn_irqs[irq].handler=NULL; | ||
85 | dn_irqs[irq].flags=IRQ_FLG_STD; | ||
86 | dn_irqs[irq].dev_id=NULL; | ||
87 | dn_irqs[irq].devname=NULL; | ||
88 | |||
89 | return ; | ||
90 | |||
91 | } | ||
92 | |||
93 | void dn_enable_irq(unsigned int irq) { | ||
94 | |||
95 | printk("dn enable irq\n"); | ||
96 | |||
97 | } | ||
98 | |||
99 | void dn_disable_irq(unsigned int irq) { | ||
100 | |||
101 | printk("dn disable irq\n"); | ||
102 | 10 | ||
11 | *(volatile unsigned char *)(pica)=0x20; | ||
12 | *(volatile unsigned char *)(picb)=0x20; | ||
103 | } | 13 | } |
104 | 14 | ||
105 | int show_dn_interrupts(struct seq_file *p, void *v) { | 15 | int apollo_irq_startup(unsigned int irq) |
106 | 16 | { | |
107 | printk("dn get irq list\n"); | 17 | if (irq < 8) |
108 | 18 | *(volatile unsigned char *)(pica+1) &= ~(1 << irq); | |
109 | return 0; | 19 | else |
110 | 20 | *(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8)); | |
21 | return 0; | ||
111 | } | 22 | } |
112 | 23 | ||
113 | struct fb_info *dn_dummy_fb_init(long *mem_start) { | 24 | void apollo_irq_shutdown(unsigned int irq) |
114 | 25 | { | |
115 | printk("fb init\n"); | 26 | if (irq < 8) |
116 | 27 | *(volatile unsigned char *)(pica+1) |= (1 << irq); | |
117 | return NULL; | 28 | else |
118 | 29 | *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8)); | |
119 | } | 30 | } |
120 | 31 | ||
121 | void dn_dummy_video_setup(char *options,int *ints) { | 32 | static struct irq_controller apollo_irq_controller = { |
33 | .name = "apollo", | ||
34 | .lock = SPIN_LOCK_UNLOCKED, | ||
35 | .startup = apollo_irq_startup, | ||
36 | .shutdown = apollo_irq_shutdown, | ||
37 | }; | ||
122 | 38 | ||
123 | printk("no video yet\n"); | ||
124 | 39 | ||
40 | void dn_init_IRQ(void) | ||
41 | { | ||
42 | m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int); | ||
43 | m68k_setup_irq_controller(&apollo_irq_controller, IRQ_APOLLO, 16); | ||
125 | } | 44 | } |