Lines Matching +full:interrupt +full:- +full:src

1 // SPDX-License-Identifier: GPL-2.0-only
10 #include <linux/interrupt.h>
37 unsigned int src = virq_to_hw(d->irq) - mpic->err_int_vecs[0]; in fsl_mpic_mask_err() local
39 eimr = mpic_fsl_err_read(mpic->err_regs, MPIC_ERR_INT_EIMR); in fsl_mpic_mask_err()
40 eimr |= (1 << (31 - src)); in fsl_mpic_mask_err()
41 mpic_fsl_err_write(mpic->err_regs, eimr); in fsl_mpic_mask_err()
48 unsigned int src = virq_to_hw(d->irq) - mpic->err_int_vecs[0]; in fsl_mpic_unmask_err() local
50 eimr = mpic_fsl_err_read(mpic->err_regs, MPIC_ERR_INT_EIMR); in fsl_mpic_unmask_err()
51 eimr &= ~(1 << (31 - src)); in fsl_mpic_unmask_err()
52 mpic_fsl_err_write(mpic->err_regs, eimr); in fsl_mpic_unmask_err()
65 mpic->err_regs = ioremap(mpic->paddr + MPIC_ERR_INT_BASE, 0x1000); in mpic_setup_error_int()
66 if (!mpic->err_regs) { in mpic_setup_error_int()
68 return -ENOMEM; in mpic_setup_error_int()
70 mpic->hc_err = fsl_mpic_err_chip; in mpic_setup_error_int()
71 mpic->hc_err.name = mpic->name; in mpic_setup_error_int()
72 mpic->flags |= MPIC_FSL_HAS_EIMR; in mpic_setup_error_int()
73 /* allocate interrupt vectors for error interrupts */ in mpic_setup_error_int()
74 for (i = MPIC_MAX_ERR - 1; i >= 0; i--) in mpic_setup_error_int()
75 mpic->err_int_vecs[i] = intvec--; in mpic_setup_error_int()
82 if ((mpic->flags & MPIC_FSL_HAS_EIMR) && in mpic_map_error_int()
83 (hw >= mpic->err_int_vecs[0] && in mpic_map_error_int()
84 hw <= mpic->err_int_vecs[MPIC_MAX_ERR - 1])) { in mpic_map_error_int()
85 WARN_ON(mpic->flags & MPIC_SECONDARY); in mpic_map_error_int()
87 pr_debug("mpic: mapping as Error Interrupt\n"); in mpic_map_error_int()
89 irq_set_chip_and_handler(virq, &mpic->hc_err, in mpic_map_error_int()
103 eisr = mpic_fsl_err_read(mpic->err_regs, MPIC_ERR_INT_EISR); in fsl_error_int_handler()
104 eimr = mpic_fsl_err_read(mpic->err_regs, MPIC_ERR_INT_EIMR); in fsl_error_int_handler()
112 ret = generic_handle_domain_irq(mpic->irqhost, in fsl_error_int_handler()
113 mpic->err_int_vecs[errint]); in fsl_error_int_handler()
115 eimr |= 1 << (31 - errint); in fsl_error_int_handler()
116 mpic_fsl_err_write(mpic->err_regs, eimr); in fsl_error_int_handler()
118 eisr &= ~(1 << (31 - errint)); in fsl_error_int_handler()
129 virq = irq_create_mapping(mpic->irqhost, irqnum); in mpic_err_int_init()
131 pr_err("Error interrupt setup failed\n"); in mpic_err_int_init()
136 mpic_fsl_err_write(mpic->err_regs, ~0); in mpic_err_int_init()
139 "mpic-error-int", mpic); in mpic_err_int_init()
141 pr_err("Failed to register error interrupt handler\n"); in mpic_err_int_init()