Commit 4b0c7aa3647d8d273395ff1e6176850e61f2d331
1 parent
40905a6a
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>
Showing
3 changed files
with
12 additions
and
10 deletions
Makefile
... | ... | @@ -271,7 +271,7 @@ ifdef INSTALL_BLOBS |
271 | 271 | BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ |
272 | 272 | video.x openbios-sparc32 openbios-sparc64 openbios-ppc \ |
273 | 273 | pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \ |
274 | -bamboo.dtb | |
274 | +bamboo.dtb petalogix-s3adsp1800.dtb | |
275 | 275 | else |
276 | 276 | BLOBS= |
277 | 277 | endif | ... | ... |
hw/petalogix_s3adsp1800_mmu.c
... | ... | @@ -54,22 +54,20 @@ static int petalogix_load_device_tree(target_phys_addr_t addr, |
54 | 54 | { |
55 | 55 | #ifdef HAVE_FDT |
56 | 56 | void *fdt; |
57 | - char *path = NULL; | |
58 | - int pathlen; | |
59 | 57 | int r; |
60 | 58 | #endif |
59 | + char *path; | |
61 | 60 | int fdt_size; |
62 | 61 | |
63 | 62 | #ifdef HAVE_FDT |
64 | 63 | /* Try the local "mb.dtb" override. */ |
65 | 64 | fdt = load_device_tree("mb.dtb", &fdt_size); |
66 | 65 | if (!fdt) { |
67 | - pathlen = snprintf(NULL, 0, "%s/%s", | |
68 | - bios_dir, BINARY_DEVICE_TREE_FILE) + 1; | |
69 | - path = qemu_malloc(pathlen); | |
70 | - snprintf(path, pathlen, "%s/%s", bios_dir, BINARY_DEVICE_TREE_FILE); | |
71 | - fdt = load_device_tree(BINARY_DEVICE_TREE_FILE, &fdt_size); | |
72 | - free(path); | |
66 | + path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE); | |
67 | + if (path) { | |
68 | + fdt = load_device_tree(path, &fdt_size); | |
69 | + qemu_free(path); | |
70 | + } | |
73 | 71 | if (!fdt) |
74 | 72 | return 0; |
75 | 73 | } |
... | ... | @@ -83,7 +81,11 @@ static int petalogix_load_device_tree(target_phys_addr_t addr, |
83 | 81 | to the kernel. */ |
84 | 82 | fdt_size = load_image_targphys("mb.dtb", addr, 0x10000); |
85 | 83 | if (fdt_size < 0) { |
86 | - fdt_size = load_image_targphys(BINARY_DEVICE_TREE_FILE, addr, 0x10000); | |
84 | + path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE); | |
85 | + if (path) { | |
86 | + fdt_size = load_image_targphys(path, addr, 0x10000); | |
87 | + qemu_free(path); | |
88 | + } | |
87 | 89 | } |
88 | 90 | |
89 | 91 | if (kernel_cmdline) { | ... | ... |
pc-bios/petalogix-s3adsp1800.dtb
0 → 100644
No preview for this file type