A question about the irq registration between SDK1.6 and SDK2.0

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

A question about the irq registration between SDK1.6 and SDK2.0

2,279 次查看
zhangyunfei
Contributor I

Hi
    Dear sir.
We are using B4860qds. Now we want to update the SDK from SDK1.6 to SDK2.0.In the SDK1.6 version . we use the MPIC Core 0 to interrupt. When DSP writes 1 to the MPIC_IPIDR3 register, an interrupt occurs to linux kernel.The irq requested as follows:

 

#define IPID3_IRQ_NUM 510

np = of_find_node_by_name(NULL, "pic");

irqhost = irq_find_host(np);

vipi = irq_find_mapping(irqhost, IPID3_IRQ_NUM);

    if (NO_IRQ == vipi) {

        vipi = irq_create_mapping(irqhost, IPID3_IRQ_NUM);

}

request_irq(IPID3_IRQ_NUM, follow_dsp_isr, IRQF_NO_SUSPEND, "follow_dsp_isr", NULL);

And it works well on SDK1.6.

When we use the same code on SDK2.0,the problem occurs.After irq requests,we use “cat /proc/intterupts”to find as follows:

510: 0   0   0   0    0    0    0    0   OpenPIC   510 Edge dsp_isr

When DSP writes 1 to the MPIC_IPIDR3 register,linux kernel can no longer receive interrupts.

So I'd like to ask you a question. If we don’t use device tree,how do I calculate the irq number? And is anyting different between SDK1.6 and SDK2.0 in the irq registration?

Best Regards

yun

标签 (1)
0 项奖励
1 回复

2,082 次查看
yipingwang
NXP TechSupport
NXP TechSupport

request_irq takes Linux IRQ numbers instead of hwirq.

irq_create_mappinq() should be called to map hwirq to virq. before request_irq.
Here is a piece of code:    
 int virq;    virq = irq_create_mapping(NULL, 17);
 result=request_irq(virq, irqhandler, IRQF_DISABLED, "irq1", NULL) 

Mappings are added to the irq_domain by calling irq_create_mapping() which accepts the irq_domain and a hwirq number as arguments.

0 项奖励