qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/arm/virt: Fix PL061 node name and properties
@ 2020-05-19  8:49 Geert Uytterhoeven
  2020-05-21 16:59 ` Peter Maydell
  0 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2020-05-19  8:49 UTC (permalink / raw)
  To: Peter Maydell
  Cc: qemu-arm, Philippe Mathieu-Daudé, Geert Uytterhoeven,
	qemu-devel

Make the created node comply with the PL061 Device Tree bindings:
  - Use generic node name "gpio" instead of "pl061",
  - Add missing "#interrupt-cells" and "interrupt-controller"
    properties.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Split off from "[PATCH QEMU v2 2/5] ARM: PL061: Extract pl061_create_fdt()"
(https://lore.kernel.org/r/20200423090118.11199-3-geert+renesas@glider.be).
---
 hw/arm/virt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 7dc96abf72cf2b9a..99593d7bce4d85cb 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -818,13 +818,15 @@ static void create_gpio(const VirtMachineState *vms)
                                      qdev_get_gpio_in(vms->gic, irq));
 
     uint32_t phandle = qemu_fdt_alloc_phandle(vms->fdt);
-    nodename = g_strdup_printf("/pl061@%" PRIx64, base);
+    nodename = g_strdup_printf("/gpio@%" PRIx64, base);
     qemu_fdt_add_subnode(vms->fdt, nodename);
     qemu_fdt_setprop_sized_cells(vms->fdt, nodename, "reg",
                                  2, base, 2, size);
     qemu_fdt_setprop(vms->fdt, nodename, "compatible", compat, sizeof(compat));
     qemu_fdt_setprop_cell(vms->fdt, nodename, "#gpio-cells", 2);
     qemu_fdt_setprop(vms->fdt, nodename, "gpio-controller", NULL, 0);
+    qemu_fdt_setprop_cell(vms->fdt, nodename, "#interrupt-cells", 2);
+    qemu_fdt_setprop(vms->fdt, nodename, "interrupt-controller", NULL, 0);
     qemu_fdt_setprop_cells(vms->fdt, nodename, "interrupts",
                            GIC_FDT_IRQ_TYPE_SPI, irq,
                            GIC_FDT_IRQ_FLAGS_LEVEL_HI);
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-05-29  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-19  8:49 [PATCH] hw/arm/virt: Fix PL061 node name and properties Geert Uytterhoeven
2020-05-21 16:59 ` Peter Maydell
2020-05-22  8:29   ` Geert Uytterhoeven
2020-05-22  9:30     ` Peter Maydell
2020-05-22  9:46       ` Philippe Mathieu-Daudé
2020-05-29  8:01       ` Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).