mirror of https://gitlab.com/qemu-project/qemu
ppc: virtex_ml507: QEMU_OPTION_dtb support for this machine.
QEMU has 'dtb' option for specifing the device tree file for the kernel. The patch adds support for this option to the 'virtex_ml507' machine implementation. Signed-off-by: Efimov Vasily <real@ispras.ru> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
95f5b6e3af
commit
daf285b606
|
@ -141,22 +141,31 @@ static int xilinx_load_device_tree(hwaddr addr,
|
||||||
{
|
{
|
||||||
char *path;
|
char *path;
|
||||||
int fdt_size;
|
int fdt_size;
|
||||||
void *fdt;
|
void *fdt = NULL;
|
||||||
int r;
|
int r;
|
||||||
|
const char *dtb_filename;
|
||||||
|
|
||||||
/* Try the local "ppc.dtb" override. */
|
dtb_filename = qemu_opt_get(qemu_get_machine_opts(), "dtb");
|
||||||
fdt = load_device_tree("ppc.dtb", &fdt_size);
|
if (dtb_filename) {
|
||||||
if (!fdt) {
|
fdt = load_device_tree(dtb_filename, &fdt_size);
|
||||||
path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
|
||||||
if (path) {
|
|
||||||
fdt = load_device_tree(path, &fdt_size);
|
|
||||||
g_free(path);
|
|
||||||
}
|
|
||||||
if (!fdt) {
|
if (!fdt) {
|
||||||
return 0;
|
error_report("Error while loading device tree file '%s'",
|
||||||
|
dtb_filename);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
/* Try the local "ppc.dtb" override. */
|
||||||
|
fdt = load_device_tree("ppc.dtb", &fdt_size);
|
||||||
|
if (!fdt) {
|
||||||
|
path = qemu_find_file(QEMU_FILE_TYPE_BIOS, BINARY_DEVICE_TREE_FILE);
|
||||||
|
if (path) {
|
||||||
|
fdt = load_device_tree(path, &fdt_size);
|
||||||
|
g_free(path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!fdt) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
r = qemu_devtree_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline);
|
r = qemu_devtree_setprop_string(fdt, "/chosen", "bootargs", kernel_cmdline);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
fprintf(stderr, "couldn't set /chosen/bootargs\n");
|
fprintf(stderr, "couldn't set /chosen/bootargs\n");
|
||||||
|
|
Loading…
Reference in New Issue