Getting information from the device tree and requesting irq

烈酒焚心 提交于 2019-12-11 19:29:12

问题


Context

In the device tree I am using, in one of its node, the filed interrupts is:

interrupts = <0x0 0x1d 0x4>;

(from a device tree of a Pynq board, equipaged with a ZYnq device with a dual-core ARM A9 )

Now, in the device tree .probe function, I use the Linux kernel API:

irq_line = platform_get_irq(pdev, 0);

in order to get the irq to use for the function request_irq (described in ldd3 chapter 10).

Ones the irq_line = platform_get_irq(pdev, 0); is executed, I get the value 0x2e that DOESN'T match with the fields of the interrupts of the device tree.

Questions

  1. What are exactly the <0x0 0x1d 0x4> numbers? I know that, in according to elinux.org,:

interrupts - A property of a device node containing a list of interrupt specifiers, one for each interrupt output signal on the device.

  1. How can I get the irq line to use (maybe starting from these numbers)? Is the irq line related to the device tree?

  2. Why am I getting a value that doesn't match with no one of the fields of interrupts?

I am sure I am misunderstanding some important topics, I am sorry. And thank you for reading the question and sharing your knowledge.


回答1:


What are exactly the <0x0 0x1d 0x4> numbers? I know that, in according to elinux.org, (interrupts = <0x0 0x1d 0x4>;)

Firstly you need to look at the interrupt-parent of the device node, this parent will #interrupt-cells property which specifies number of bits needed to encode a interrupt source, so from your entry interrupts = <0x0 0x1d 0x4>; means the following:

0x0  = shared processor interrupts
0x1d = interrupt number
0x4  = active high level-sensitive/[IRQ_TYPE_LEVEL_HIGH][2] 

How can I get the irq line to use (maybe starting from these numbers)? Is the irq line related to the device tree?

Why am I getting a value that doesn't match with no one of the fields of interrupts?

Its well answered here also refer this.



来源:https://stackoverflow.com/questions/48665718/getting-information-from-the-device-tree-and-requesting-irq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!