23 #include <linux/kernel.h>
27 #include <asm/processor.h>
28 #include <asm/i8259.h>
45 #define XILINX_INTC_MAXIRQS (32)
56 static unsigned char xilinx_intc_map_senses[] = {
72 static void xilinx_intc_mask(
struct irq_data *
d)
74 int irq = irqd_to_hwirq(d);
75 void *
regs = irq_data_get_irq_chip_data(d);
80 static int xilinx_intc_set_type(
struct irq_data *
d,
unsigned int flow_type)
88 static void xilinx_intc_level_unmask(
struct irq_data *
d)
90 int irq = irqd_to_hwirq(d);
91 void *
regs = irq_data_get_irq_chip_data(d);
102 static struct irq_chip xilinx_intc_level_irqchip = {
103 .name =
"Xilinx Level INTC",
104 .irq_mask = xilinx_intc_mask,
105 .irq_mask_ack = xilinx_intc_mask,
106 .irq_unmask = xilinx_intc_level_unmask,
107 .irq_set_type = xilinx_intc_set_type,
113 static void xilinx_intc_edge_unmask(
struct irq_data *
d)
115 int irq = irqd_to_hwirq(d);
116 void *
regs = irq_data_get_irq_chip_data(d);
121 static void xilinx_intc_edge_ack(
struct irq_data *
d)
123 int irq = irqd_to_hwirq(d);
124 void *
regs = irq_data_get_irq_chip_data(d);
129 static struct irq_chip xilinx_intc_edge_irqchip = {
130 .name =
"Xilinx Edge INTC",
131 .irq_mask = xilinx_intc_mask,
132 .irq_unmask = xilinx_intc_edge_unmask,
133 .irq_ack = xilinx_intc_edge_ack,
134 .irq_set_type = xilinx_intc_set_type,
145 const u32 *intspec,
unsigned int intsize,
147 unsigned int *out_flags)
154 xilinx_intc_typetable[intspec[0]] = xilinx_intc_map_senses[intspec[1]];
159 *out_hwirq = intspec[0];
160 *out_flags = xilinx_intc_map_senses[intspec[1]];
164 static int xilinx_intc_map(
struct irq_domain *h,
unsigned int virq,
171 irq_set_chip_and_handler(virq, &xilinx_intc_level_irqchip,
174 irq_set_chip_and_handler(virq, &xilinx_intc_edge_irqchip,
181 .map = xilinx_intc_map,
182 .xlate = xilinx_intc_xlate,
194 pr_err(
"xilinx_intc: could not map registers\n");
207 panic(__FILE__
": Cannot allocate IRQ host\n");
219 #if defined(CONFIG_PPC_I8259)
223 static void xilinx_i8259_cascade(
unsigned int irq,
struct irq_desc *
desc)
235 static void __init xilinx_i8259_setup_cascade(
void)
247 pr_err(
"virtex_ml510: Failed to map cascade interrupt\n");
252 irq_set_chained_handler(cascade_irq, xilinx_i8259_cascade);
260 of_node_put(cascade_node);
263 static inline void xilinx_i8259_setup_cascade(
void) {
return; }
267 { .compatible =
"xlnx,opb-intc-1.00.c", },
268 { .compatible =
"xlnx,xps-intc-1.00.a", },
280 for_each_matching_node(np, xilinx_intc_match) {
292 xilinx_i8259_setup_cascade();