@samitouri / QOSamiQemu / commits / 98caf59187

hw/arm: aspeed_ast27x0-fc: Store boot info in the machine state

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 Ast2700FCState. 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 <bin.meng@processmission.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Message-id: 20260816131300.51799-3-bin.meng@processmission.com Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Bin Meng committed Aug 16, 2026 at 21:12 UTC 98caf5918760db50671e3351aecdaabd83317bde
1 file changed +6 -7
hw/arm/aspeed_ast27x0-fc.c
+6 -7
@@ -27,10 +27,6 @@
27 #define TYPE_AST2700FC MACHINE_TYPE_NAME("ast2700fc")
28 OBJECT_DECLARE_SIMPLE_TYPE(Ast2700FCState, AST2700FC);
29
30 -static struct arm_boot_info ast2700fc_board_info = {
31 - .board_id = -1, /* device-tree-only board */
32 -};
33 -
30 struct Ast2700FCState {
31 MachineState parent_obj;
32
@@ -46,6 +42,8 @@ struct Ast2700FCState {
42 Aspeed27x0SoCState ca35;
43 Aspeed27x0CoprocessorState ssp;
44 Aspeed27x0CoprocessorState tsp;
45 +
46 + struct arm_boot_info bootinfo;
47 };
48
49 #define AST2700FC_BMC_RAM_SIZE (2 * GiB)
@@ -114,8 +112,9 @@ static bool ast2700fc_ca35_init(MachineState *machine, Error **errp)
112 aspeed_board_init_flashes(&soc->fmc, AST2700FC_FMC_MODEL, 2, 0);
113 aspeed_board_init_flashes(&soc->spi[0], AST2700FC_SPI_MODEL, 1, 2);
114
117 - ast2700fc_board_info.ram_size = machine->ram_size;
118 - ast2700fc_board_info.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
115 + s->bootinfo.ram_size = machine->ram_size;
116 + s->bootinfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
117 + s->bootinfo.board_id = -1; /* device-tree-only board */
118
119 dev = ssi_get_cs(soc->fmc.spi, 0);
120 fmc0 = dev ? m25p80_get_blk(dev) : NULL;
@@ -129,7 +128,7 @@ static bool ast2700fc_ca35_init(MachineState *machine, Error **errp)
128 bios_name = machine->firmware ?: VBOOTROM_FILE_NAME;
129 aspeed_load_vbootrom(soc, bios_name, errp);
130
132 - arm_load_kernel(ARM_CPU(first_cpu), machine, &ast2700fc_board_info);
131 + arm_load_kernel(ARM_CPU(first_cpu), machine, &s->bootinfo);
132
133 return true;
134 }