步骤2: 通过报错提示关键字在内核源码搜索到irq_of_parse_and_map函数报出的问题。 步骤3: 通过打印内核信息来查看原因 image.png image.png 步骤4: 进行分析:原因是irq在加载一次后变成了both边沿触发。而我设备树中添加的type=1是上升沿触发。 为什么会变成both呢? 步骤5: 修改驱动bug,request_irq的第三个参...
通常,一个普通设备的device tree node已经描述了足够的中断信息,在这种情况下,该设备的驱动在初始化的时候可以调用irq_of_parse_and_map这个接口函数进行该device node中和中断相关的内容(interrupts和interrupt-parent属性)进行分析,并建立映射关系,具体代码如下: unsigned int irq_of_parse_and_map(struct device_node...
> IRQ编号可以通过irq_of_parse_and_map()获得(如您所述);此函数不仅返回IRQ号,还存储IRQ号的IRQ标志(最终通过调用irqd_set_trigger_type());存储的IRQ标志将在devm_request_irq()中自动使用,如果您没有向其传递IRQ触发器类型(例如,您可以传递flags = 0) > IRQ标志可以在irq_get_trigger_type()获得,但...
通常,一个普通设备的device tree node已经描述了足够的中断信息,在这种情况下,该设备的驱动在初始化的时候可以调用irq_of_parse_and_map这个接口函数进行该device node中和中断相关的内容(interrupts和interrupt-parent属性)进行分析,并建立映射关系,具体代码如下: unsigned int irq_of_parse_and_map(struct device_node...
extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data); 通常,一个普通设备的device tree node已经描述了足够的中断信息,在这种情况下,该设备的驱动在初始化的时候可以调用irq_of_parse_and_map这个接口函数进行该device node中和中断相关的内容(interrupts和interrupt-parent属性)进行分析,并...
The irq_of_parse_and_map() returns 0 on failure, not a negative ERRNO. Fixes: f48e699 ("irqchip/aspeed-i2c-ic: Add I2C IRQ controller for Aspeed") Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore....
-> irq_of_parse_and_map(child,0);//将中断解析并映射到linux virq空间( -> of_node_get(child);//将OF节点与设备结构相关联 -> phy->dev.of_node = child; -> phy_device_register(phy)// 注册phy设备 ->if(phydev->bus->phy_map[phydev->addr])//判断PHY是否已经注册了 ...
当开机之后,内核会自动将dts全部解析,然后会进行填充,对于中断使用如下函数进行解析dts,然后map 代码语言:javascript 复制 unsigned intirq_of_parse_and_map(struct device_node*dev,int index){struct of_phandle_args oirq;if(of_irq_parse_one(dev,index,&oirq))return0;returnirq_create_of_mapping(&oirq...
irq_domain_set_hwirq_and_chip 函数kernel/irq/irqdomain.c 从父到子创建。实际顺序是反的。alloc先从子到父。。 pci设备的MSI中断hwirq和virq的创建: irq-gic-v3-its-pci-msi.c中的接口调用: 这个3145732 hwirq在函数drivers/pci/msi.c:pci_msi_domain_calc_hwirq中计算。__irq_domain_alloc_irqs下通...
* There are two sources of information we need to parse: * * 1. /proc/interrupts * 2. /proc/irq/$IRQ/smp_affinity * * We get the active IRQs and CPUs from /proc/interrupts. It also * contains the per-CPU IRQ counts and info we do not care about. ...