Where do p1011 interrupts show up on Linux?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Where do p1011 interrupts show up on Linux?

Jump to solution
2,118 Views
calpage
Contributor I

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

Tags (1)
0 Kudos
1 Solution
1,285 Views
scottwood
NXP Employee
NXP Employee

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().

View solution in original post

0 Kudos
3 Replies
1,286 Views
scottwood
NXP Employee
NXP Employee

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().

0 Kudos
1,285 Views
calpage
Contributor I

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?


0 Kudos
1,285 Views
scottwood
NXP Employee
NXP Employee

It looks OK, though again the preferred approach is to use the device tree.

0 Kudos