2 * Interrupt controller driver for Xilinx Virtex FPGAs
4 * Copyright (C) 2007 Secret Lab Technologies Ltd.
6 * This file is licensed under the terms of the GNU General Public License
7 * version 2. This program is licensed "as is" without any warranty of any
8 * kind, whether express or implied.
13 * This is a driver for the interrupt controller typically found in
14 * Xilinx Virtex FPGA designs.
16 * The interrupt sense levels are hard coded into the FPGA design with
17 * typically a 1:1 relationship between irq lines and devices (no shared
18 * irq lines). Therefore, this driver does not attempt to handle edge
19 * and level interrupts differently.
23 #include <linux/kernel.h>
24 #include <linux/irq.h>
26 #include <linux/of_address.h>
27 #include <linux/of_irq.h>
29 #include <asm/processor.h>
30 #include <asm/i8259.h>
32 #include <linux/irqchip.h>
34 #if defined(CONFIG_PPC_I8259)
36 * Support code for cascading to 8259 interrupt controllers
38 static void xilinx_i8259_cascade(struct irq_desc
*desc
)
40 struct irq_chip
*chip
= irq_desc_get_chip(desc
);
41 unsigned int cascade_irq
= i8259_irq();
44 generic_handle_irq(cascade_irq
);
46 /* Let xilinx_intc end the interrupt */
47 chip
->irq_unmask(&desc
->irq_data
);
50 static void __init
xilinx_i8259_setup_cascade(void)
52 struct device_node
*cascade_node
;
55 /* Initialize i8259 controller */
56 cascade_node
= of_find_compatible_node(NULL
, NULL
, "chrp,iic");
60 cascade_irq
= irq_of_parse_and_map(cascade_node
, 0);
62 pr_err("virtex_ml510: Failed to map cascade interrupt\n");
66 i8259_init(cascade_node
, 0);
67 irq_set_chained_handler(cascade_irq
, xilinx_i8259_cascade
);
69 /* Program irq 7 (usb/audio), 14/15 (ide) to level sensitive */
70 /* This looks like a dirty hack to me --gcl */
75 of_node_put(cascade_node
);
78 static inline void xilinx_i8259_setup_cascade(void) { return; }
79 #endif /* defined(CONFIG_PPC_I8259) */
82 * Initialize master Xilinx interrupt controller
84 void __init
xilinx_intc_init_tree(void)
87 xilinx_i8259_setup_cascade();