Commit | Line | Data |
---|---|---|
0aa78106 | 1 | #include <linux/interrupt.h> |
bc7485ac | 2 | #include <linux/irq.h> |
bc7485ac | 3 | |
1da177e4 | 4 | #include <asm/traps.h> |
1da177e4 | 5 | #include <asm/apollohw.h> |
1da177e4 | 6 | |
e8abf5e7 | 7 | unsigned int apollo_irq_startup(struct irq_data *data) |
0aa78106 | 8 | { |
e8abf5e7 GU |
9 | unsigned int irq = data->irq; |
10 | ||
0aa78106 RZ |
11 | if (irq < 8) |
12 | *(volatile unsigned char *)(pica+1) &= ~(1 << irq); | |
13 | else | |
14 | *(volatile unsigned char *)(picb+1) &= ~(1 << (irq - 8)); | |
15 | return 0; | |
1da177e4 LT |
16 | } |
17 | ||
e8abf5e7 | 18 | void apollo_irq_shutdown(struct irq_data *data) |
0aa78106 | 19 | { |
e8abf5e7 GU |
20 | unsigned int irq = data->irq; |
21 | ||
0aa78106 RZ |
22 | if (irq < 8) |
23 | *(volatile unsigned char *)(pica+1) |= (1 << irq); | |
24 | else | |
25 | *(volatile unsigned char *)(picb+1) |= (1 << (irq - 8)); | |
1da177e4 LT |
26 | } |
27 | ||
bc7485ac GU |
28 | void apollo_irq_eoi(struct irq_data *data) |
29 | { | |
30 | *(volatile unsigned char *)(pica) = 0x20; | |
31 | *(volatile unsigned char *)(picb) = 0x20; | |
32 | } | |
bc7485ac | 33 | |
c288bf25 | 34 | static struct irq_chip apollo_irq_chip = { |
0aa78106 | 35 | .name = "apollo", |
c288bf25 GU |
36 | .irq_startup = apollo_irq_startup, |
37 | .irq_shutdown = apollo_irq_shutdown, | |
bc7485ac | 38 | .irq_eoi = apollo_irq_eoi, |
0aa78106 | 39 | }; |
1da177e4 | 40 | |
1da177e4 | 41 | |
66a3f820 | 42 | void __init dn_init_IRQ(void) |
0aa78106 | 43 | { |
f30a6484 | 44 | m68k_setup_user_interrupt(VEC_USER + 96, 16); |
bc7485ac | 45 | m68k_setup_irq_controller(&apollo_irq_chip, handle_fasteoi_irq, |
edb34725 | 46 | IRQ_APOLLO, 16); |
1da177e4 | 47 | } |