]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/riscv/virt: Use setprop_sized_cells for memory
authorJoel Stanley <joel@jms.id.au>
Wed, 4 Jun 2025 02:54:39 +0000 (12:24 +0930)
committerAlistair Francis <alistair.francis@wdc.com>
Fri, 4 Jul 2025 11:09:49 +0000 (21:09 +1000)
Use qemu_fdt_setprop_sized_cells to do the job of splitting the upper
and lower 32 bits across cells.

Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Message-ID: <20250604025450.85327-4-joel@jms.id.au>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/riscv/virt.c

index 5143a465555a377b91921a04760df159daa0bcd7..e074a296751aaefe54410bdba577bad0b4fa2740 100644 (file)
@@ -311,8 +311,7 @@ static void create_fdt_socket_memory(RISCVVirtState *s, int socket)
     size = riscv_socket_mem_size(ms, socket);
     mem_name = g_strdup_printf("/memory@%"HWADDR_PRIx, addr);
     qemu_fdt_add_subnode(ms->fdt, mem_name);
-    qemu_fdt_setprop_cells(ms->fdt, mem_name, "reg",
-        addr >> 32, addr, size >> 32, size);
+    qemu_fdt_setprop_sized_cells(ms->fdt, mem_name, "reg", 2, addr, 2, size);
     qemu_fdt_setprop_string(ms->fdt, mem_name, "device_type", "memory");
     riscv_socket_fdt_write_id(ms, mem_name, socket);
 }