[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 09/10] hw/arm/virt: Fix devicetree warnings about the SMMU node
From: |
Jean-Philippe Brucker |
Subject: |
[PATCH 09/10] hw/arm/virt: Fix devicetree warnings about the SMMU node |
Date: |
Wed, 24 Aug 2022 16:51:13 +0100 |
dt-validate reports three issues in the SMMU device-tree node:
smmuv3@9050000: $nodename:0: 'smmuv3@9050000' does not match
'^iommu@[0-9a-f]*'
smmuv3@9050000: interrupt-names: 'oneOf' conditional failed, one must be
fixed:
['eventq', 'priq', 'cmdq-sync', 'gerror'] is too long
'combined' was expected
'gerror' was expected
'gerror' is not one of ['cmdq-sync', 'priq']
smmuv3@9050000: 'clock-names', 'clocks' do not match any of the regexes:
'pinctrl-[0-9]+'
From schema: linux/Documentation/devicetree/bindings/iommu/arm,smmu-v3.yaml
Fix them by:
* changing the node name
* reordering the IRQs
* removing the clock properties which are not expected for the SMMU node
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
---
hw/arm/virt.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/hw/arm/virt.c b/hw/arm/virt.c
index 779eb5ea31..de508d5329 100644
--- a/hw/arm/virt.c
+++ b/hw/arm/virt.c
@@ -1329,7 +1329,9 @@ static void create_smmu(const VirtMachineState *vms,
int i;
hwaddr base = vms->memmap[VIRT_SMMU].base;
hwaddr size = vms->memmap[VIRT_SMMU].size;
- const char irq_names[] = "eventq\0priq\0cmdq-sync\0gerror";
+ uint32_t irq_type = GIC_FDT_IRQ_TYPE_SPI;
+ uint32_t irq_trigger = GIC_FDT_IRQ_FLAGS_EDGE_LO_HI;
+ const char irq_names[] = "eventq\0gerror\0priq\0cmdq-sync";
DeviceState *dev;
MachineState *ms = MACHINE(vms);
@@ -1348,22 +1350,20 @@ static void create_smmu(const VirtMachineState *vms,
qdev_get_gpio_in(vms->gic, irq + i));
}
- node = g_strdup_printf("/smmuv3@%" PRIx64, base);
+ node = g_strdup_printf("/iommu@%" PRIx64, base);
qemu_fdt_add_subnode(ms->fdt, node);
qemu_fdt_setprop(ms->fdt, node, "compatible", compat, sizeof(compat));
qemu_fdt_setprop_sized_cells(ms->fdt, node, "reg", 2, base, 2, size);
qemu_fdt_setprop_cells(ms->fdt, node, "interrupts",
- GIC_FDT_IRQ_TYPE_SPI, irq , GIC_FDT_IRQ_FLAGS_EDGE_LO_HI,
- GIC_FDT_IRQ_TYPE_SPI, irq + 1, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI,
- GIC_FDT_IRQ_TYPE_SPI, irq + 2, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI,
- GIC_FDT_IRQ_TYPE_SPI, irq + 3, GIC_FDT_IRQ_FLAGS_EDGE_LO_HI);
+ irq_type, irq + SMMU_IRQ_EVTQ, irq_trigger,
+ irq_type, irq + SMMU_IRQ_GERROR, irq_trigger,
+ irq_type, irq + SMMU_IRQ_PRIQ, irq_trigger,
+ irq_type, irq + SMMU_IRQ_CMD_SYNC, irq_trigger);
qemu_fdt_setprop(ms->fdt, node, "interrupt-names", irq_names,
sizeof(irq_names));
- qemu_fdt_setprop_cell(ms->fdt, node, "clocks", vms->clock_phandle);
- qemu_fdt_setprop_string(ms->fdt, node, "clock-names", "apb_pclk");
qemu_fdt_setprop(ms->fdt, node, "dma-coherent", NULL, 0);
qemu_fdt_setprop_cell(ms->fdt, node, "#iommu-cells", 1);
--
2.37.1
- Re: [PATCH 03/10] hw/arm/virt: Fix devicetree warnings about the GIC node, (continued)
- [PATCH 06/10] hw/arm/virt: Fix devicetree warning about the gpio-key node, Jean-Philippe Brucker, 2022/08/24
- [PATCH 05/10] hw/arm/virt: Fix devicetree warning about the timer node, Jean-Philippe Brucker, 2022/08/24
- [PATCH 08/10] hw/arm/virt: Fix devicetree warnings about the GPIO node, Jean-Philippe Brucker, 2022/08/24
- [PATCH 04/10] hw/arm/virt: Use "msi-map" devicetree property for PCI, Jean-Philippe Brucker, 2022/08/24
- [PATCH 10/10] hw/arm/virt: Fix devicetree warnings about the virtio-iommu node, Jean-Philippe Brucker, 2022/08/24
- [PATCH 07/10] hw/arm/virt: Fix devicetree warnings about node names, Jean-Philippe Brucker, 2022/08/24
- [PATCH 09/10] hw/arm/virt: Fix devicetree warnings about the SMMU node,
Jean-Philippe Brucker <=