xref: /linux/arch/m68k/apollo/dn_ints.c (revision 66a3f820cb6a88ef0481e042d4b48b2299deab7e)
10aa78106SRoman Zippel #include <linux/interrupt.h>
21da177e4SLinus Torvalds 
31da177e4SLinus Torvalds #include <asm/irq.h>
41da177e4SLinus Torvalds #include <asm/traps.h>
51da177e4SLinus Torvalds #include <asm/apollohw.h>
61da177e4SLinus Torvalds 
70aa78106SRoman Zippel void dn_process_int(unsigned int irq, struct pt_regs *fp)
81da177e4SLinus Torvalds {
92850bc27SAl Viro 	__m68k_handle_int(irq, fp);
101da177e4SLinus Torvalds 
111da177e4SLinus Torvalds 	*(volatile unsigned char *)(pica)=0x20;
121da177e4SLinus Torvalds 	*(volatile unsigned char *)(picb)=0x20;
131da177e4SLinus Torvalds }
141da177e4SLinus Torvalds 
150aa78106SRoman Zippel int apollo_irq_startup(unsigned int irq)
160aa78106SRoman Zippel {
171da177e4SLinus Torvalds 	if (irq < 8)
181da177e4SLinus Torvalds 		*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
191da177e4SLinus Torvalds 	else
201da177e4SLinus Torvalds 		*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
211da177e4SLinus Torvalds 	return 0;
221da177e4SLinus Torvalds }
231da177e4SLinus Torvalds 
240aa78106SRoman Zippel void apollo_irq_shutdown(unsigned int irq)
250aa78106SRoman Zippel {
261da177e4SLinus Torvalds 	if (irq < 8)
271da177e4SLinus Torvalds 		*(volatile unsigned char *)(pica+1) |= (1 << irq);
281da177e4SLinus Torvalds 	else
291da177e4SLinus Torvalds 		*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
301da177e4SLinus Torvalds }
311da177e4SLinus Torvalds 
320aa78106SRoman Zippel static struct irq_controller apollo_irq_controller = {
330aa78106SRoman Zippel 	.name           = "apollo",
34241258d1SMilind Arun Choudhary 	.lock           = __SPIN_LOCK_UNLOCKED(apollo_irq_controller.lock),
350aa78106SRoman Zippel 	.startup        = apollo_irq_startup,
360aa78106SRoman Zippel 	.shutdown       = apollo_irq_shutdown,
370aa78106SRoman Zippel };
381da177e4SLinus Torvalds 
391da177e4SLinus Torvalds 
40*66a3f820SAl Viro void __init dn_init_IRQ(void)
410aa78106SRoman Zippel {
420aa78106SRoman Zippel 	m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
430aa78106SRoman Zippel 	m68k_setup_irq_controller(&apollo_irq_controller, IRQ_APOLLO, 16);
441da177e4SLinus Torvalds }
45