Our hardware connects to pin N25 / IRQ[3] on a P1011 processor chip.
How do I register for this interrupt under linux 2.6?
The code ends up a request_threaded_irq ( 3, ... )
but trips up here:
if (desc->status & IRQ_NOREQUEST) { |
printk("CP #3 fail -EINVAL, desc->status = 0x%08x, IRQ_NOREQUEST = 0x%08x, name = <%s>\n",
desc->status, | |
IRQ_NOREQUEST, | |
desc->name); |
return -EINVAL;
}
Cal Page
Solved! Go to Solution.
request_irq() takes a Linux virtual IRQ number, not an MPIC IRQ number. The best way to deal with this is to describe your device in the device tree, and use irq_of_parse_and_map() to get the corresponding Linux virtual IRQ number. Otherwise, you can use irq_create_mapping().
request_irq() takes a Linux virtual IRQ number, not an MPIC IRQ number. The best way to deal with this is to describe your device in the device tree, and use irq_of_parse_and_map() to get the corresponding Linux virtual IRQ number. Otherwise, you can use irq_create_mapping().
Ah, irq_create_mapping() !
I am presuming that it's second argument is the interrupt number corresponds to the ones on the p1011 chip. I am trying to pick up interrupt 3, labeled N25 on the chip, so I pass in the three.
Here's a trace of my actions:
arch/powerpc/kernel/irq.c:irq_create_mapping:717:irq: irq_create_mapping(0x(null), 0x3)
arch/powerpc/kernel/irq.c:irq_create_mapping:728:irq: -> using host @cf408000
arch/powerpc/kernel/irq.c:irq_create_mapping:737:irq: -> existing mapping on virq 16
__uio_register_device: registering for interrupt at irq = 3, linux_irq = 16
request_threaded_irq: entry, irq = 16
__uio_register_device: returning 0 (SUCCESS)
virq 16 registered ok.
Is this correct?
It looks OK, though again the preferred approach is to use the device tree.