All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bin Meng <bin.meng@processmission.com>
To: QEMU <qemu-devel@nongnu.org>
Cc: Alistair Francis <alistair@alistair23.me>,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	qemu-arm@nongnu.org
Subject: [PATCH 20/20] hw/arm: xilinx_zynq: Store boot info in the machine state
Date: Thu, 13 Aug 2026 23:49:08 +0800	[thread overview]
Message-ID: <20260813154918.996812-21-bin.meng@processmission.com> (raw)
In-Reply-To: <20260813154918.996812-1-bin.meng@processmission.com>

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 ZynqMachineState.

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>

---

 hw/arm/xilinx_zynq.c         | 17 ++++++++---------
 include/hw/arm/xilinx_zynq.h |  2 ++
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/hw/arm/xilinx_zynq.c b/hw/arm/xilinx_zynq.c
index 6c83439017..f314897540 100644
--- a/hw/arm/xilinx_zynq.c
+++ b/hw/arm/xilinx_zynq.c
@@ -103,8 +103,6 @@ static void zynq_write_board_setup(ARMCPU *cpu,
                        sizeof(board_setup_blob), BOARD_SETUP_ADDR);
 }
 
-static struct arm_boot_info zynq_binfo = {};
-
 static void gem_init(uint32_t base, qemu_irq irq)
 {
     DeviceState *dev;
@@ -268,7 +266,7 @@ static void zynq_init(MachineState *machine)
     busdev = SYS_BUS_DEVICE(dev);
     sysbus_realize_and_unref(busdev, &error_fatal);
     sysbus_mmio_map(busdev, 0, MPCORE_PERIPHBASE);
-    zynq_binfo.gic_cpu_if_addr = MPCORE_PERIPHBASE + 0x100;
+    zynq_machine->bootinfo.gic_cpu_if_addr = MPCORE_PERIPHBASE + 0x100;
     sysbus_create_varargs("l2x0", MPCORE_PERIPHBASE + 0x2000, NULL);
     for (n = 0; n < smp_cpus; n++) {
         /* See "hw/intc/arm_gic.h" for the IRQ line association */
@@ -444,13 +442,14 @@ static void zynq_init(MachineState *machine)
     create_unimplemented_device("zynq.qos301_dmac", 0xF8947000, 0x130);
     create_unimplemented_device("zynq.qos301_iou", 0xF8948000, 0x130);
 
-    zynq_binfo.ram_size = machine->ram_size;
-    zynq_binfo.board_id = 0xd32;
-    zynq_binfo.loader_start = 0;
-    zynq_binfo.board_setup_addr = BOARD_SETUP_ADDR;
-    zynq_binfo.write_board_setup = zynq_write_board_setup;
+    zynq_machine->bootinfo.ram_size = machine->ram_size;
+    zynq_machine->bootinfo.board_id = 0xd32;
+    zynq_machine->bootinfo.loader_start = 0;
+    zynq_machine->bootinfo.board_setup_addr = BOARD_SETUP_ADDR;
+    zynq_machine->bootinfo.write_board_setup = zynq_write_board_setup;
 
-    arm_load_kernel(zynq_machine->cpu[0], machine, &zynq_binfo);
+    arm_load_kernel(zynq_machine->cpu[0], machine,
+                    &zynq_machine->bootinfo);
 }
 
 static void zynq_machine_class_init(ObjectClass *oc, const void *data)
diff --git a/include/hw/arm/xilinx_zynq.h b/include/hw/arm/xilinx_zynq.h
index cefb7789ff..669c516ad1 100644
--- a/include/hw/arm/xilinx_zynq.h
+++ b/include/hw/arm/xilinx_zynq.h
@@ -14,6 +14,7 @@
 
 #include "target/arm/cpu-qom.h"
 #include "hw/core/qdev-clock.h"
+#include "hw/arm/boot.h"
 
 #define TYPE_ZYNQ_MACHINE MACHINE_TYPE_NAME("xilinx-zynq-a9")
 OBJECT_DECLARE_SIMPLE_TYPE(ZynqMachineState, ZYNQ_MACHINE)
@@ -25,6 +26,7 @@ struct ZynqMachineState {
     Clock *ps_clk;
     ARMCPU *cpu[ZYNQ_MAX_CPUS];
     uint8_t boot_mode;
+    struct arm_boot_info bootinfo;
 };
 
 #endif /* QEMU_ARM_ZYNQ_H */
-- 
2.53.0



      parent reply	other threads:[~2026-08-13 15:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-13 15:48 [PATCH 00/20] hw/arm: Store the ARM boot info in the machine state Bin Meng
2026-08-13 15:48 ` [PATCH 01/20] hw/arm: aspeed: Store " Bin Meng
2026-08-13 15:48 ` [PATCH 02/20] hw/arm: aspeed_ast27x0-fc: " Bin Meng
2026-08-13 15:48 ` [PATCH 03/20] hw/arm: bananapi_m2u: " Bin Meng
2026-08-13 15:48 ` [PATCH 04/20] hw/arm: collie: " Bin Meng
2026-08-13 15:48 ` [PATCH 05/20] hw/arm: cubieboard: " Bin Meng
2026-08-13 15:48 ` [PATCH 06/20] hw/arm: exynos4_boards: Store boot info in the board state Bin Meng
2026-08-13 15:48 ` [PATCH 07/20] hw/arm: imx25_pdk: " Bin Meng
2026-08-13 15:48 ` [PATCH 08/20] hw/arm: imx8mm-evk: Store boot info in the machine state Bin Meng
2026-08-13 15:48 ` [PATCH 09/20] hw/arm: integratorcp: " Bin Meng
2026-08-13 15:48 ` [PATCH 10/20] hw/arm: kzm: Store boot info in the board state Bin Meng
2026-08-13 15:48 ` [PATCH 11/20] hw/arm: mcimx7d-sabre: Store boot info in the machine state Bin Meng
2026-08-13 15:49 ` [PATCH 12/20] hw/arm: musicpal: " Bin Meng
2026-08-13 15:49 ` [PATCH 13/20] hw/arm: npcm7xx: " Bin Meng
2026-08-13 15:49 ` [PATCH 14/20] hw/arm: npcm8xx: " Bin Meng
2026-08-13 15:49 ` [PATCH 15/20] hw/arm: omap_sx1: " Bin Meng
2026-08-13 15:49 ` [PATCH 16/20] hw/arm: orangepi: " Bin Meng
2026-08-13 21:10   ` Niek Linnenbank
2026-08-13 15:49 ` [PATCH 17/20] hw/arm: realview: " Bin Meng
2026-08-13 15:49 ` [PATCH 18/20] hw/arm: sabrelite: " Bin Meng
2026-08-13 15:49 ` [PATCH 19/20] hw/arm: versatilepb: " Bin Meng
2026-08-13 15:49 ` Bin Meng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260813154918.996812-21-bin.meng@processmission.com \
    --to=bin.meng@processmission.com \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.