From: "Cédric Le Goater" <clg@redhat.com>
To: qemu-arm@nongnu.org, qemu-devel@nongnu.org
Cc: "Jamin Lin" <jamin_lin@aspeedtech.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Cédric Le Goater" <clg@redhat.com>
Subject: [PULL 11/21] hw/arm/aspeed_ast2600: Use a table for unimplemented devices
Date: Thu, 15 Oct 2026 14:21:41 +0200 [thread overview]
Message-ID: <20261015122151.889017-12-clg@redhat.com> (raw)
In-Reply-To: <20261015122151.889017-1-clg@redhat.com>
From: Jamin Lin <jamin_lin@aspeedtech.com>
Before this change, each unimplemented device needed its own field in
AspeedSoCState. This made the variable names confusing. For example,
AspeedSoCState has "udc" as an unimplemented device, but
Aspeed2600SoCState also has "udc" as the real UDC model.
Use the unimp_devs table in AspeedSoCClass to describe the
unimplemented devices, and use create_unimplemented_devices() to create
and map them. This makes the code easier to maintain and read. Convert
AST2600 to use them.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20261012064445.2571633-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
---
hw/arm/aspeed_ast2600.c | 44 +++++++++++------------------------------
1 file changed, 12 insertions(+), 32 deletions(-)
diff --git a/hw/arm/aspeed_ast2600.c b/hw/arm/aspeed_ast2600.c
index 1a10d0fe1ecc..ebaf07d3128a 100644
--- a/hw/arm/aspeed_ast2600.c
+++ b/hw/arm/aspeed_ast2600.c
@@ -19,9 +19,6 @@
#include "system/system.h"
#include "target/arm/cpu-qom.h"
-#define ASPEED_SOC_IOMEM_SIZE 0x00200000
-#define ASPEED_SOC_DPMCU_SIZE 0x00040000
-
static const hwaddr aspeed_soc_ast2600_memmap[] = {
[ASPEED_DEV_SPI_BOOT] = 0x00000000,
[ASPEED_DEV_SRAM0] = 0x10000000,
@@ -149,6 +146,15 @@ static const int aspeed_soc_ast2600_irqmap[] = {
[ASPEED_DEV_ACRY] = 160,
};
+static const UnimplementedDeviceConfig aspeed_soc_ast2600_unimp_devs[] = {
+ { "iomem", "aspeed.io", 0x1E600000, 0x00200000, -1000 },
+ { "video", "aspeed.video", 0x1E700000, 0x1000, -1000 },
+ { "dpmcu", "aspeed.dpmcu", 0x18000000, 0x00040000, -1000 },
+ { "emmc-boot-controller", "aspeed.emmc-boot-controller",
+ 0x1E6F5000, 0x1000, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast2600_get_irq(AspeedSoCState *s, int dev)
{
Aspeed2600SoCState *a = ASPEED2600_SOC(s);
@@ -282,13 +288,6 @@ static void aspeed_soc_ast2600_init(Object *obj)
object_initialize_child(obj, "sbc", &s->sbc, TYPE_ASPEED_AST2600_SBC);
- object_initialize_child(obj, "iomem", &s->iomem, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "video", &s->video, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "dpmcu", &s->dpmcu, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "emmc-boot-controller",
- &s->emmc_boot_controller,
- TYPE_UNIMPLEMENTED_DEVICE);
-
for (i = 0; i < ASPEED_FSI_NUM; i++) {
object_initialize_child(obj, "fsi[*]", &s->fsi[i], TYPE_ASPEED_APB2OPB);
}
@@ -382,22 +381,8 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_SPI_BOOT],
&s->spi_boot_container);
- /* IO space */
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->iomem),
- "aspeed.io",
- sc->memmap[ASPEED_DEV_IOMEM],
- ASPEED_SOC_IOMEM_SIZE);
-
- /* Video engine stub */
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->video),
- "aspeed.video",
- sc->memmap[ASPEED_DEV_VIDEO], 0x1000);
-
- /* eMMC Boot Controller stub */
- aspeed_mmio_map_unimplemented(s->memory,
- SYS_BUS_DEVICE(&s->emmc_boot_controller),
- "aspeed.emmc-boot-controller",
- sc->memmap[ASPEED_DEV_EMMC_BC], 0x1000);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
/* CPU */
for (i = 0; i < sc->num_cpus; i++) {
@@ -469,12 +454,6 @@ static void aspeed_soc_ast2600_realize(DeviceState *dev, Error **errp)
memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_SRAM1],
&s->sram_container[1]);
- /* DPMCU */
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->dpmcu),
- "aspeed.dpmcu",
- sc->memmap[ASPEED_DEV_DPMCU],
- ASPEED_SOC_DPMCU_SIZE);
-
/* SCU */
if (!sysbus_realize(SYS_BUS_DEVICE(&s->scu), errp)) {
return;
@@ -838,6 +817,7 @@ static void aspeed_soc_ast2600_class_init(ObjectClass *oc, const void *data)
sc->uarts_base = ASPEED_DEV_UART1;
sc->irqmap = aspeed_soc_ast2600_irqmap;
sc->memmap = aspeed_soc_ast2600_memmap;
+ sc->unimp_devs = aspeed_soc_ast2600_unimp_devs;
sc->num_cpus = 2;
sc->boot_from_emmc = aspeed_soc_ast2600_boot_from_emmc;
}
--
2.56.0
next prev parent reply other threads:[~2026-10-15 12:23 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 12:21 [PULL 00/21] aspeed queue Cédric Le Goater
2026-10-15 12:21 ` [PULL 01/21] hw/misc/aspeed_hace: Fix OOB read in has_padding() Cédric Le Goater
2026-10-15 12:21 ` [PULL 02/21] tests/qtest/aspeed-acry: Allocate SRAM buffers on the heap Cédric Le Goater
2026-10-15 12:21 ` [PULL 03/21] hw/nvram/aspeed_otp, hw/misc/aspeed_sbc: Consolidate OTP layout definitions Cédric Le Goater
2026-10-15 12:21 ` [PULL 04/21] hw/misc/aspeed_sbc: Derive ABR state from OTP config straps Cédric Le Goater
2026-10-15 12:21 ` [PULL 05/21] hw/misc/aspeed_sbc: Derive secure boot state from OTP config Cédric Le Goater
2026-10-15 12:21 ` [PULL 06/21] hw/arm/aspeed: Sort device IDs alphabetically Cédric Le Goater
2026-10-15 12:21 ` [PULL 07/21] tests/functional/aarch64/test_aspeed_ast2700a2: Add I2C test for IO expander 1 Cédric Le Goater
2026-10-15 12:21 ` [PULL 08/21] MAINTAINERS: Update ASPEED BMCs reviewers Cédric Le Goater
2026-10-15 12:21 ` [PULL 09/21] hw/misc/unimp: Add create_unimplemented_devices() helper Cédric Le Goater
2026-10-15 12:21 ` [PULL 10/21] hw/arm/aspeed_ast2400: Use a table for unimplemented devices Cédric Le Goater
2026-10-15 12:21 ` Cédric Le Goater [this message]
2026-10-15 12:21 ` [PULL 12/21] hw/arm/aspeed_ast27x0: " Cédric Le Goater
2026-10-15 12:21 ` [PULL 13/21] hw/arm/aspeed_ast10x0: " Cédric Le Goater
2026-10-15 12:21 ` [PULL 14/21] hw/arm/aspeed_ast1040: " Cédric Le Goater
2026-10-15 12:21 ` [PULL 15/21] hw/arm/aspeed: Remove unused unimplemented device fields Cédric Le Goater
2026-10-15 12:21 ` [PULL 16/21] hw/arm/aspeed_ast27x0: Use a table for unimplemented devices for SSP/TSP Cédric Le Goater
2026-10-15 12:21 ` [PULL 17/21] hw/arm/aspeed_coprocessor: Remove unused unimplemented device fields Cédric Le Goater
2026-10-15 12:21 ` [PULL 18/21] hw/arm/aspeed_ast1700: Use a table for unimplemented devices Cédric Le Goater
2026-10-15 12:21 ` [PULL 19/21] hw/arm/aspeed_ast1700: Remove unused unimplemented device field Cédric Le Goater
2026-10-15 12:21 ` [PULL 20/21] hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented() Cédric Le Goater
2026-10-15 12:21 ` [PULL 21/21] tests/functional: give the set_machine probe VM the test workdir Cédric Le Goater
2026-10-15 14:55 ` [PULL 00/21] aspeed queue Richard Henderson
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=20261015122151.889017-12-clg@redhat.com \
--to=clg@redhat.com \
--cc=jamin_lin@aspeedtech.com \
--cc=philmd@oss.qualcomm.com \
--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.