Where do p1011 interrupts show up on Linux?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Where do p1011 interrupts show up on Linux?

ソリューションへジャンプ
4,088件の閲覧回数
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

タグ(1)
0 件の賞賛
返信
1 解決策
3,255件の閲覧回数
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 件の賞賛
返信
3 返答(返信)
3,256件の閲覧回数
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 件の賞賛
返信
3,255件の閲覧回数
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 件の賞賛
返信
3,255件の閲覧回数
scottwood
NXP Employee
NXP Employee

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

0 件の賞賛
返信