Skip to contentSkip to conversation

hw/ppc: e500: Add missing #address-cells and #size-cells in the eTSEC node

PATCH RESEND Applied Bin Meng 2 participants 2 messages Mar 11, 2021 – Mar 12, 2021

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH RESEND 1/1 hw/ppc: e500: Add missing #address-cells and #size-cells in the eTSEC node

From: Bin Meng <[email protected]>

Per devicetree spec v0.3 [1] chapter 2.3.5:

The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined. If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells.

These properties are currently missing, causing the <reg> property of the queue-group subnode to be incorrectly parsed using default values.

[1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf

Fixes fdfb7f2cdb2d ("e500: Add support for eTSEC in device tree")

---

 hw/ppc/e500.c | 2 ++
 1 file changed, 2 insertions(+)
hw/ppc/e500.c +2 -0
index 1d94485ac8..79467ac512 100644
@@ -237,6 +237,8 @@ static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
     qemu_fdt_setprop_string(fdt, node, "model", "eTSEC");
     qemu_fdt_setprop(fdt, node, "local-mac-address", etsec->conf.macaddr.a, 6);
     qemu_fdt_setprop_cells(fdt, node, "fixed-link", 0, 1, 1000, 0, 0);
+    qemu_fdt_setprop_cells(fdt, node, "#size-cells", 1);
+    qemu_fdt_setprop_cells(fdt, node, "#address-cells", 1);
 
     qemu_fdt_add_subnode(fdt, group);
     qemu_fdt_setprop_cells(fdt, group, "reg", mmio0, 0x1000);
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 9 lines · Bin Meng

From: Bin Meng <[email protected]>

Per devicetree spec v0.3 [1] chapter 2.3.5:

The #address-cells and #size-cells properties are not inherited from ancestors in the devicetree. They shall be explicitly defined. If missing, a client program should assume a default value of 2 for #address-cells, and a value of 1 for #size-cells.

Quoted 8 lines

These properties are currently missing, causing the <reg> property of the queue-group subnode to be incorrectly parsed using default values.

[1] https://github.com/devicetree-org/devicetree-specification/releases/download/v0.3/devicetree-specification-v0.3.pdf

Fixes fdfb7f2cdb2d ("e500: Add support for eTSEC in device tree")

Applied to ppc-for-6.0 (again), thanks.

Quoted 18 lines

---

 hw/ppc/e500.c | 2 ++
 1 file changed, 2 insertions(+)
hw/ppc/e500.c +2 -0
index 1d94485ac8..79467ac512 100644
@@ -237,6 +237,8 @@ static int create_devtree_etsec(SysBusDevice *sbdev, PlatformDevtreeData *data)
     qemu_fdt_setprop_string(fdt, node, "model", "eTSEC");
     qemu_fdt_setprop(fdt, node, "local-mac-address", etsec->conf.macaddr.a, 6);
     qemu_fdt_setprop_cells(fdt, node, "fixed-link", 0, 1, 1000, 0, 0);
+    qemu_fdt_setprop_cells(fdt, node, "#size-cells", 1);
+    qemu_fdt_setprop_cells(fdt, node, "#address-cells", 1);
 
     qemu_fdt_add_subnode(fdt, group);
     qemu_fdt_setprop_cells(fdt, group, "reg", mmio0, 0x1000);
Signature · 4 lines
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson