how to use ls1046a ifc irq

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

how to use ls1046a ifc irq

440 次查看
2sanghaesea
Contributor II

Hi We have designed a custom LS1046A based board.

I want to make a kernel driver that processes interrupt signals in cpld(fpga).

But, it is not registered as shown in the result of insmod below.

What should I do in this situation? 

I'll be waiting for your answer

insmod result :
[ 490.674493] FPGA driver probed
[ 490.678134] Mapped IRQ: 20
[ 490.680892] genirq: Setting trigger mode 8 for irq 20 failed (gic_set_type+0x0/0xb0)
[ 490.688753] Failed to request FPGA interrupt
[ 490.693063] test_driver: probe of 7fb00000.board-control failed with error -22

 

 

kernel device tree

&ifc {
#address-cells = <2>;
#size-cells = <1>;
/* NAND Flashe and CPLD on board */
 
ranges = <0x0 0x0 0x0 0x7e800000 0x00010000
0x2 0x0 0x0 0x7fb00000 0x0000100>;
 
status = "okay";
 
nand@0,0 {
compatible = "fsl,ifc-nand";
reg = <0x0 0x0 0x10000>;
};
 
fpga: board-control@2,0 {
compatible = "fsl,ls1046ardb-cpld";
reg = <0x2 0x0 0x0008000>;
interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_LOW>;
interrupt-parent = <&gic>;
status = "okay";
};
};
 
driver probe code
   test_base = devm_ioremap_resource(&pdev->dev, &pdev->resource[0]);
    if (IS_ERR(test_base))
    {
        pr_err("Failed to remap FPGA memory\n");
        return PTR_ERR(test_base);
    }

    node = of_find_compatible_node(NULL, NULL, "fsl,ls1046ardb-cpld");
    if (!node)
    {
        pr_err("Error: FPGA device tree node not found\n");
        return -ENODEV;
    }
    irq_number = of_irq_get(node, 0);
    if (irq_number < 0)
    {
        pr_err("Failed to get IRQ from device tree\n");
        return irq_number;
    }
    pr_info("Mapped IRQ: %d\n", irq_number);
   
    ret = request_irq(irq_number , test_irq_handler, IRQF_TRIGGER_LOW, "test_irq", pdev);
    if (ret)
    {
        pr_err("Failed to request FPGA interrupt\n");
        return ret;
    }
 
 
Best regards,
2sanghaesea
0 项奖励
回复
1 回复

384 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please refer to arch/powerpc/platforms/85xx/corenet_generic.c and arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts

0 项奖励
回复