您尚未登录。

楼主 #1 2020-03-23 16:42:37

Berron
会员
注册时间: 2020-03-23
已发帖子: 3
积分: 3

全志V3S Linux中断映射疑问

首先,这是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,为什么?
希望了解的朋友不吝指点一下,谢谢了。

离线

#2 2020-03-24 10:43:01

有梦的地方
会员
注册时间: 2020-03-17
已发帖子: 284
积分: 284

Re: 全志V3S Linux中断映射疑问

不懂,帮顶一下。

离线

#3 2020-03-27 11:23:43

sochip索智科技-全志代理商方案商
会员
注册时间: 2020-03-25
已发帖子: 61
积分: 61

Re: 全志V3S Linux中断映射疑问

请问一楼是用的官方的camdroid OS吗?

离线

#4 2020-03-27 16:21:28

metro
会员
注册时间: 2019-03-09
已发帖子: 442
积分: 486

Re: 全志V3S Linux中断映射疑问

建议楼主先看一下GIC的一些基本概念。我觉得这篇文章可以一看:linux kernel的中断子系统之(七):GIC代码分析

离线

楼主 #5 2020-03-28 18:39:02

Berron
会员
注册时间: 2020-03-23
已发帖子: 3
积分: 3

Re: 全志V3S Linux中断映射疑问

sochip索智科技-全志代理商方案商 说:

请问一楼是用的官方的camdroid OS吗?

不是,是主线内核4.14.1

离线

楼主 #6 2020-03-28 18:39:39

Berron
会员
注册时间: 2020-03-23
已发帖子: 3
积分: 3

Re: 全志V3S Linux中断映射疑问

metro 说:

建议楼主先看一下GIC的一些基本概念。我觉得这篇文章可以一看:linux kernel的中断子系统之(七):GIC代码分析

谢谢,我去看看

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn