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