[PATCH 05/23] hw/ppc/e500: Add missing device tree properties to i2c controller node

Bernhard Beschow posted 23 patches 4 weeks, 1 day ago
There is a newer version of this series
[PATCH 05/23] hw/ppc/e500: Add missing device tree properties to i2c controller node
Posted by Bernhard Beschow 4 weeks, 1 day ago
When compiling a decompiled device tree blob created with dumpdtb, dtc complains
with:

  /soc@e0000000/i2c@3000: incorrect #address-cells for I2C bus
  /soc@e0000000/i2c@3000: incorrect #size-cells for I2C bus

Fix this by adding the missing device tree properties.

Signed-off-by: Bernhard Beschow <shentey@gmail.com>
---
 hw/ppc/e500.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
index 228287b457..e2a4f265a5 100644
--- a/hw/ppc/e500.c
+++ b/hw/ppc/e500.c
@@ -196,6 +196,8 @@ static void dt_i2c_create(void *fdt, const char *soc, const char *mpic,
     qemu_fdt_setprop_cells(fdt, i2c, "cell-index", 0);
     qemu_fdt_setprop_cells(fdt, i2c, "interrupts", irq0, 0x2);
     qemu_fdt_setprop_phandle(fdt, i2c, "interrupt-parent", mpic);
+    qemu_fdt_setprop_cell(fdt, i2c, "#size-cells", 0);
+    qemu_fdt_setprop_cell(fdt, i2c, "#address-cells", 1);
     qemu_fdt_setprop_string(fdt, "/aliases", alias, i2c);
 
     g_free(i2c);
-- 
2.46.1
Re: [PATCH 05/23] hw/ppc/e500: Add missing device tree properties to i2c controller node
Posted by Cédric Le Goater 3 weeks, 6 days ago
On 9/23/24 11:29, Bernhard Beschow wrote:
> When compiling a decompiled device tree blob created with dumpdtb, dtc complains
> with:
> 
>    /soc@e0000000/i2c@3000: incorrect #address-cells for I2C bus
>    /soc@e0000000/i2c@3000: incorrect #size-cells for I2C bus
> 
> Fix this by adding the missing device tree properties.
> 
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>


Reviewed-by: Cédric Le Goater <clg@redhat.com>

Thanks,

C.


> ---
>   hw/ppc/e500.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c
> index 228287b457..e2a4f265a5 100644
> --- a/hw/ppc/e500.c
> +++ b/hw/ppc/e500.c
> @@ -196,6 +196,8 @@ static void dt_i2c_create(void *fdt, const char *soc, const char *mpic,
>       qemu_fdt_setprop_cells(fdt, i2c, "cell-index", 0);
>       qemu_fdt_setprop_cells(fdt, i2c, "interrupts", irq0, 0x2);
>       qemu_fdt_setprop_phandle(fdt, i2c, "interrupt-parent", mpic);
> +    qemu_fdt_setprop_cell(fdt, i2c, "#size-cells", 0);
> +    qemu_fdt_setprop_cell(fdt, i2c, "#address-cells", 1);
>       qemu_fdt_setprop_string(fdt, "/aliases", alias, i2c);
>   
>       g_free(i2c);