@samitouri / QOSamiQemu / commits / bcdc392396

hw/arm: imx25_pdk: Store boot info in the board 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. The IMX25PDK struct is already allocated per machine instance, so move the boot info there. 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> Message-id: 20260816131300.51799-8-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 bcdc392396eb3825f273e2c84c9ed7290f0ac283
1 file changed +5 -6
hw/arm/imx25_pdk.c
+5 -6
@@ -61,10 +61,9 @@
61 typedef struct IMX25PDK {
62 FslIMX25State soc;
63 MemoryRegion ram_alias;
64 + struct arm_boot_info bootinfo;
65 } IMX25PDK;
66
66 -static struct arm_boot_info imx25_pdk_binfo;
67 -
67 static void imx25_pdk_init(MachineState *machine)
68 {
69 IMX25PDK *s = g_new0(IMX25PDK, 1);
@@ -114,9 +113,9 @@ static void imx25_pdk_init(MachineState *machine)
113 alias_offset += ram[i].size;
114 }
115
117 - imx25_pdk_binfo.ram_size = machine->ram_size;
118 - imx25_pdk_binfo.loader_start = FSL_IMX25_SDRAM0_ADDR;
119 - imx25_pdk_binfo.board_id = 1771;
116 + s->bootinfo.ram_size = machine->ram_size;
117 + s->bootinfo.loader_start = FSL_IMX25_SDRAM0_ADDR;
118 + s->bootinfo.board_id = 1771;
119
120 for (i = 0; i < FSL_IMX25_NUM_ESDHCS; i++) {
121 BusState *bus;
@@ -138,7 +137,7 @@ static void imx25_pdk_init(MachineState *machine)
137 * fail.
138 */
139 if (!qtest_enabled()) {
141 - arm_load_kernel(&s->soc.cpu, machine, &imx25_pdk_binfo);
140 + arm_load_kernel(&s->soc.cpu, machine, &s->bootinfo);
141 }
142 }
143