Questions on interrupt vector assignment on MPC8641D
scottwood at freescale.com
Wed Sep 22 08:07:00 EST 2010
On Tue, 21 Sep 2010 17:37:15 -0400
"Anderson, Trevor" <tanderson at curtisswright.com> wrote:
> IRQ assignments for MPC8641D are "virtual",
This is true for powerpc in general.
> meaning "made up" and quite difficult to determine by looking through code.
> But I believe the plan goes something like this:
> 0 No interrupt
> 1 - 15 External interrupts (only 1..12 would be used)
> 16 - 127 Internal interrupts - see Table 9-2 of 8641D ref man,
> Add 15 to the numbers shown
> 128 - 255 Yours, or your BSP's, to do with as you like
> 256 - 511 Message Signaled Interrupts
> If you look in the sample device trees for 8641 cards you'll see that
> the interrupt values cited there for various devices match the 16..127
> group above.
There are two different numberspaces involved here.
The MPIC interrupt numberspace in the device tree (which is not
virtual; it is a private numberspace to MPIC) is based on the offset of
the registers for that interrupt source. External interrupts start at
zero (which is valid), internal at 16, and special things like MSIs at
higher numbers (I don't think it's quite 256).
The numberspace for virtual interrupts, which is what you pass to
request_irq(), is dynamically allocated. You shouldn't need to know
anything about it other than that zero is invalid, and you get the
virtual IRQ from irq_of_parse_and_map() or another such mapping
In neither case is there a range that is set aside for you "to do with
as you like". If you have another interrupt controller and need a
block of virtual interrupts, register the controller with
irq_alloc_host() and you'll get a block assigned.
More information about the Linuxppc-dev