interrupt number assignment dts file help

Kumar Gala galak at kernel.crashing.org
Thu Jan 15 16:34:46 EST 2009


On Jan 14, 2009, at 11:15 PM, Ken Williams wrote:

> I am trying to configure a dts file for the pci subsystem of a  
> MPC8540 based system.
>
> I am expecting (hoping) that the value specified in the interrupts  
> property (98 in this example)
> will be used as the virtual interrupt number and that I can later do  
> a request_irq using that number.

The .dts deals with physical interrupt numbers.  Virtual IRQs is a  
linux concept.

> kernel: 2.6.26.3
>
> The board level configuration is:
>  ADR29 connected to IDSEL
>  using INTA# only
>  The PCI interrupt is connected to external IRQ2
>
> What I see is that inside irq_create_mapping, a call to  
> irq_find_mapping produces a null virq,
> so irq_alloc_virt is called and comes back with x12.  Can I assign  
> the number to 98 (x62)
> using the dts?  Any help would be greatly appreciated.

Do you want INTA# or the PCI error interrupt?

I'm guessing INT A#.

Here's an example from the mpc8540ads.dts:

         pci0: pci at e0008000 {
                 cell-index = <0>;
                 interrupt-map-mask = <0xf800 0x0 0x0 0x7>;
                 interrupt-map = <
...
                         /* IDSEL 0x03 */
                         0x1800 0x0 0x0 0x1 &mpic 0x4 0x1
                         0x1800 0x0 0x0 0x2 &mpic 0x1 0x1
                         0x1800 0x0 0x0 0x3 &mpic 0x2 0x1
                         0x1800 0x0 0x0 0x4 &mpic 0x3 0x1


...

So the interrupt-map here deals w/PCI INTA# to INTD#.

(0x1800 0x0 0x0) (0x1) &mpic ((0x4) (0x1))
(pci address) (intA) pic-handle (pic HW IRQ) (irq sense info)

So to decode the example we have for IDSEL 0x03:
INTA: irq 4
INTB: irq 1
INTC: irq 2
INTD: irq 3

If you have a proper PCI driver in linux you shouldn't have to deal  
with virtual IRQs at all.

- k



More information about the Linuxppc-dev mailing list