AnsweredAssumed Answered

Howto access IRQ2 on a LS1046a

Question asked by Edelhard Becker on May 28, 2017
Latest reply on May 31, 2017 by Edelhard Becker

Hi all,

we're running a LS1046A-RDB and have to use (so far) external IRQ2 that should, according to the ref manual, be accessible at 165 of the GIC. We have the following entry in fsl-ls1046a-rdb.dts (inside the existing "&ifc { ... };"  section):

cpld: board-control@2,0 {
    compatible = "fsl,ls1046ardb-cpld";
    reg = <0x2 0x0 0x0010000>;
    interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_LOW>;
    interrupt-parent = <&gic>;
    status = "okay";

In our "probe(struct platform_device *dev)" function, the dev->dev.of_node is filled with the entry "board-control" from the device tree. But the following call always fails (despite we can see the entries from the device tree in /proc/device-tree/soc/ifc@1530000/board-control@2,0/ ! ):

struct device_node *node = of_find_node_by_name(NULL, "fsl,ls1046ardb-cpld");
if (node == NULL) {
    printk("Error node not found\n");

When i nevertheless try to map the IRQ hardcoded, of_irq_to_resource(dev->dev.of_node, 0, <MyIRQ>) always fails (tried for MyIRQ 165, (165 - 32) and 2).

Interestingly in the resource of the platform_device there is a IRQ: at dev->resource[1] we find IRQ 12. With 12 filled in for MyIRQ calling of_irq_to_resource() succeeds, we can request the IRQ and see

root@ls1046ardb:~# cat /proc/interrupts
[ ... ]
11: 0 0 0 0 GIC 75 Level fsl-ifc
12: 0 0 0 0 GIC 197 Edge fsl,ls1046ardb-cpld, IFC CPLD Hack Driver

I.e. it is mapped by the kernel to 197, which is 165+32?!

What is missing for IRQ2?

Thanks and greetings,