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
CPU0 CPU1 CPU2 CPU3
[ ... ]
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,
Edelhard
Solved! Go to Solution.
NXP SDK for LS1046a does not declare IRQ2 interrupt in DTS file. This SDK supports sysfs for GPIO using as interrupt source. Perhaps this possibility can be used for your task. If IRQ2 is needed, see attached files.
It looks like that
interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_LOW>;
property should be added.
property is calculated as "Internal interrupt ID" - 32
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
NXP SDK for LS1046a does not declare IRQ2 interrupt in DTS file. This SDK supports sysfs for GPIO using as interrupt source. Perhaps this possibility can be used for your task. If IRQ2 is needed, see attached files.
It looks like that
interrupts = <GIC_SPI 165 IRQ_TYPE_LEVEL_LOW>;
property should be added.
property is calculated as "Internal interrupt ID" - 32
Have a great day,
Pavel Chubakov
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks Pavel, it is working now with IRQ2 (no GPIO workaround needed). Device tree entry is
interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_LOW>;
and linux reports:
CPU0 CPU1 CPU2 CPU3 12: 3 0 0 0 GIC 165 Level IFC CPLD Hack Driver
Greetings,
Edelhard
Addendum: however we try to request_irq() (or devm_request_irq()), it always fails in irq_to_desc(). It seems the kernel does not have 165 (and 133) in its irq_desc list. Isn't this created by the device tree?
Thanks again,
Edelhard