xref: /linux/arch/m68k/apollo/dn_ints.c (revision edb347256c44366888debb4f9e8477ac700a9026)
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 
15e8abf5e7SGeert Uytterhoeven unsigned int apollo_irq_startup(struct irq_data *data)
160aa78106SRoman Zippel {
17e8abf5e7SGeert Uytterhoeven 	unsigned int irq = data->irq;
18e8abf5e7SGeert Uytterhoeven 
191da177e4SLinus Torvalds 	if (irq < 8)
201da177e4SLinus Torvalds 		*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
211da177e4SLinus Torvalds 	else
221da177e4SLinus Torvalds 		*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
231da177e4SLinus Torvalds 	return 0;
241da177e4SLinus Torvalds }
251da177e4SLinus Torvalds 
26e8abf5e7SGeert Uytterhoeven void apollo_irq_shutdown(struct irq_data *data)
270aa78106SRoman Zippel {
28e8abf5e7SGeert Uytterhoeven 	unsigned int irq = data->irq;
29e8abf5e7SGeert Uytterhoeven 
301da177e4SLinus Torvalds 	if (irq < 8)
311da177e4SLinus Torvalds 		*(volatile unsigned char *)(pica+1) |= (1 << irq);
321da177e4SLinus Torvalds 	else
331da177e4SLinus Torvalds 		*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
341da177e4SLinus Torvalds }
351da177e4SLinus Torvalds 
36c288bf25SGeert Uytterhoeven static struct irq_chip apollo_irq_chip = {
370aa78106SRoman Zippel 	.name           = "apollo",
38c288bf25SGeert Uytterhoeven 	.irq_startup    = apollo_irq_startup,
39c288bf25SGeert Uytterhoeven 	.irq_shutdown   = apollo_irq_shutdown,
400aa78106SRoman Zippel };
411da177e4SLinus Torvalds 
421da177e4SLinus Torvalds 
4366a3f820SAl Viro void __init dn_init_IRQ(void)
440aa78106SRoman Zippel {
450aa78106SRoman Zippel 	m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
46*edb34725SGeert Uytterhoeven 	m68k_setup_irq_controller(&apollo_irq_chip, handle_simple_irq,
47*edb34725SGeert Uytterhoeven 				  IRQ_APOLLO, 16);
481da177e4SLinus Torvalds }
49