2006-06-25 20:47:02 +08:00
|
|
|
#include <linux/interrupt.h>
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#include <asm/irq.h>
|
|
|
|
#include <asm/traps.h>
|
|
|
|
#include <asm/apollohw.h>
|
|
|
|
|
2006-06-25 20:47:02 +08:00
|
|
|
void dn_process_int(unsigned int irq, struct pt_regs *fp)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2011-07-02 02:39:19 +08:00
|
|
|
do_IRQ(irq, fp);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2006-06-25 20:47:02 +08:00
|
|
|
*(volatile unsigned char *)(pica)=0x20;
|
|
|
|
*(volatile unsigned char *)(picb)=0x20;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2011-04-18 04:53:04 +08:00
|
|
|
unsigned int apollo_irq_startup(struct irq_data *data)
|
2006-06-25 20:47:02 +08:00
|
|
|
{
|
2011-04-18 04:53:04 +08:00
|
|
|
unsigned int irq = data->irq;
|
|
|
|
|
2006-06-25 20:47:02 +08:00
|
|
|
if (irq < 8)
|
|
|
|
*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
|
|
|
|
else
|
|
|
|
*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
|
|
|
|
return 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2011-04-18 04:53:04 +08:00
|
|
|
void apollo_irq_shutdown(struct irq_data *data)
|
2006-06-25 20:47:02 +08:00
|
|
|
{
|
2011-04-18 04:53:04 +08:00
|
|
|
unsigned int irq = data->irq;
|
|
|
|
|
2006-06-25 20:47:02 +08:00
|
|
|
if (irq < 8)
|
|
|
|
*(volatile unsigned char *)(pica+1) |= (1 << irq);
|
|
|
|
else
|
|
|
|
*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
2011-04-14 04:31:28 +08:00
|
|
|
static struct irq_chip apollo_irq_chip = {
|
2006-06-25 20:47:02 +08:00
|
|
|
.name = "apollo",
|
2011-04-14 04:31:28 +08:00
|
|
|
.irq_startup = apollo_irq_startup,
|
|
|
|
.irq_shutdown = apollo_irq_shutdown,
|
2006-06-25 20:47:02 +08:00
|
|
|
};
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
|
2007-07-20 11:33:28 +08:00
|
|
|
void __init dn_init_IRQ(void)
|
2006-06-25 20:47:02 +08:00
|
|
|
{
|
|
|
|
m68k_setup_user_interrupt(VEC_USER + 96, 16, dn_process_int);
|
2011-06-01 17:15:21 +08:00
|
|
|
m68k_setup_irq_controller(&apollo_irq_chip, handle_simple_irq,
|
|
|
|
IRQ_APOLLO, 16);
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|