From: Bin Meng <bin.meng@processmission.com>
To: QEMU <qemu-devel@nongnu.org>
Cc: "Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Cédric Le Goater" <clg@kaod.org>,
"Jamin Lin" <jamin_lin@aspeedtech.com>,
"Joel Stanley" <joel@jms.id.au>,
"Kane Chen" <kane_chen@aspeedtech.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
qemu-arm@nongnu.org
Subject: [PATCH v2 01/20] hw/arm: aspeed: Store boot info in the machine state
Date: Sun, 16 Aug 2026 21:12:31 +0800 [thread overview]
Message-ID: <20260816131300.51799-2-bin.meng@processmission.com> (raw)
In-Reply-To: <20260816131300.51799-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 AspeedMachineState.
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/aspeed.c | 17 +++++++----------
include/hw/arm/aspeed.h | 2 ++
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index a9238e6217..8fa16b3831 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -24,10 +24,6 @@
#include "hw/core/qdev-clock.h"
#include "system/system.h"
-static struct arm_boot_info aspeed_board_binfo = {
- .board_id = -1, /* device-tree-only board */
-};
-
#define AST_SMP_MAILBOX_BASE 0x1e6e2180
#define AST_SMP_MBOX_FIELD_ENTRY (AST_SMP_MAILBOX_BASE + 0x0)
#define AST_SMP_MBOX_FIELD_GOSIGN (AST_SMP_MAILBOX_BASE + 0x4)
@@ -206,13 +202,14 @@ static void aspeed_machine_init(MachineState *machine)
memory_region_add_subregion(get_system_memory(),
AST_SMP_MAILBOX_BASE, smpboot);
- aspeed_board_binfo.write_secondary_boot = aspeed_write_smpboot;
- aspeed_board_binfo.secondary_cpu_reset_hook = aspeed_reset_secondary;
- aspeed_board_binfo.smp_loader_start = AST_SMP_MBOX_CODE;
+ bmc->bootinfo.write_secondary_boot = aspeed_write_smpboot;
+ bmc->bootinfo.secondary_cpu_reset_hook = aspeed_reset_secondary;
+ bmc->bootinfo.smp_loader_start = AST_SMP_MBOX_CODE;
}
- aspeed_board_binfo.ram_size = machine->ram_size;
- aspeed_board_binfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
+ bmc->bootinfo.board_id = -1; /* device-tree-only board */
+ bmc->bootinfo.ram_size = machine->ram_size;
+ bmc->bootinfo.loader_start = sc->memmap[ASPEED_DEV_SDRAM];
if (amc->i2c_init) {
amc->i2c_init(bmc);
@@ -248,7 +245,7 @@ static void aspeed_machine_init(MachineState *machine)
aspeed_load_vbootrom(bmc->soc, bios_name, &error_abort);
}
- arm_load_kernel(ARM_CPU(first_cpu), machine, &aspeed_board_binfo);
+ arm_load_kernel(ARM_CPU(first_cpu), machine, &bmc->bootinfo);
}
void aspeed_create_pca9552(AspeedSoCState *soc, int bus_id, int addr)
diff --git a/include/hw/arm/aspeed.h b/include/hw/arm/aspeed.h
index a00238ed74..54f0d7643d 100644
--- a/include/hw/arm/aspeed.h
+++ b/include/hw/arm/aspeed.h
@@ -12,6 +12,7 @@
#include "hw/core/boards.h"
#include "qom/object.h"
#include "hw/arm/aspeed_soc.h"
+#include "hw/arm/boot.h"
typedef struct AspeedMachineState AspeedMachineState;
@@ -42,6 +43,7 @@ struct AspeedMachineState {
char *fmc_model;
char *spi_model;
uint32_t hw_strap1;
+ struct arm_boot_info bootinfo;
};
struct AspeedMachineClass {
--
2.53.0
next prev parent reply other threads:[~2026-08-16 13:16 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-16 13:12 [PATCH v2 00/20] hw/arm: Store the ARM boot info in the machine state Bin Meng
2026-08-16 13:12 ` Bin Meng [this message]
2026-08-16 14:54 ` [PATCH v2 01/20] hw/arm: aspeed: Store " Philippe Mathieu-Daudé
2026-08-21 9:23 ` Peter Maydell
2026-08-16 13:12 ` [PATCH v2 02/20] hw/arm: aspeed_ast27x0-fc: " Bin Meng
2026-08-16 14:55 ` Philippe Mathieu-Daudé
2026-08-16 13:12 ` [PATCH v2 03/20] hw/arm: bananapi_m2u: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 04/20] hw/arm: collie: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 05/20] hw/arm: cubieboard: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 06/20] hw/arm: exynos4_boards: Store boot info in the board state Bin Meng
2026-08-16 14:56 ` Philippe Mathieu-Daudé
2026-08-16 13:12 ` [PATCH v2 07/20] hw/arm: imx25_pdk: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 08/20] hw/arm: imx8mm-evk: Store boot info in the machine state Bin Meng
2026-08-16 13:12 ` [PATCH v2 09/20] hw/arm: integratorcp: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 10/20] hw/arm: kzm: Store boot info in the board state Bin Meng
2026-08-16 13:12 ` [PATCH v2 11/20] hw/arm: mcimx7d-sabre: Store boot info in the machine state Bin Meng
2026-08-16 13:12 ` [PATCH v2 12/20] hw/arm: musicpal: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 13/20] hw/arm: npcm7xx: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 14/20] hw/arm: npcm8xx: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 15/20] hw/arm: omap_sx1: " Bin Meng
2026-08-16 14:57 ` Philippe Mathieu-Daudé
2026-08-16 13:12 ` [PATCH v2 16/20] hw/arm: orangepi: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 17/20] hw/arm: realview: " Bin Meng
2026-08-16 13:12 ` [PATCH v2 18/20] hw/arm: sabrelite: " Bin Meng
2026-08-16 15:07 ` Philippe Mathieu-Daudé
2026-08-16 13:12 ` [PATCH v2 19/20] hw/arm: versatilepb: " Bin Meng
2026-08-16 15:06 ` Philippe Mathieu-Daudé
2026-08-21 9:49 ` Peter Maydell
2026-08-16 13:12 ` [PATCH v2 20/20] hw/arm: xilinx_zynq: " Bin Meng
2026-08-21 9:49 ` [PATCH v2 00/20] hw/arm: Store the ARM " Peter Maydell
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=20260816131300.51799-2-bin.meng@processmission.com \
--to=bin.meng@processmission.com \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=jamin_lin@aspeedtech.com \
--cc=joel@jms.id.au \
--cc=kane_chen@aspeedtech.com \
--cc=leetroy@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox