qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [COMMIT 4b0c7aa] microblaze: Fix loading of petalogix s3a


From: Anthony Liguori
Subject: [Qemu-commits] [COMMIT 4b0c7aa] microblaze: Fix loading of petalogix s3adsp1800 dtb.
Date: Mon, 08 Jun 2009 13:03:15 -0000

From: Edgar E. Iglesias <address@hidden>

Provide a petalogix-s3adsp1800.dtb blob.
Correct loading of the petalogix dtb.

Signed-off-by: Edgar E. Iglesias <address@hidden>

diff --git a/Makefile b/Makefile
index d7b9985..601a97d 100644
--- a/Makefile
+++ b/Makefile
@@ -271,7 +271,7 @@ ifdef INSTALL_BLOBS
 BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \
 video.x openbios-sparc32 openbios-sparc64 openbios-ppc \
 pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \
-bamboo.dtb
+bamboo.dtb petalogix-s3adsp1800.dtb
 else
 BLOBS=
 endif
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c
index 80097df..9ccd12b 100644
--- a/hw/petalogix_s3adsp1800_mmu.c
+++ b/hw/petalogix_s3adsp1800_mmu.c
@@ -54,22 +54,20 @@ static int petalogix_load_device_tree(target_phys_addr_t 
addr,
 {
 #ifdef HAVE_FDT
     void *fdt;
-    char *path = NULL;
-    int pathlen;
     int r;
 #endif
+    char *path;
     int fdt_size;
 
 #ifdef HAVE_FDT
     /* Try the local "mb.dtb" override.  */
     fdt = load_device_tree("mb.dtb", &fdt_size);
     if (!fdt) {
-        pathlen = snprintf(NULL, 0, "%s/%s",
-                           bios_dir, BINARY_DEVICE_TREE_FILE) + 1;
-        path = qemu_malloc(pathlen);
-        snprintf(path, pathlen, "%s/%s", bios_dir, BINARY_DEVICE_TREE_FILE);
-        fdt = load_device_tree(BINARY_DEVICE_TREE_FILE, &fdt_size);
-        free(path);
+        path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+        if (path) {
+            fdt = load_device_tree(path, &fdt_size);
+            qemu_free(path);
+        }
         if (!fdt)
             return 0;
     }
@@ -83,7 +81,11 @@ static int petalogix_load_device_tree(target_phys_addr_t 
addr,
        to the kernel.  */
     fdt_size = load_image_targphys("mb.dtb", addr, 0x10000);
     if (fdt_size < 0) {
-        fdt_size = load_image_targphys(BINARY_DEVICE_TREE_FILE, addr, 0x10000);
+        path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
+        if (path) {
+            fdt_size = load_image_targphys(path, addr, 0x10000);
+           qemu_free(path);
+        }
     }
 
     if (kernel_cmdline) {
diff --git a/pc-bios/petalogix-s3adsp1800.dtb b/pc-bios/petalogix-s3adsp1800.dtb
new file mode 100644
index 0000000..93c5973
Binary files /dev/null and b/pc-bios/petalogix-s3adsp1800.dtb differ




reply via email to

[Prev in Thread] Current Thread [Next in Thread]