Skip to content

Full DT IRQ support for versatile

Grant Likely linux-arm-kernel linux-devicetree 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2versatile: sic: add device tree bindings+0 -01 reply
1/2versatile: sic: add device tree bindings+0 -01 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Full DT IRQ support for versatile
Quoted 49 lines · Jamie Iles
Quoted 12 lines · Grant Likely
Quoted 10 lines · Jamie Iles

These patches move versatile over to instantiating both interrupt controllers from the device tree. ?I've tested this in qemu for both DT and non-DT platforms but only with an initramfs. ?I've seen interrupts generated on both controllers for both boot methods.

Grant, Rob, this makes use of irqdomain again as I'm not sure what the replacement is going to look like yet. ?versatile works with DT in mainline, but that's kind of lucky... ?I know there's been patches to make irq_domain_add_simple() return the irq_domain and can rebase if needed.

Quoted 4 lines

I posted the patches for finishing up irq_domain migration yesterday. irq_domain_add_simple() can trivially be changed to irq_domain_add_legacy. I'll try out these
patches on top of my irqdomain/next branch

Excellent! I've just grabbed your branch and given it a spin. I fixed up my patches with the patch below and had to revert "irqdesc:
Consolidate irq reservation logic" as I saw Rob mentioned as I was getting negative irq_desc's allocated but otherwise it works nicely!

I've also tested your tree with the irqdesc patch reverted on picoxcell and that's working nicely too!

Jamie

8<----

arch/arm/plat-versatile/fpga-irq.c +3 -4
index fd87b06..c4dac93 100644
@@ -59,10 +59,9 @@ void __init fpga_irq_init(int parent_irq, u32 valid, struct fpga_irq_data *f)
 	f->chip.irq_ack = fpga_irq_mask;
 	f->chip.irq_mask = fpga_irq_mask;
 	f->chip.irq_unmask = fpga_irq_unmask;
-	f->domain.irq_base = f->irq_start;
-	f->domain.nr_irq = 32;
-	f->domain.ops = &irq_domain_simple_ops;
-	irq_domain_add(&f->domain);
+	if (!f->domain)
+		f->domain = irq_domain_add_legacy(NULL, 32, f->irq_start,
+						  0, &irq_domain_simple_ops);
 
 	if (parent_irq != -1) {
 		irq_set_handler_data(parent_irq, f);

arch/arm/plat-versatile/fpga-irq.c int __init sic_of_init(struct device_node *np, struct device_node *parent) · line 106

Quoted 6 lines
arch/arm/plat-versatile/fpga-irq.c +2 -1
@@ -103,7 +102,8 @@ int __init sic_of_init(struct device_node *np, struct device_node *parent)
 		err = sic_data->irq_start;
 		goto out_unmap;
 	}
-	sic_data->domain.of_node = of_node_get(np);
+	sic_data->domain = irq_domain_add_legacy(np, 32, sic_data->irq_start,
+						 0, &irq_domain_simple_ops);

For the DT use-case, you should try irq_domain_add_linear(np, 32); which makes the controller use irqs allocated only when they are requested.