[PATCH 18/20] hw/arm: sabrelite: Store boot info in the machine state
Bin Meng <[email protected]>
| Newsgroups | org.nongnu.qemu-devel,org.nongnu.qemu-arm |
|---|---|
| Message-ID | <[email protected]> |
arm_load_kernel() keeps a pointer to the boot info struct for the
lifetime of the VM, so the struct logically belongs to the machine
rather than to a file scoped static object.
Move the boot info into the existing SabreliteMachineState.
As in the xlnx-zcu102 and raspi machines, the boot info belongs to
the machine rather than to a static object:
4d1ac883a7 ("hw/arm: xlnx-zcu102: Move arm_boot_info into XlnxZCU102")
0f15c6e338 ("hw/arm/raspi: Move arm_boot_info structure to RaspiMachineState")
Signed-off-by: Bin Meng <[email protected]>
---
hw/arm/sabrelite.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/arm/sabrelite.c b/hw/arm/sabrelite.c
index 84bbc2f979..64ebcc140d 100644
--- a/hw/arm/sabrelite.c
+++ b/hw/arm/sabrelite.c
@@ -25,18 +25,12 @@ struct SabreliteMachineState {
FslIMX6State soc;
CanBusState *canbus[FSL_IMX6_NUM_CANS];
+ struct arm_boot_info bootinfo;
};
#define TYPE_SABRELITE_MACHINE MACHINE_TYPE_NAME("sabrelite")
OBJECT_DECLARE_SIMPLE_TYPE(SabreliteMachineState, SABRELITE_MACHINE)
-static struct arm_boot_info sabrelite_binfo = {
- /* DDR memory start */
- .loader_start = FSL_IMX6_MMDC_ADDR,
- /* No board ID, we boot from DT tree */
- .board_id = -1,
-};
-
/* No need to do any particular setup for secondary boot */
static void sabrelite_write_secondary(ARMCPU *cpu,
const struct arm_boot_info *info)
@@ -110,13 +104,19 @@ static void sabrelite_init(MachineState *machine)
}
}
- sabrelite_binfo.ram_size = machine->ram_size;
- sabrelite_binfo.secure_boot = true;
- sabrelite_binfo.write_secondary_boot = sabrelite_write_secondary;
- sabrelite_binfo.secondary_cpu_reset_hook = sabrelite_reset_secondary;
+ s->bootinfo = (struct arm_boot_info) {
+ /* DDR memory start */
+ .loader_start = FSL_IMX6_MMDC_ADDR,
+ /* No board ID, we boot from DT tree */
+ .board_id = -1,
+ .ram_size = machine->ram_size,
+ .secure_boot = true,
+ .write_secondary_boot = sabrelite_write_secondary,
+ .secondary_cpu_reset_hook = sabrelite_reset_secondary,
+ };
if (!qtest_enabled()) {
- arm_load_kernel(&s->soc.cpu[0], machine, &sabrelite_binfo);
+ arm_load_kernel(&s->soc.cpu[0], machine, &s->bootinfo);
}
}
--
2.53.0