PPC: e500: dt: create memory node dynamically
authorAlexander Graf <agraf@suse.de>
Thu, 17 May 2012 09:34:50 +0000 (11:34 +0200)
committerAlexander Graf <agraf@suse.de>
Sat, 23 Jun 2012 23:04:47 +0000 (01:04 +0200)
Signed-off-by: Alexander Graf <agraf@suse.de>
hw/ppce500_mpc8544ds.c
pc-bios/mpc8544ds.dtb
pc-bios/mpc8544ds.dts

index 506ddf3..3ec9013 100644 (file)
@@ -88,10 +88,10 @@ static int mpc8544_load_device_tree(CPUPPCState *env,
     }
 
     /* Manipulate device tree in memory. */
-    ret = qemu_devtree_setprop(fdt, "/memory", "reg", mem_reg_property,
-                               sizeof(mem_reg_property));
-    if (ret < 0)
-        fprintf(stderr, "couldn't set /memory/reg\n");
+    qemu_devtree_add_subnode(fdt, "/memory");
+    qemu_devtree_setprop_string(fdt, "/memory", "device_type", "memory");
+    qemu_devtree_setprop(fdt, "/memory", "reg", mem_reg_property,
+                         sizeof(mem_reg_property));
 
     if (initrd_size) {
         ret = qemu_devtree_setprop_cell(fdt, "/chosen", "linux,initrd-start",
index c6d3021..db9fb70 100644 (file)
Binary files a/pc-bios/mpc8544ds.dtb and b/pc-bios/mpc8544ds.dtb differ
index 7eb3160..f46e9ed 100644 (file)
                #size-cells = <0>;
        };
 
-       memory {
-               device_type = "memory";
-               reg = <0x0 0x0>;        // Filled by U-Boot
-       };
-
        soc8544@e0000000 {
                #address-cells = <1>;
                #size-cells = <1>;