blob: 4b764312aed0f2b38183f90d6cc62a67558b9418 [file] [log] [blame]
Roman Zippel0aa78102006-06-25 05:47:02 -07001#include <linux/interrupt.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07002
Linus Torvalds1da177e2005-04-16 15:20:36 -07003#include <asm/irq.h>
4#include <asm/traps.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07005#include <asm/apollohw.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07006
Roman Zippel0aa78102006-06-25 05:47:02 -07007void dn_process_int(unsigned int irq, struct pt_regs *fp)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008{
Geert Uytterhoeven1425df82011-07-01 20:39:19 +02009 do_IRQ(irq, fp);
Linus Torvalds1da177e2005-04-16 15:20:36 -070010
Roman Zippel0aa78102006-06-25 05:47:02 -070011 *(volatile unsigned char *)(pica)=0x20;
12 *(volatile unsigned char *)(picb)=0x20;
Linus Torvalds1da177e2005-04-16 15:20:36 -070013}
14
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +020015unsigned int apollo_irq_startup(struct irq_data *data)
Roman Zippel0aa78102006-06-25 05:47:02 -070016{
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +020017 unsigned int irq = data->irq;
18
Roman Zippel0aa78102006-06-25 05:47:02 -070019 if (irq < 8)
20 *(volatile unsigned char *)(pica+1) &= ~(1 << irq);
21 else
22 *(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
23 return 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -070024}
25
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +020026void apollo_irq_shutdown(struct irq_data *data)
Roman Zippel0aa78102006-06-25 05:47:02 -070027{
Geert Uytterhoevene8abf5e2011-04-17 22:53:04 +020028 unsigned int irq = data->irq;
29
Roman Zippel0aa78102006-06-25 05:47:02 -070030 if (irq < 8)
31 *(volatile unsigned char *)(pica+1) |= (1 << irq);
32 else
33 *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
Linus Torvalds1da177e2005-04-16 15:20:36 -070034}
35
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020036static struct irq_chip apollo_irq_chip = {
Roman Zippel0aa78102006-06-25 05:47:02 -070037 .name = "apollo",
Geert Uytterhoevenc288bf22011-04-13 22:31:28 +020038 .irq_startup = apollo_irq_startup,
39 .irq_shutdown = apollo_irq_shutdown,
Roman Zippel0aa78102006-06-25 05:47:02 -070040};
Linus Torvalds1da177e2005-04-16 15:20:36 -070041
Linus Torvalds1da177e2005-04-16 15:20:36 -070042
Al Viro66a3f822007-07-20 04:33:28 +010043void __init dn_init_IRQ(void)
Roman Zippel0aa78102006-06-25 05:47:02 -070044{
45 m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
Geert Uytterhoevenedb34722011-06-01 11:15:21 +020046 m68k_setup_irq_controller(&apollo_irq_chip, handle_simple_irq,
47 IRQ_APOLLO, 16);
Linus Torvalds1da177e2005-04-16 15:20:36 -070048}