/* * Interrupt handling for GE FPGA based PIC * * Author: Martyn Welch <martyn.welch@ge.com> * * 2008 (c) GE Intelligent Platforms Embedded Systems, Inc. * * This file is licensed under the terms of the GNU General Public License * version 2. This program is licensed "as is" without any warranty of any * kind, whether express or implied.
*/
/* * Interrupt Controller Handling * * The interrupt controller handles interrupts for most on board interrupts, * apart from PCI interrupts. For example on SBC610: * * 17:31 RO Reserved * 16 RO PCI Express Doorbell 3 Status * 15 RO PCI Express Doorbell 2 Status * 14 RO PCI Express Doorbell 1 Status * 13 RO PCI Express Doorbell 0 Status * 12 RO Real Time Clock Interrupt Status * 11 RO Temperature Interrupt Status * 10 RO Temperature Critical Interrupt Status * 9 RO Ethernet PHY1 Interrupt Status * 8 RO Ethernet PHY3 Interrupt Status * 7 RO PEX8548 Interrupt Status * 6 RO Reserved * 5 RO Watchdog 0 Interrupt Status * 4 RO Watchdog 1 Interrupt Status * 3 RO AXIS Message FIFO A Interrupt Status * 2 RO AXIS Message FIFO B Interrupt Status * 1 RO AXIS Message FIFO C Interrupt Status * 0 RO AXIS Message FIFO D Interrupt Status * * Interrupts can be forwarded to one of two output lines. Nothing * clever is done, so if the masks are incorrectly set, a single input * interrupt could generate interrupts on both output lines! * * The dual lines are there to allow the chained interrupts to be easily * passed into two different cores. We currently do not use this functionality * in this driver. * * Controller can also be configured to generate Machine checks (MCP), again on * two lines, to be attached to two different cores. It is suggested that these * should be masked out.
*/
staticvoid gef_pic_mask_ack(struct irq_data *d)
{ /* Don't think we actually have to do anything to ack an interrupt, * we just need to clear down the devices interrupt and it will go away
*/
gef_pic_mask(d);
}
/* When an interrupt is being configured, this call allows some flexibility * in deciding which irq_chip structure is used
*/ staticint gef_pic_host_map(struct irq_domain *h, unsignedint virq,
irq_hw_number_t hwirq)
{ /* All interrupts are LEVEL sensitive */
irq_set_status_flags(virq, IRQ_LEVEL);
irq_set_chip_and_handler(virq, &gef_pic_chip, handle_level_irq);
/* Map controller */
gef_pic_cascade_irq = irq_of_parse_and_map(np, 0); if (!gef_pic_cascade_irq) {
printk(KERN_ERR "SBC610: failed to map cascade interrupt"); return;
}
/* Setup an irq_domain structure */
gef_pic_irq_host = irq_domain_create_linear(of_fwnode_handle(np),
GEF_PIC_NUM_IRQS,
&gef_pic_host_ops, NULL); if (gef_pic_irq_host == NULL) return;
/* Chain with parent controller */
irq_set_chained_handler(gef_pic_cascade_irq, gef_pic_cascade);
}
/* * This is called when we receive an interrupt with apparently comes from this * chip - check, returning the highest interrupt generated or return 0.
*/ unsignedint gef_pic_get_irq(void)
{
u32 cause, mask, active; unsignedint virq = 0; int hwirq;
cause = in_be32(gef_pic_irq_reg_base + GEF_PIC_INTR_STATUS);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.