qemu/hw/openrisc
Peter Maydell 8fd2518ef2 hw: Centralize handling of -machine dumpdtb option
Currently we handle the 'dumpdtb' machine sub-option ad-hoc in every
board model that has an FDT.  It's up to the board code to make sure
it calls qemu_fdt_dumpdtb() in the right place.

This means we're inconsistent and often just ignore the user's
command line argument:
 * if the board doesn't have an FDT at all
 * if the board supports FDT, but there happens not to be one
   present (usually because of a missing -fdt option)

This isn't very helpful because it gives the user no clue why their
option was ignored.

However, in order to support the QMP/HMP dumpdtb commands we require
now that every FDT machine stores a pointer to the FDT in
MachineState::fdt.  This means we can handle -machine dumpdtb
centrally by calling the qmp_dumpdtb() function, unifying its
handling with the QMP/HMP commands.  All the board code calls to
qemu_fdt_dumpdtb() can then be removed.

For this commit we retain the existing behaviour that if there
is no FDT we silently ignore the -machine dumpdtb option.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
2025-02-24 15:03:42 +00:00
..
boot.c hw: Centralize handling of -machine dumpdtb option 2025-02-24 15:03:42 +00:00
cputimer.c include: Rename sysemu/ -> system/ 2024-12-20 17:44:56 +01:00
Kconfig hw/char: Extract serial-mm 2024-10-03 19:33:23 +02:00
meson.build meson: pick libfdt from common_ss when building target-specific files 2024-05-10 15:45:15 +02:00
openrisc_sim.c hw/openrisc: Support monitor dumpdtb command 2025-02-24 15:03:42 +00:00
virt.c hw/openrisc: Support monitor dumpdtb command 2025-02-24 15:03:42 +00:00