页次: 1
建议楼主先看一下GIC的一些基本概念。我觉得这篇文章可以一看:linux kernel的中断子系统之(七):GIC代码分析。
谢谢,我去看看
首先,这是v3s的中断控制器设备树:
interrupt-controller@01c81000 {
compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic";
reg = <0x1c81000 0x1000 0x1c82000 0x1000 0x1c84000 0x2000 0x1c86000 0x2000>;
interrupt-controller;
#interrupt-cells = <0x3>;
interrupts = <0x1 0x9 0xf04>;
linux,phandle = <0x1>;
phandle = <0x1>;
};
我看到v3s的设备树中SPI中断是这样设置的:
interrupts = <0x0 0x41 0x4>;
然后spi-sun6i.c中
irq = platform_get_irq(pdev, 0);
获取的中断号是0x23。
我不明白设备树中的中断号跟platform_get_irq获取的中断号之间的映射关系是怎样的。查了Documentation/devicetree/bindings/interrupt-controller/arm,gic.txt说interrupts属性的第二个参数是中断号:
The 1st cell is the interrupt type; 0 for SPI interrupts, 1 for PPI
interrupts.
The 2nd cell contains the interrupt number for the interrupt type.
SPI interrupts are in the range [0-987]. PPI interrupts are in the
range [0-15].
The 3rd cell is the flags
所以,interrupts = <0x0 0x41 0x4>的中断号是0x23,为什么?
希望了解的朋友不吝指点一下,谢谢了。
页次: 1