diff options
author | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2009-06-03 21:54:31 +0200 |
---|---|---|
committer | Edgar E. Iglesias <edgar.iglesias@gmail.com> | 2009-06-03 21:54:31 +0200 |
commit | 4b0c7aa3647d8d273395ff1e6176850e61f2d331 (patch) | |
tree | ee423f5bec9d21c1baa223573ea25f4ab5322eae /hw | |
parent | 40905a6a31f6dd1904f54ea48763c5fbe745bafa (diff) |
microblaze: Fix loading of petalogix s3adsp1800 dtb.
Provide a petalogix-s3adsp1800.dtb blob.
Correct loading of the petalogix dtb.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/petalogix_s3adsp1800_mmu.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/hw/petalogix_s3adsp1800_mmu.c b/hw/petalogix_s3adsp1800_mmu.c index 80097df818..9ccd12b9d7 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) { |