* [PATCH 0/2] hw/arm/virt: fix dtb nits spotted by dtc @ 2022-05-13 13:13 Peter Maydell 2022-05-13 13:13 ` [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name Peter Maydell 2022-05-13 13:13 ` [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node Peter Maydell 0 siblings, 2 replies; 5+ messages in thread From: Peter Maydell @ 2022-05-13 13:13 UTC (permalink / raw) To: qemu-arm, qemu-devel If you dump the DTB generated by the virt board using -machine dumpdtb=file.dtb and then decompile it with dtc -I dtb -O dts -o file.dts file.dtb dtc will complain about some harmless but wrong constructs in the dtb: Warning (unique_unit_address): /flash@0: duplicate unit-address (also used in node /secflash@0) Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property This series fixes those nits. thanks -- PMM Peter Maydell (2): hw/arm/virt: Fix incorrect non-secure flash dtb node name hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node hw/arm/virt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.25.1 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name 2022-05-13 13:13 [PATCH 0/2] hw/arm/virt: fix dtb nits spotted by dtc Peter Maydell @ 2022-05-13 13:13 ` Peter Maydell 2022-05-13 15:35 ` Richard Henderson 2022-05-13 13:13 ` [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node Peter Maydell 1 sibling, 1 reply; 5+ messages in thread From: Peter Maydell @ 2022-05-13 13:13 UTC (permalink / raw) To: qemu-arm, qemu-devel In the virt board with secure=on we put two nodes in the dtb for flash devices: one for the secure-only flash, and one for the non-secure flash. We get the reg properties for these correct, but in the DT node name, which by convention includes the base address of devices, we used the wrong address. Fix it. Spotted by dtc, which will complain Warning (unique_unit_address): /flash@0: duplicate unit-address (also used in node /secflash@0) if you dump the dtb from QEMU with -machine dumpdtb=file.dtb and then decompile it with dtc. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- hw/arm/virt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 1a45f44435e..587e885a98c 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1195,7 +1195,7 @@ static void virt_flash_fdt(VirtMachineState *vms, qemu_fdt_setprop_string(ms->fdt, nodename, "secure-status", "okay"); g_free(nodename); - nodename = g_strdup_printf("/flash@%" PRIx64, flashbase); + nodename = g_strdup_printf("/flash@%" PRIx64, flashbase + flashsize); qemu_fdt_add_subnode(ms->fdt, nodename); qemu_fdt_setprop_string(ms->fdt, nodename, "compatible", "cfi-flash"); qemu_fdt_setprop_sized_cells(ms->fdt, nodename, "reg", -- 2.25.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name 2022-05-13 13:13 ` [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name Peter Maydell @ 2022-05-13 15:35 ` Richard Henderson 0 siblings, 0 replies; 5+ messages in thread From: Richard Henderson @ 2022-05-13 15:35 UTC (permalink / raw) To: Peter Maydell, qemu-arm, qemu-devel On 5/13/22 06:13, Peter Maydell wrote: > In the virt board with secure=on we put two nodes in the dtb > for flash devices: one for the secure-only flash, and one > for the non-secure flash. We get the reg properties for these > correct, but in the DT node name, which by convention includes > the base address of devices, we used the wrong address. Fix it. > > Spotted by dtc, which will complain > Warning (unique_unit_address): /flash@0: duplicate unit-address (also used in node /secflash@0) > if you dump the dtb from QEMU with -machine dumpdtb=file.dtb > and then decompile it with dtc. > > Signed-off-by: Peter Maydell<peter.maydell@linaro.org> > --- > hw/arm/virt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~ ^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node 2022-05-13 13:13 [PATCH 0/2] hw/arm/virt: fix dtb nits spotted by dtc Peter Maydell 2022-05-13 13:13 ` [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name Peter Maydell @ 2022-05-13 13:13 ` Peter Maydell 2022-05-13 15:36 ` Richard Henderson 1 sibling, 1 reply; 5+ messages in thread From: Peter Maydell @ 2022-05-13 13:13 UTC (permalink / raw) To: qemu-arm, qemu-devel The virt board generates a gpio-keys node in the dtb, but it incorrectly gives this node #size-cells and #address-cells properties. If you dump the dtb with 'machine dumpdtb=file.dtb' and run it through dtc, dtc will warn about this: Warning (avoid_unnecessary_addr_size): /gpio-keys: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property Remove the bogus properties. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- hw/arm/virt.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 587e885a98c..097238faa7a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -925,8 +925,6 @@ static void create_gpio_keys(char *fdt, DeviceState *pl061_dev, qemu_fdt_add_subnode(fdt, "/gpio-keys"); qemu_fdt_setprop_string(fdt, "/gpio-keys", "compatible", "gpio-keys"); - qemu_fdt_setprop_cell(fdt, "/gpio-keys", "#size-cells", 0); - qemu_fdt_setprop_cell(fdt, "/gpio-keys", "#address-cells", 1); qemu_fdt_add_subnode(fdt, "/gpio-keys/poweroff"); qemu_fdt_setprop_string(fdt, "/gpio-keys/poweroff", -- 2.25.1 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node 2022-05-13 13:13 ` [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node Peter Maydell @ 2022-05-13 15:36 ` Richard Henderson 0 siblings, 0 replies; 5+ messages in thread From: Richard Henderson @ 2022-05-13 15:36 UTC (permalink / raw) To: Peter Maydell, qemu-arm, qemu-devel On 5/13/22 06:13, Peter Maydell wrote: > The virt board generates a gpio-keys node in the dtb, but it > incorrectly gives this node #size-cells and #address-cells > properties. If you dump the dtb with 'machine dumpdtb=file.dtb' > and run it through dtc, dtc will warn about this: > > Warning (avoid_unnecessary_addr_size):/gpio-keys: unnecessary #address-cells/#size-cells without "ranges" or child "reg" property > > Remove the bogus properties. > > Signed-off-by: Peter Maydell<peter.maydell@linaro.org> > --- > hw/arm/virt.c | 2 -- > 1 file changed, 2 deletions(-) Reviewed-by: Richard Henderson <richard.henderson@linaro.org> r~ ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-05-13 15:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2022-05-13 13:13 [PATCH 0/2] hw/arm/virt: fix dtb nits spotted by dtc Peter Maydell 2022-05-13 13:13 ` [PATCH 1/2] hw/arm/virt: Fix incorrect non-secure flash dtb node name Peter Maydell 2022-05-13 15:35 ` Richard Henderson 2022-05-13 13:13 ` [PATCH 2/2] hw/arm/virt: Drop #size-cells and #address-cells from gpio-keys dtb node Peter Maydell 2022-05-13 15:36 ` Richard Henderson
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).