hw/riscv: Use error_fatal for SoC realisation
When realising the SoC use error_fatal instead of error_abort as the process can fail and report useful information to the user. Currently a user can see this: $ ../qemu/bld/qemu-system-riscv64 -M sifive_u -S -monitor stdio -display none -drive if=pflash QEMU 6.1.93 monitor - type 'help' for more information (qemu) Unexpected error in sifive_u_otp_realize() at ../hw/misc/sifive_u_otp.c:229: qemu-system-riscv64: OTP drive size < 16K Aborted (core dumped) Which this patch addresses Reported-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com> Message-Id: <20220105213937.1113508-8-alistair.francis@opensource.wdc.com>
This commit is contained in:
parent
07cb270a9a
commit
8f972e5b4b
@ -471,7 +471,7 @@ static void microchip_icicle_kit_machine_init(MachineState *machine)
|
||||
/* Initialize SoC */
|
||||
object_initialize_child(OBJECT(machine), "soc", &s->soc,
|
||||
TYPE_MICROCHIP_PFSOC);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
|
||||
|
||||
/* Split RAM into low and high regions using aliases to machine->ram */
|
||||
mem_low_size = memmap[MICROCHIP_PFSOC_DRAM_LO].size;
|
||||
|
@ -80,7 +80,7 @@ static void opentitan_board_init(MachineState *machine)
|
||||
/* Initialize SoC */
|
||||
object_initialize_child(OBJECT(machine), "soc", &s->soc,
|
||||
TYPE_RISCV_IBEX_SOC);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
|
||||
|
||||
memory_region_add_subregion(sys_mem,
|
||||
memmap[IBEX_DEV_RAM].base, machine->ram);
|
||||
|
@ -88,7 +88,7 @@ static void sifive_e_machine_init(MachineState *machine)
|
||||
|
||||
/* Initialize SoC */
|
||||
object_initialize_child(OBJECT(machine), "soc", &s->soc, TYPE_RISCV_E_SOC);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
|
||||
|
||||
/* Data Tightly Integrated Memory */
|
||||
memory_region_add_subregion(sys_mem,
|
||||
|
@ -547,7 +547,7 @@ static void sifive_u_machine_init(MachineState *machine)
|
||||
&error_abort);
|
||||
object_property_set_str(OBJECT(&s->soc), "cpu-type", machine->cpu_type,
|
||||
&error_abort);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_abort);
|
||||
qdev_realize(DEVICE(&s->soc), NULL, &error_fatal);
|
||||
|
||||
/* register RAM */
|
||||
memory_region_add_subregion(system_memory, memmap[SIFIVE_U_DEV_DRAM].base,
|
||||
|
Loading…
Reference in New Issue
Block a user