|
@@ -171,7 +171,6 @@ static void create_fdt(SiFiveUState *s, const MemMapEntry *memmap,
|
|
int cpu_phandle = phandle++;
|
|
int cpu_phandle = phandle++;
|
|
nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
|
|
nodename = g_strdup_printf("/cpus/cpu@%d", cpu);
|
|
char *intc = g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
|
|
char *intc = g_strdup_printf("/cpus/cpu@%d/interrupt-controller", cpu);
|
|
- char *isa;
|
|
|
|
qemu_fdt_add_subnode(fdt, nodename);
|
|
qemu_fdt_add_subnode(fdt, nodename);
|
|
/* cpu 0 is the management hart that does not have mmu */
|
|
/* cpu 0 is the management hart that does not have mmu */
|
|
if (cpu != 0) {
|
|
if (cpu != 0) {
|
|
@@ -180,11 +179,10 @@ static void create_fdt(SiFiveUState *s, const MemMapEntry *memmap,
|
|
} else {
|
|
} else {
|
|
qemu_fdt_setprop_string(fdt, nodename, "mmu-type", "riscv,sv48");
|
|
qemu_fdt_setprop_string(fdt, nodename, "mmu-type", "riscv,sv48");
|
|
}
|
|
}
|
|
- isa = riscv_isa_string(&s->soc.u_cpus.harts[cpu - 1]);
|
|
|
|
|
|
+ riscv_isa_write_fdt(&s->soc.u_cpus.harts[cpu - 1], fdt, nodename);
|
|
} else {
|
|
} else {
|
|
- isa = riscv_isa_string(&s->soc.e_cpus.harts[0]);
|
|
|
|
|
|
+ riscv_isa_write_fdt(&s->soc.e_cpus.harts[0], fdt, nodename);
|
|
}
|
|
}
|
|
- qemu_fdt_setprop_string(fdt, nodename, "riscv,isa", isa);
|
|
|
|
qemu_fdt_setprop_string(fdt, nodename, "compatible", "riscv");
|
|
qemu_fdt_setprop_string(fdt, nodename, "compatible", "riscv");
|
|
qemu_fdt_setprop_string(fdt, nodename, "status", "okay");
|
|
qemu_fdt_setprop_string(fdt, nodename, "status", "okay");
|
|
qemu_fdt_setprop_cell(fdt, nodename, "reg", cpu);
|
|
qemu_fdt_setprop_cell(fdt, nodename, "reg", cpu);
|
|
@@ -194,7 +192,6 @@ static void create_fdt(SiFiveUState *s, const MemMapEntry *memmap,
|
|
qemu_fdt_setprop_string(fdt, intc, "compatible", "riscv,cpu-intc");
|
|
qemu_fdt_setprop_string(fdt, intc, "compatible", "riscv,cpu-intc");
|
|
qemu_fdt_setprop(fdt, intc, "interrupt-controller", NULL, 0);
|
|
qemu_fdt_setprop(fdt, intc, "interrupt-controller", NULL, 0);
|
|
qemu_fdt_setprop_cell(fdt, intc, "#interrupt-cells", 1);
|
|
qemu_fdt_setprop_cell(fdt, intc, "#interrupt-cells", 1);
|
|
- g_free(isa);
|
|
|
|
g_free(intc);
|
|
g_free(intc);
|
|
g_free(nodename);
|
|
g_free(nodename);
|
|
}
|
|
}
|