Specifying interrupt information for devices
============================================ 1) Interrupt client nodes
------------------------- Nodes that describe devices which generate interrupts must contain an
"interrupts" property, an "interrupts-extended" property, or both. If both are
present, the latter should take precedence; the former may be provided simply
for compatibility with software that does not recognize the latter. These
properties contain a list of interrupt specifiers, one per output interrupt. The
format of the interrupt specifier is determined by the interrupt controller to
which the interrupts are routed; see section 2 below for details. Example:
interrupt-parent = <&intc1>;
interrupts = <5 0>, <6 0>; The "interrupt-parent" property is used to specify the controller to which
interrupts are routed and contains a single phandle referring to the interrupt
controller node. This property is inherited, so it may be specified in an
interrupt client node or in any of its parent nodes. Interrupts listed in the
"interrupts" property are always in reference to the node's interrupt parent. The "interrupts-extended" property is a special form for use when a node needs
to reference multiple interrupt parents. Each entry in this property contains
both the parent phandle and the interrupt specifier. "interrupts-extended"
should only be used when a device has multiple interrupt parents. Example:
interrupts-extended = <&intc1 5 1>, <&intc2 1 0>; 2) Interrupt controller nodes
----------------------------- A device is marked as an interrupt controller with the "interrupt-controller"
property. This is a empty, boolean property. An additional "#interrupt-cells"
property defines the number of cells needed to specify a single interrupt. It is the responsibility of the interrupt controller's binding to define the
length and format of the interrupt specifier. The following two variants are
commonly used: a) one cell
-----------
The #interrupt-cells property is set to 1 and the single cell defines the
index of the interrupt within the controller. Example: vic: intc@10140000 {
compatible = "arm,versatile-vic";
interrupt-controller;
#interrupt-cells = <1>;
reg = <0x10140000 0x1000>;
}; sic: intc@10003000 {
compatible = "arm,versatile-sic";
interrupt-controller;
#interrupt-cells = <1>;
reg = <0x10003000 0x1000>;
interrupt-parent = <&vic>;
interrupts = <31>; /* Cascaded to vic */
}; b) two cells
------------
The #interrupt-cells property is set to 2 and the first cell defines the
index of the interrupt within the controller, while the second cell is used
to specify any of the following flags:
- bits[3:0] trigger type and level flags
1 = low-to-high edge triggered
2 = high-to-low edge triggered
4 = active high level-sensitive
8 = active low level-sensitive Example: i2c@7000c000 {
gpioext: gpio-adnp@41 {
compatible = "ad,gpio-adnp";
reg = <0x41>; interrupt-parent = <&gpio>;
interrupts = <160 1>; gpio-controller;
#gpio-cells = <1>; interrupt-controller;
#interrupt-cells = <2>; nr-gpios = <64>;
}; sx8634@2b {
compatible = "smtc,sx8634";
reg = <0x2b>; interrupt-parent = <&gpioext>;
interrupts = <3 0x8>; #address-cells = <1>;
#size-cells = <0>; threshold = <0x40>;
sensitivity = <7>;
};
};

reference

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

心得

interrupts 裡面填的 interrupt number 是指 interrupt parent (interrupt controller)的 第 index interrupt 。

[device tree] interrupt的更多相关文章

  1. [device tree] interrupt mapping example

    This is for Devicetree Specification Release 0.1 Interrupt Mapping Example p19 在講解前,先帶進一些 PCI 的基礎觀念 ...

  2. Device Tree Usage( DTS文件语法)

    http://elinux.org/Device_Tree_Usage Device Tree Usage     Top Device Tree page This page walks throu ...

  3. Device Tree Usage(理解DTS文件语法)

    Basic Data Format The device tree is a simple tree structure of nodes and properties. Properties are ...

  4. Device Tree Usage 【转】

    转自:http://blog.chinaunix.net/uid-20522771-id-3457184.html 原文链接:http://devicetree.org/Device_Tree_Usa ...

  5. Device Tree(二):基本概念

    转自:http://www.wowotech.net/linux_kenrel/dt_basic_concept.html 一.前言 一些背景知识(例如:为何要引入Device Tree,这个机制是用 ...

  6. Linux and the Device Tree

    来之\kernel\Documentation\devicetree\usage-model.txt Linux and the Device Tree ----------------------- ...

  7. Device Tree(三):代码分析【转】

    转自:http://www.wowotech.net/linux_kenrel/dt-code-analysis.html Device Tree(三):代码分析 作者:linuxer 发布于:201 ...

  8. ARM Linux 3.x的设备树(Device Tree)

    http://blog.csdn.net/21cnbao/article/details/8457546 宋宝华 Barry Song <21cnbao@gmail.com> 1.     ...

  9. ARM Linux 3.x的设备树(Device Tree)

    1. ARM Device Tree起源 Linus Torvalds在2011年3月17日的ARM Linux邮件列表宣称“this whole ARM thing is a f*cking pai ...

随机推荐

  1. iOS-UI控件概述

    IBAction和IBOutlet,UIView 1 @interface ViewController : UIViewController 2 3 @property(nonatomic, wea ...

  2. Springboot @Transactional 事务不回滚

    一.异常捕获的原因 这里Exception异常,他又分为运行时异常RuntimeException和非运行时异常 可查的异常(checked exceptions):Exception下除了Runti ...

  3. 【题解】Atcoder AGC#03 E-Sequential operations on Sequence

    仙题膜拜系列...首先我们可以发现:如果在截取了一段大的区间之后再截取一段小的区间,显然是没有什么用的.所以我们可以将操作序列变成单调递增的序列. 然后怎么考虑呢?启示:不一定要考虑每一个数字出现的次 ...

  4. [CF1037H] Security

    题目链接 codeforces. 洛谷. Solution 按照套路,可以\(SAM\)上线段树合并求出\(endpos\)集合,然后随便贪心一下就好了. #include<bits/stdc+ ...

  5. LOJ6354 & 洛谷4366:[Code+#4]最短路——题解

    https://loj.ac/problem/6354 https://www.luogu.org/problemnew/show/P4366 题面见上面. 这题很妙,且可能是我傻,感觉这题不太好想. ...

  6. HDOJ.1051 Wooden Sticks (贪心)

    Wooden Sticks 点我挑战题目 题意分析 给出T组数据,每组数据有n对数,分别代表每个木棍的长度l和重量w.第一个木棍加工需要1min的准备准备时间,对于刚刚经加工过的木棍,如果接下来的木棍 ...

  7. Eclipse的Project Facets属性设置解决项目无故报错

    新检出项目,发现代码无故报错,各种尝试,最终发现是因为  项目右键中的 project Facets 属性中的 java 后面的 version 版本和项目 build path 的 jdk 版本不一 ...

  8. bzoj 1068 [SCOI2007]压缩 区间dp

    [SCOI2007]压缩 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 1644  Solved: 1042[Submit][Status][Discu ...

  9. 【JAVA】Pattern和Matcher

    ZZ: Java正则表达式:Pattern类和Matcher类 一.捕获组的概念 捕获组可以通过从左到右计算其开括号来编号,编号是从1 开始的.例如,在表达式 ((A)(B(C)))中,存在四个这样的 ...

  10. Nginx+Tomcat关于Session的管理

    前言 Nginx+Tomcat对Session的管理一直有了解,但是一直没有实际操作一遍,本文从最简单的安装启动开始,通过实例的方式循序渐进的介绍了几种管理session的方式. nginx安装配置 ...