Hello,
In my design, based on P2041RDB, an external interrupt is hitting to pin IRQ2 from FPGA .
Can any one pls guide me how to configure interrupts in kernel??
Thanks in advance..
regards,
Gourav
Linux makes no difference between external and internal interrupts. All interrupts in the system are handled by the same Linux API. If this API didn't work, no driver in the system would be able to operate, not just your customer's module.
The resource number is an index to irq_desc table.
This index is generally _not_equal to the hardware IRQ line number. See Documentation/IRQ.txt for explanation.
To request an IRQ line in a proper way, the customer should:
property is calculated by the following
formula:
[DTS_interrupt_number] = ([EIVPR/IIVPR_addr] - [Interrupt_Source_Configuration_Registers_Base]) / 0x20
where [EIVPR/IIVPR_addr] is the address of the interrupt configuration registers
of the IRQ being declared, [Interrupt_Source_Configuration_Registers_Base]
is 0x50000 for the P2040
All steps above are performed by _any_ device driver in the system. Just look how it is done in e.g. drivers/net/gianfar.c or drivers/spi/fsl_espi.c
and do the same in your code.
The P2040 IRQ2 is shared with virtual PCIe INTC. It is needed to remove the corresponding PCIe node declaration from the .dts file and must not use that PCIe port. Otherwise, there will be a resource conflict.
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------