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,7 +271,7 @@ ifdef INSTALL_BLOBS | ||
271 | BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ | 271 | BLOBS=bios.bin vgabios.bin vgabios-cirrus.bin ppc_rom.bin \ |
272 | video.x openbios-sparc32 openbios-sparc64 openbios-ppc \ | 272 | video.x openbios-sparc32 openbios-sparc64 openbios-ppc \ |
273 | pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \ | 273 | pxe-ne2k_pci.bin pxe-rtl8139.bin pxe-pcnet.bin pxe-e1000.bin \ |
274 | -bamboo.dtb | 274 | +bamboo.dtb petalogix-s3adsp1800.dtb |
275 | else | 275 | else |
276 | BLOBS= | 276 | BLOBS= |
277 | endif | 277 | endif |
hw/petalogix_s3adsp1800_mmu.c
@@ -54,22 +54,20 @@ static int petalogix_load_device_tree(target_phys_addr_t addr, | @@ -54,22 +54,20 @@ static int petalogix_load_device_tree(target_phys_addr_t addr, | ||
54 | { | 54 | { |
55 | #ifdef HAVE_FDT | 55 | #ifdef HAVE_FDT |
56 | void *fdt; | 56 | void *fdt; |
57 | - char *path = NULL; | ||
58 | - int pathlen; | ||
59 | int r; | 57 | int r; |
60 | #endif | 58 | #endif |
59 | + char *path; | ||
61 | int fdt_size; | 60 | int fdt_size; |
62 | 61 | ||
63 | #ifdef HAVE_FDT | 62 | #ifdef HAVE_FDT |
64 | /* Try the local "mb.dtb" override. */ | 63 | /* Try the local "mb.dtb" override. */ |
65 | fdt = load_device_tree("mb.dtb", &fdt_size); | 64 | fdt = load_device_tree("mb.dtb", &fdt_size); |
66 | if (!fdt) { | 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 | if (!fdt) | 71 | if (!fdt) |
74 | return 0; | 72 | return 0; |
75 | } | 73 | } |
@@ -83,7 +81,11 @@ static int petalogix_load_device_tree(target_phys_addr_t addr, | @@ -83,7 +81,11 @@ static int petalogix_load_device_tree(target_phys_addr_t addr, | ||
83 | to the kernel. */ | 81 | to the kernel. */ |
84 | fdt_size = load_image_targphys("mb.dtb", addr, 0x10000); | 82 | fdt_size = load_image_targphys("mb.dtb", addr, 0x10000); |
85 | if (fdt_size < 0) { | 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 | if (kernel_cmdline) { | 91 | if (kernel_cmdline) { |
pc-bios/petalogix-s3adsp1800.dtb
0 → 100644
No preview for this file type