Lines Matching refs:irqc
48 static void xintc_write(struct xintc_irq_chip *irqc, int reg, u32 data) in xintc_write() argument
51 iowrite32be(data, irqc->base + reg); in xintc_write()
53 iowrite32(data, irqc->base + reg); in xintc_write()
56 static u32 xintc_read(struct xintc_irq_chip *irqc, int reg) in xintc_read() argument
59 return ioread32be(irqc->base + reg); in xintc_read()
61 return ioread32(irqc->base + reg); in xintc_read()
66 struct xintc_irq_chip *irqc = irq_data_get_irq_chip_data(d); in intc_enable_or_unmask() local
76 xintc_write(irqc, IAR, mask); in intc_enable_or_unmask()
78 xintc_write(irqc, SIE, mask); in intc_enable_or_unmask()
83 struct xintc_irq_chip *irqc = irq_data_get_irq_chip_data(d); in intc_disable_or_mask() local
86 xintc_write(irqc, CIE, BIT(d->hwirq)); in intc_disable_or_mask()
91 struct xintc_irq_chip *irqc = irq_data_get_irq_chip_data(d); in intc_ack() local
94 xintc_write(irqc, IAR, BIT(d->hwirq)); in intc_ack()
99 struct xintc_irq_chip *irqc = irq_data_get_irq_chip_data(d); in intc_mask_ack() local
103 xintc_write(irqc, CIE, mask); in intc_mask_ack()
104 xintc_write(irqc, IAR, mask); in intc_mask_ack()
117 struct xintc_irq_chip *irqc = d->host_data; in xintc_map() local
119 if (irqc->intr_mask & BIT(hw)) { in xintc_map()
128 irq_set_chip_data(irq, irqc); in xintc_map()
140 struct xintc_irq_chip *irqc; in xil_intc_irq_handler() local
142 irqc = irq_data_get_irq_handler_data(&desc->irq_data); in xil_intc_irq_handler()
145 u32 hwirq = xintc_read(irqc, IVR); in xil_intc_irq_handler()
150 generic_handle_domain_irq(irqc->root_domain, hwirq); in xil_intc_irq_handler()
171 struct xintc_irq_chip *irqc; in xilinx_intc_of_init() local
174 irqc = kzalloc(sizeof(*irqc), GFP_KERNEL); in xilinx_intc_of_init()
175 if (!irqc) in xilinx_intc_of_init()
177 irqc->base = of_iomap(intc, 0); in xilinx_intc_of_init()
178 BUG_ON(!irqc->base); in xilinx_intc_of_init()
180 ret = of_property_read_u32(intc, "xlnx,num-intr-inputs", &irqc->nr_irq); in xilinx_intc_of_init()
186 ret = of_property_read_u32(intc, "xlnx,kind-of-intr", &irqc->intr_mask); in xilinx_intc_of_init()
189 irqc->intr_mask = 0; in xilinx_intc_of_init()
192 if (irqc->intr_mask >> irqc->nr_irq) in xilinx_intc_of_init()
196 intc, irqc->nr_irq, irqc->intr_mask); in xilinx_intc_of_init()
203 xintc_write(irqc, IER, 0); in xilinx_intc_of_init()
206 xintc_write(irqc, IAR, 0xffffffff); in xilinx_intc_of_init()
209 xintc_write(irqc, MER, MER_HIE | MER_ME); in xilinx_intc_of_init()
210 if (xintc_read(irqc, MER) != (MER_HIE | MER_ME)) { in xilinx_intc_of_init()
212 xintc_write(irqc, MER, MER_HIE | MER_ME); in xilinx_intc_of_init()
215 irqc->root_domain = irq_domain_add_linear(intc, irqc->nr_irq, in xilinx_intc_of_init()
216 &xintc_irq_domain_ops, irqc); in xilinx_intc_of_init()
217 if (!irqc->root_domain) { in xilinx_intc_of_init()
228 irqc); in xilinx_intc_of_init()
235 primary_intc = irqc; in xilinx_intc_of_init()
243 iounmap(irqc->base); in xilinx_intc_of_init()
244 kfree(irqc); in xilinx_intc_of_init()