diff options
Diffstat (limited to 'drivers/irqchip/irq-versatile-fpga.c')
-rw-r--r-- | drivers/irqchip/irq-versatile-fpga.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 3ae2bb8d9cf2..ccf58548b161 100644 --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <asm/exception.h> | 14 | #include <asm/exception.h> |
15 | #include <asm/mach/irq.h> | 15 | #include <asm/mach/irq.h> |
16 | 16 | ||
17 | #include "irqchip.h" | ||
18 | |||
17 | #define IRQ_STATUS 0x00 | 19 | #define IRQ_STATUS 0x00 |
18 | #define IRQ_RAW_STATUS 0x04 | 20 | #define IRQ_RAW_STATUS 0x04 |
19 | #define IRQ_ENABLE_SET 0x08 | 21 | #define IRQ_ENABLE_SET 0x08 |
@@ -26,6 +28,8 @@ | |||
26 | #define FIQ_ENABLE_SET 0x28 | 28 | #define FIQ_ENABLE_SET 0x28 |
27 | #define FIQ_ENABLE_CLEAR 0x2C | 29 | #define FIQ_ENABLE_CLEAR 0x2C |
28 | 30 | ||
31 | #define PIC_ENABLES 0x20 /* set interrupt pass through bits */ | ||
32 | |||
29 | /** | 33 | /** |
30 | * struct fpga_irq_data - irq data container for the FPGA IRQ controller | 34 | * struct fpga_irq_data - irq data container for the FPGA IRQ controller |
31 | * @base: memory offset in virtual memory | 35 | * @base: memory offset in virtual memory |
@@ -201,14 +205,26 @@ int __init fpga_irq_of_init(struct device_node *node, | |||
201 | 205 | ||
202 | /* Some chips are cascaded from a parent IRQ */ | 206 | /* Some chips are cascaded from a parent IRQ */ |
203 | parent_irq = irq_of_parse_and_map(node, 0); | 207 | parent_irq = irq_of_parse_and_map(node, 0); |
204 | if (!parent_irq) | 208 | if (!parent_irq) { |
209 | set_handle_irq(fpga_handle_irq); | ||
205 | parent_irq = -1; | 210 | parent_irq = -1; |
211 | } | ||
206 | 212 | ||
207 | fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); | 213 | fpga_irq_init(base, node->name, 0, parent_irq, valid_mask, node); |
208 | 214 | ||
209 | writel(clear_mask, base + IRQ_ENABLE_CLEAR); | 215 | writel(clear_mask, base + IRQ_ENABLE_CLEAR); |
210 | writel(clear_mask, base + FIQ_ENABLE_CLEAR); | 216 | writel(clear_mask, base + FIQ_ENABLE_CLEAR); |
211 | 217 | ||
218 | /* | ||
219 | * On Versatile AB/PB, some secondary interrupts have a direct | ||
220 | * pass-thru to the primary controller for IRQs 20 and 22-31 which need | ||
221 | * to be enabled. See section 3.10 of the Versatile AB user guide. | ||
222 | */ | ||
223 | if (of_device_is_compatible(node, "arm,versatile-sic")) | ||
224 | writel(0xffd00000, base + PIC_ENABLES); | ||
225 | |||
212 | return 0; | 226 | return 0; |
213 | } | 227 | } |
228 | IRQCHIP_DECLARE(arm_fpga, "arm,versatile-fpga-irq", fpga_irq_of_init); | ||
229 | IRQCHIP_DECLARE(arm_fpga_sic, "arm,versatile-sic", fpga_irq_of_init); | ||
214 | #endif | 230 | #endif |