dn_ints.c 1.0 KB
Newer Older
1
#include <linux/interrupt.h>
2 3
#include <linux/irq.h>

L
Linus Torvalds 已提交
4 5 6
#include <asm/traps.h>
#include <asm/apollohw.h>

7
unsigned int apollo_irq_startup(struct irq_data *data)
8
{
9 10
	unsigned int irq = data->irq;

11 12 13 14 15
	if (irq < 8)
		*(volatile unsigned char *)(pica+1) &= ~(1 << irq);
	else
		*(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8));
	return 0;
L
Linus Torvalds 已提交
16 17
}

18
void apollo_irq_shutdown(struct irq_data *data)
19
{
20 21
	unsigned int irq = data->irq;

22 23 24 25
	if (irq < 8)
		*(volatile unsigned char *)(pica+1) |= (1 << irq);
	else
		*(volatile unsigned char *)(picb+1) |= (1 << (irq - 8));
L
Linus Torvalds 已提交
26 27
}

28 29 30 31 32 33
void apollo_irq_eoi(struct irq_data *data)
{
	*(volatile unsigned char *)(pica) = 0x20;
	*(volatile unsigned char *)(picb) = 0x20;
}

34
static struct irq_chip apollo_irq_chip = {
35
	.name           = "apollo",
36 37
	.irq_startup    = apollo_irq_startup,
	.irq_shutdown   = apollo_irq_shutdown,
38
	.irq_eoi	= apollo_irq_eoi,
39
};
L
Linus Torvalds 已提交
40 41


A
Al Viro 已提交
42
void __init dn_init_IRQ(void)
43
{
44
	m68k_setup_user_interrupt(VEC_USER + 96, 16);
45
	m68k_setup_irq_controller(&apollo_irq_chip, handle_fasteoi_irq,
46
				  IRQ_APOLLO, 16);
L
Linus Torvalds 已提交
47
}