Files
OrangePi_CM5/arch/m68k/apollo/dn_ints.c
T

47 lines
1.0 KiB
C
Raw Normal View History

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