]> git.proxmox.com Git - mirror_qemu.git/commit - hw/arm/virt.c
arm/boot: split load_dtb() from arm_load_kernel()
authorIgor Mammedov <imammedo@redhat.com>
Thu, 10 May 2018 17:10:56 +0000 (18:10 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 10 May 2018 17:10:56 +0000 (18:10 +0100)
commit3b77f6c353a4bb8a66dab8a46668a7ccccc9de03
tree45767040fe4783df918142d35a83db7ea98d387a
parenta3fc8396352e945f9d14cac0237ebf9d91745969
arm/boot: split load_dtb() from arm_load_kernel()

load_dtb() depends on arm_load_kernel() to figure out place
in RAM where it should be loaded, but it's not required for
arm_load_kernel() to work. Sometimes it's neccesary for
devices added with -device/device_add to be enumerated in
DTB as well, which's lead to [1] and surrounding commits to
add 2 more machine_done notifiers with non obvious ordering
to make dynamic sysbus devices initialization happen in
the right order.

However instead of moving whole arm_load_kernel() in to
machine_done, it's sufficient to move only load_dtb() into
virt_machine_done() notifier and remove ArmLoadKernelNotifier/
/PlatformBusFDTNotifierParams notifiers, which saves us ~90LOC
and simplifies code flow quite a bit.
Later would allow to consolidate DTB generation within one
function for 'mach-virt' board and make it reentrant so it
could generate updated DTB in device hotplug secenarios.

While at it rename load_dtb() to arm_load_dtb() since it's
public now.

Add additional field skip_dtb_autoload to struct arm_boot_info
to allow manual DTB load later in mach-virt and to avoid touching
all other boards to explicitly call arm_load_dtb().

 1) (ac9d32e hw/arm/boot: arm_load_kernel implemented as a machine init done notifier)

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Andrew Jones <drjones@redhat.com>
Message-id: 1525691524-32265-4-git-send-email-imammedo@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/boot.c
hw/arm/sysbus-fdt.c
hw/arm/virt.c
include/hw/arm/arm.h
include/hw/arm/sysbus-fdt.h