从设备树获取信息并请求irq [英] Getting information from the device tree and requesting irq

查看:665
本文介绍了从设备树获取信息并请求irq的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我正在使用的设备树中的一个节点中,字段interrupts是:

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

interrupts = <0x0 0x1d 0x4>;

(来自Pynq板的设备树,配备有具有双核ARM A9的ZYnq设备)

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

现在,在设备树.probe函数中,我使用Linux内核API:

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

irq_line = platform_get_irq(pdev, 0);

,以获取要用于函数request_irq的irq(在 ldd3 <中进行了描述/a>第10章).

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

执行irq_line = platform_get_irq(pdev, 0);的一个,得到的值0x2e与设备树的interrupts的字段不匹配.

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.

  1. <0x0 0x1d 0x4>的确切数字是什么?我知道,根据 elinux.org ,:
  1. What are exactly the <0x0 0x1d 0x4> numbers? I know that, in according to elinux.org,:

interrupts(中断)-设备节点的属性,其中包含一系列中断说明符,设备上的每个中断输出信号一个.

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

  1. 如何获取 irq行以使用(也许从这些数字开始)? irq行与设备树相关吗?

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

为什么我得到的值与interrupts的任何一个字段都不匹配?

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.

推荐答案

什么是< 0x0 0x1d 0x4>数字?我知道,根据 到elinux.org,(中断=< 0x0 0x1d 0x4>;)

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

首先,您需要查看设备节点的中断父对象,该父节点将#interrupt-cells属性,该属性指定对中断源进行编码所需的位数,因此从您的条目开始,中断=< 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] 

我该如何使用irq行(也许从这些数字开始)? irq线与设备树相关吗?

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.

这篇关于从设备树获取信息并请求irq的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆