@samitouri / QOSamiQemu / commits / f139ad829a

hw/arm: kzm: 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 IMX31KZM 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-11-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 f139ad829a21407b46beed9d165e84a98b4fa972
1 file changed +5 -7
hw/arm/kzm.c
+5 -7
@@ -54,17 +54,13 @@
54 typedef struct IMX31KZM {
55 FslIMX31State soc;
56 MemoryRegion ram_alias;
57 + struct arm_boot_info bootinfo;
58 } IMX31KZM;
59
60 #define KZM_RAM_ADDR (FSL_IMX31_SDRAM0_ADDR)
61 #define KZM_FPGA_ADDR (FSL_IMX31_CS4_ADDR + 0x1040)
62 #define KZM_LAN9118_ADDR (FSL_IMX31_CS5_ADDR)
63
63 -static struct arm_boot_info kzm_binfo = {
64 - .loader_start = KZM_RAM_ADDR,
65 - .board_id = 1722,
66 -};
67 -
64 static void kzm_init(MachineState *machine)
65 {
66 IMX31KZM *s = g_new0(IMX31KZM, 1);
@@ -125,10 +121,12 @@ static void kzm_init(MachineState *machine)
121 14745600, serial_hd(2), DEVICE_NATIVE_ENDIAN);
122 }
123
128 - kzm_binfo.ram_size = machine->ram_size;
124 + s->bootinfo.loader_start = KZM_RAM_ADDR;
125 + s->bootinfo.board_id = 1722;
126 + s->bootinfo.ram_size = machine->ram_size;
127
128 if (!qtest_enabled()) {
131 - arm_load_kernel(&s->soc.cpu, machine, &kzm_binfo);
129 + arm_load_kernel(&s->soc.cpu, machine, &s->bootinfo);
130 }
131 }
132