* [PATCH v2 01/12] hw/misc/unimp: Add create_unimplemented_devices() helper
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-13 8:31 ` Philippe Mathieu-Daudé
2026-10-12 6:44 ` [PATCH v2 02/12] hw/arm/aspeed_ast2400: Use a table for unimplemented devices Jamin Lin
` (13 subsequent siblings)
14 siblings, 1 reply; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
Several boards and SoCs create many unimplemented devices. Each of them
uses its own structure and helper to describe and map these devices.
Add an UnimplementedDeviceConfig structure and a
create_unimplemented_devices() helper. The helper creates an
unimplemented device for each entry of a table, adds it as a QOM child
of the parent object, and maps it in a memory region container with
the given priority. The table is terminated by an empty entry.
Suggested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/misc/unimp.h | 21 +++++++++++++++++++++
hw/misc/unimp.c | 20 ++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/include/hw/misc/unimp.h b/include/hw/misc/unimp.h
index 77a5077511..073575159d 100644
--- a/include/hw/misc/unimp.h
+++ b/include/hw/misc/unimp.h
@@ -25,6 +25,27 @@ struct UnimplementedDeviceState {
uint64_t size;
};
+typedef struct UnimplementedDeviceConfig {
+ const char *qom_name;
+ const char *region_name;
+ uint64_t offset;
+ uint64_t size;
+ int priority;
+} UnimplementedDeviceConfig;
+
+/**
+ * create_unimplemented_devices:
+ * @parentobj: the parent object
+ * @container: a #MemoryRegion within which @addr is a relative address
+ * @devconfigs: NULL terminated array of #UnimplementedDeviceConfig
+ *
+ * For each entries in @devconfigs, create a TYPE_UNIMPLEMENTED_DEVICE
+ * and mmap it in @container at UnimplementedDeviceConfig::offset.
+ * @container is expected to be a QOM child of @parentobj.
+ */
+void create_unimplemented_devices(Object *parentobj, MemoryRegion *container,
+ const UnimplementedDeviceConfig *devconfigs);
+
/**
* create_unimplemented_device: create and map a dummy device
* @name: name of the device for debug logging
diff --git a/hw/misc/unimp.c b/hw/misc/unimp.c
index 521b84bf20..4c8dcbdff3 100644
--- a/hw/misc/unimp.c
+++ b/hw/misc/unimp.c
@@ -96,3 +96,23 @@ static void unimp_register_types(void)
}
type_init(unimp_register_types)
+
+void create_unimplemented_devices(Object *parentobj, MemoryRegion *container,
+ const UnimplementedDeviceConfig *devconfigs)
+{
+ const UnimplementedDeviceConfig *cfg;
+
+ for (cfg = devconfigs; cfg->qom_name; cfg++) {
+ DeviceState *dev = qdev_new(TYPE_UNIMPLEMENTED_DEVICE);
+ SysBusDevice *sbd = SYS_BUS_DEVICE(dev);
+
+ object_property_add_child(parentobj, cfg->qom_name, OBJECT(dev));
+ qdev_prop_set_string(dev, "name", cfg->region_name);
+ qdev_prop_set_uint64(dev, "size", cfg->size);
+ sysbus_realize_and_unref(sbd, &error_fatal);
+
+ memory_region_add_subregion_overlap(container, cfg->offset,
+ sysbus_mmio_get_region(sbd, 0),
+ cfg->priority);
+ }
+}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v2 01/12] hw/misc/unimp: Add create_unimplemented_devices() helper
2026-10-12 6:44 ` [PATCH v2 01/12] hw/misc/unimp: Add create_unimplemented_devices() helper Jamin Lin
@ 2026-10-13 8:31 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-10-13 8:31 UTC (permalink / raw)
To: Jamin Lin, Cédric Le Goater, Peter Maydell, Steven Lee,
Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley, Ani Sinha,
open list:ASPEED BMCs, open list:All patches CC here
Cc: Troy Lee
On 12/10/26 08:44, Jamin Lin wrote:
> Several boards and SoCs create many unimplemented devices. Each of them
> uses its own structure and helper to describe and map these devices.
>
> Add an UnimplementedDeviceConfig structure and a
> create_unimplemented_devices() helper. The helper creates an
> unimplemented device for each entry of a table, adds it as a QOM child
> of the parent object, and maps it in a memory region container with
> the given priority. The table is terminated by an empty entry.
>
> Suggested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
> Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
> ---
> include/hw/misc/unimp.h | 21 +++++++++++++++++++++
> hw/misc/unimp.c | 20 ++++++++++++++++++++
> 2 files changed, 41 insertions(+)
Thanks!
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Tested-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread
* [PATCH v2 02/12] hw/arm/aspeed_ast2400: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
2026-10-12 6:44 ` [PATCH v2 01/12] hw/misc/unimp: Add create_unimplemented_devices() helper Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 03/12] hw/arm/aspeed_ast2600: " Jamin Lin
` (12 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
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.
Add an 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 AST2400/AST2500
to use them.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/arm/aspeed_soc.h | 1 +
hw/arm/aspeed_ast2400.c | 25 ++++++++++---------------
2 files changed, 11 insertions(+), 15 deletions(-)
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index 38226d9b80..8426134223 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -190,6 +190,7 @@ struct AspeedSoCClass {
int ioexp_num;
const int *irqmap;
const hwaddr *memmap;
+ const UnimplementedDeviceConfig *unimp_devs;
uint32_t num_cpus;
bool (*boot_from_emmc)(AspeedSoCState *s);
};
diff --git a/hw/arm/aspeed_ast2400.c b/hw/arm/aspeed_ast2400.c
index 79a653f65f..fa2782da61 100644
--- a/hw/arm/aspeed_ast2400.c
+++ b/hw/arm/aspeed_ast2400.c
@@ -23,8 +23,6 @@
#include "system/system.h"
#include "target/arm/cpu-qom.h"
-#define ASPEED_SOC_IOMEM_SIZE 0x00200000
-
static const hwaddr aspeed_soc_ast2400_memmap[] = {
[ASPEED_DEV_SPI_BOOT] = 0x00000000,
[ASPEED_DEV_IOMEM] = 0x1E600000,
@@ -134,6 +132,12 @@ static const int aspeed_soc_ast2400_irqmap[] = {
#define aspeed_soc_ast2500_irqmap aspeed_soc_ast2400_irqmap
+static const UnimplementedDeviceConfig aspeed_soc_ast2400_unimp_devs[] = {
+ { "iomem", "aspeed.io", 0x1E600000, 0x00200000, -1000 },
+ { "video", "aspeed.video", 0x1E700000, 0x1000, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast2400_get_irq(AspeedSoCState *s, int dev)
{
Aspeed2400SoCState *a = ASPEED2400_SOC(s);
@@ -239,9 +243,6 @@ static void aspeed_ast2400_soc_init(Object *obj)
snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname);
object_initialize_child(obj, "hace", &s->hace, typename);
-
- object_initialize_child(obj, "iomem", &s->iomem, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "video", &s->video, TYPE_UNIMPLEMENTED_DEVICE);
}
static void aspeed_ast2400_soc_realize(DeviceState *dev, Error **errp)
@@ -259,16 +260,8 @@ static void aspeed_ast2400_soc_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);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
/* CPU */
for (i = 0; i < sc->num_cpus; i++) {
@@ -542,6 +535,7 @@ static void aspeed_soc_ast2400_class_init(ObjectClass *oc, const void *data)
sc->uarts_base = ASPEED_DEV_UART1;
sc->irqmap = aspeed_soc_ast2400_irqmap;
sc->memmap = aspeed_soc_ast2400_memmap;
+ sc->unimp_devs = aspeed_soc_ast2400_unimp_devs;
sc->num_cpus = 1;
}
@@ -569,6 +563,7 @@ static void aspeed_soc_ast2500_class_init(ObjectClass *oc, const void *data)
sc->uarts_base = ASPEED_DEV_UART1;
sc->irqmap = aspeed_soc_ast2500_irqmap;
sc->memmap = aspeed_soc_ast2500_memmap;
+ sc->unimp_devs = aspeed_soc_ast2400_unimp_devs;
sc->num_cpus = 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 03/12] hw/arm/aspeed_ast2600: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
2026-10-12 6:44 ` [PATCH v2 01/12] hw/misc/unimp: Add create_unimplemented_devices() helper Jamin Lin
2026-10-12 6:44 ` [PATCH v2 02/12] hw/arm/aspeed_ast2400: Use a table for unimplemented devices Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 04/12] hw/arm/aspeed_ast27x0: " Jamin Lin
` (11 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
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>
---
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 1a10d0fe1e..ebaf07d312 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.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 04/12] hw/arm/aspeed_ast27x0: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (2 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 03/12] hw/arm/aspeed_ast2600: " Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 05/12] hw/arm/aspeed_ast10x0: " Jamin Lin
` (10 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
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
AST2700 to use them.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/arm/aspeed_ast27x0.c | 41 ++++++++++++-----------------------------
1 file changed, 12 insertions(+), 29 deletions(-)
diff --git a/hw/arm/aspeed_ast27x0.c b/hw/arm/aspeed_ast27x0.c
index 6365dbd638..2ef29e31e9 100644
--- a/hw/arm/aspeed_ast27x0.c
+++ b/hw/arm/aspeed_ast27x0.c
@@ -24,10 +24,6 @@
#include "qobject/qlist.h"
#include "qemu/log.h"
-#define AST2700_SOC_IO_SIZE 0x00FE0000
-#define AST2700_SOC_IOMEM_SIZE 0x01000000
-#define AST2700_SOC_DPMCU_SIZE 0x00040000
-
static const hwaddr aspeed_soc_ast2700_memmap[] = {
[ASPEED_DEV_VBOOTROM] = 0x00000000,
[ASPEED_DEV_IOMEM] = 0x00020000,
@@ -263,6 +259,14 @@ static const struct gic_intc_irq_info ast2700_gic_intcmap[] = {
{201, 3, 1, ast2700_gic201_intcmap},
};
+static const UnimplementedDeviceConfig aspeed_soc_ast2700_unimp_devs[] = {
+ { "dpmcu", "aspeed.dpmcu", 0x11000000, 0x00040000, -1000 },
+ { "iomem", "aspeed.io", 0x00020000, 0x00FE0000, -1000 },
+ { "iomem0", "aspeed.iomem0", 0x12000000, 0x01000000, -1000 },
+ { "iomem1", "aspeed.iomem1", 0x14000000, 0x01000000, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast2700_get_irq(AspeedSoCState *s, int dev)
{
Aspeed27x0SoCState *a = ASPEED27X0_SOC(s);
@@ -558,15 +562,6 @@ static void aspeed_soc_ast2700_init(Object *obj)
qdev_prop_set_uint32(DEVICE(&s->ioexp[i]), "silicon-rev",
sc->silicon_rev);
}
-
- object_initialize_child(obj, "dpmcu", &s->dpmcu,
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "iomem", &s->iomem,
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "iomem0", &s->iomem0,
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "iomem1", &s->iomem1,
- TYPE_UNIMPLEMENTED_DEVICE);
}
/*
@@ -1137,22 +1132,8 @@ static void aspeed_soc_ast2700_realize(DeviceState *dev, Error **errp)
}
}
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->dpmcu),
- "aspeed.dpmcu",
- sc->memmap[ASPEED_DEV_DPMCU],
- AST2700_SOC_DPMCU_SIZE);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->iomem),
- "aspeed.io",
- sc->memmap[ASPEED_DEV_IOMEM],
- AST2700_SOC_IO_SIZE);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->iomem0),
- "aspeed.iomem0",
- sc->memmap[ASPEED_DEV_IOMEM0],
- AST2700_SOC_IOMEM_SIZE);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->iomem1),
- "aspeed.iomem1",
- sc->memmap[ASPEED_DEV_IOMEM1],
- AST2700_SOC_IOMEM_SIZE);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
}
static void aspeed_soc_ast2700a1_class_init(ObjectClass *oc, const void *data)
@@ -1183,6 +1164,7 @@ static void aspeed_soc_ast2700a1_class_init(ObjectClass *oc, const void *data)
sc->uarts_base = ASPEED_DEV_UART0;
sc->irqmap = aspeed_soc_ast2700a1_irqmap;
sc->memmap = aspeed_soc_ast2700_memmap;
+ sc->unimp_devs = aspeed_soc_ast2700_unimp_devs;
}
static void aspeed_soc_ast2700a2_class_init(ObjectClass *oc, const void *data)
@@ -1213,6 +1195,7 @@ static void aspeed_soc_ast2700a2_class_init(ObjectClass *oc, const void *data)
sc->uarts_base = ASPEED_DEV_UART0;
sc->irqmap = aspeed_soc_ast2700a1_irqmap;
sc->memmap = aspeed_soc_ast2700_memmap;
+ sc->unimp_devs = aspeed_soc_ast2700_unimp_devs;
}
static const TypeInfo aspeed_soc_ast27x0_types[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 05/12] hw/arm/aspeed_ast10x0: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (3 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 04/12] hw/arm/aspeed_ast27x0: " Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 06/12] hw/arm/aspeed_ast1040: " Jamin Lin
` (9 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
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
AST1030/AST1060 to use them.
This also fixes a type mismatch. AST10x0 used the "pwm" field
(AspeedPWMState) and the "sgpiom" field (AspeedSGPIOState array) to
create unimplemented devices. They are not used for that anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/arm/aspeed_ast10x0.c | 55 +++++++++++------------------------------
1 file changed, 15 insertions(+), 40 deletions(-)
diff --git a/hw/arm/aspeed_ast10x0.c b/hw/arm/aspeed_ast10x0.c
index aeb5a4423d..0790859735 100644
--- a/hw/arm/aspeed_ast10x0.c
+++ b/hw/arm/aspeed_ast10x0.c
@@ -17,8 +17,6 @@
#include "hw/misc/unimp.h"
#include "hw/arm/aspeed_soc.h"
-#define ASPEED_SOC_IOMEM_SIZE 0x00200000
-
static const hwaddr aspeed_soc_ast1030_memmap[] = {
[ASPEED_DEV_SRAM0] = 0x00000000,
[ASPEED_DEV_SRAM1] = 0x79000000, /* SEC SRAM */
@@ -99,6 +97,17 @@ static const int aspeed_soc_ast1030_irqmap[] = {
[ASPEED_DEV_JTAG1] = 53,
};
+static const UnimplementedDeviceConfig aspeed_soc_ast10x0_unimp_devs[] = {
+ { "iomem", "aspeed.io", 0x7E600000, 0x00200000, -1000 },
+ { "pwm", "aspeed.pwm", 0x7E610000, 0x100, -1000 },
+ { "espi", "aspeed.espi", 0x7E6EE000, 0x800, -1000 },
+ { "udc", "aspeed.udc", 0x7E6A2000, 0x1000, -1000 },
+ { "sgpiom", "aspeed.sgpiom", 0x7E780500, 0x100, -1000 },
+ { "jtag[0]", "aspeed.jtag0", 0x7E6E4000, 0x20, -1000 },
+ { "jtag[1]", "aspeed.jtag1", 0x7E6E4100, 0x20, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast1030_get_irq(AspeedSoCState *s, int dev)
{
Aspeed10x0SoCState *a = ASPEED10X0_SOC(s);
@@ -161,17 +170,6 @@ static void aspeed_soc_ast10x0_init(Object *obj, const char *socname)
snprintf(typename, sizeof(typename), "aspeed.hace-%s", socname);
object_initialize_child(obj, "hace", &s->hace, typename);
-
- object_initialize_child(obj, "iomem", &s->iomem, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "udc", &s->udc, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "sgpiom", &s->sgpiom,
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "jtag[0]", &s->jtag[0],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "jtag[1]", &s->jtag[1],
- TYPE_UNIMPLEMENTED_DEVICE);
}
static void aspeed_soc_ast1030_init(Object *obj)
@@ -215,11 +213,8 @@ static bool aspeed_soc_ast10x0_realize(Aspeed10x0SoCState *a, Error **errp)
return false;
}
- /* General I/O memory space to catch all unimplemented device */
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->iomem),
- "aspeed.io",
- sc->memmap[ASPEED_DEV_IOMEM],
- ASPEED_SOC_IOMEM_SIZE);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
/* AST10x0 CPU Core */
armv7m = DEVICE(&a->armv7m);
qdev_prop_set_uint32(armv7m, "num-irq", 256);
@@ -394,28 +389,6 @@ static bool aspeed_soc_ast10x0_realize(Aspeed10x0SoCState *a, Error **errp)
sysbus_connect_irq(SYS_BUS_DEVICE(&s->gpio), 0,
aspeed_soc_ast1030_get_irq(s, ASPEED_DEV_GPIO));
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm),
- "aspeed.pwm",
- sc->memmap[ASPEED_DEV_PWM], 0x100);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->espi),
- "aspeed.espi",
- sc->memmap[ASPEED_DEV_ESPI], 0x800);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->udc),
- "aspeed.udc",
- sc->memmap[ASPEED_DEV_UDC], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->sgpiom),
- "aspeed.sgpiom",
- sc->memmap[ASPEED_DEV_SGPIOM0], 0x100);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->jtag[0]),
- "aspeed.jtag",
- sc->memmap[ASPEED_DEV_JTAG0], 0x20);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->jtag[1]),
- "aspeed.jtag",
- sc->memmap[ASPEED_DEV_JTAG1], 0x20);
-
return true;
}
@@ -503,6 +476,7 @@ static void aspeed_soc_ast1030_class_init(ObjectClass *klass, const void *data)
sc->uarts_base = ASPEED_DEV_UART1;
sc->irqmap = aspeed_soc_ast1030_irqmap;
sc->memmap = aspeed_soc_ast1030_memmap;
+ sc->unimp_devs = aspeed_soc_ast10x0_unimp_devs;
sc->num_cpus = 1;
}
@@ -529,6 +503,7 @@ static void aspeed_soc_ast1060_class_init(ObjectClass *klass, const void *data)
sc->uarts_base = ASPEED_DEV_UART5;
sc->irqmap = aspeed_soc_ast1030_irqmap;
sc->memmap = aspeed_soc_ast1030_memmap;
+ sc->unimp_devs = aspeed_soc_ast10x0_unimp_devs;
sc->num_cpus = 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 06/12] hw/arm/aspeed_ast1040: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (4 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 05/12] hw/arm/aspeed_ast10x0: " Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 07/12] hw/arm/aspeed: Remove unused unimplemented device fields Jamin Lin
` (8 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
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
AST1040 to use them.
This also fixes a type mismatch. AST1040 used the "pwm" field
(AspeedPWMState) to create an unimplemented device. It is not used for
that anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/arm/aspeed_ast1040.c | 40 ++++++++++++----------------------------
1 file changed, 12 insertions(+), 28 deletions(-)
diff --git a/hw/arm/aspeed_ast1040.c b/hw/arm/aspeed_ast1040.c
index 57ffc0807a..0b078f10c4 100644
--- a/hw/arm/aspeed_ast1040.c
+++ b/hw/arm/aspeed_ast1040.c
@@ -81,6 +81,15 @@ static const int aspeed_soc_ast1040_irqmap[] = {
[ASPEED_DEV_PECI] = 164,
};
+static const UnimplementedDeviceConfig aspeed_soc_ast1040_unimp_devs[] = {
+ { "pwm", "aspeed.pwm", 0x740C0000, 0x10000, -1000 },
+ { "espi", "aspeed.espi", 0x74C05000, 0x1000, -1000 },
+ { "udc", "aspeed.udc", 0x74120000, 0x4000, -1000 },
+ { "jtag[0]", "aspeed.jtag0", 0x74C01000, 0x100, -1000 },
+ { "jtag[1]", "aspeed.jtag1", 0x74C09000, 0x100, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast1040_get_irq(AspeedSoCState *s, int dev)
{
Aspeed10x0SoCState *a = ASPEED10X0_SOC(s);
@@ -123,14 +132,6 @@ static void aspeed_soc_ast1040_init(Object *obj)
object_initialize_child(obj, "wdt[*]", &s->wdt[i],
"aspeed.wdt-ast2700");
}
-
- object_initialize_child(obj, "pwm", &s->pwm, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "espi", &s->espi, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "udc", &s->udc, TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "jtag[0]", &s->jtag[0],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "jtag[1]", &s->jtag[1],
- TYPE_UNIMPLEMENTED_DEVICE);
}
static void aspeed_soc_ast1040_realize(DeviceState *dev_soc, Error **errp)
@@ -267,26 +268,8 @@ static void aspeed_soc_ast1040_realize(DeviceState *dev_soc, Error **errp)
aspeed_mmio_map(s->memory, SYS_BUS_DEVICE(&s->wdt[i]), 0, wdt_offset);
}
- /* Unimplemented peripherals */
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->pwm),
- "aspeed.pwm",
- sc->memmap[ASPEED_DEV_PWM], 0x10000);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->espi),
- "aspeed.espi",
- sc->memmap[ASPEED_DEV_ESPI], 0x1000);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->udc),
- "aspeed.udc",
- sc->memmap[ASPEED_DEV_UDC], 0x4000);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->jtag[0]),
- "aspeed.jtag0",
- sc->memmap[ASPEED_DEV_JTAG0], 0x100);
-
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->jtag[1]),
- "aspeed.jtag1",
- sc->memmap[ASPEED_DEV_JTAG1], 0x100);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
}
static void aspeed_soc_ast1040_class_init(ObjectClass *klass, const void *data)
@@ -312,6 +295,7 @@ static void aspeed_soc_ast1040_class_init(ObjectClass *klass, const void *data)
sc->uarts_base = ASPEED_DEV_UART0;
sc->irqmap = aspeed_soc_ast1040_irqmap;
sc->memmap = aspeed_soc_ast1040_memmap;
+ sc->unimp_devs = aspeed_soc_ast1040_unimp_devs;
sc->num_cpus = 1;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 07/12] hw/arm/aspeed: Remove unused unimplemented device fields
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (5 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 06/12] hw/arm/aspeed_ast1040: " Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 08/12] hw/arm/aspeed_ast27x0: Use a table for unimplemented devices for SSP/TSP Jamin Lin
` (7 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee, Cédric Le Goater
All Aspeed SoCs now use the unimp_devs table and
create_unimplemented_devices() for their unimplemented devices. Remove
the old fields in AspeedSoCState and the ASPEED_JTAG_NUM define, which
are not used anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
---
include/hw/arm/aspeed_soc.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index 8426134223..4ef1014ad0 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -59,7 +59,6 @@
#define ASPEED_CPUS_NUM 4
#define ASPEED_MACS_NUM 4
#define ASPEED_UARTS_NUM 13
-#define ASPEED_JTAG_NUM 2
#define ASPEED_PCIE_NUM 3
#define ASPEED_INTC_NUM 2
#define ASPEED_IOEXP_NUM 2
@@ -110,15 +109,6 @@ struct AspeedSoCState {
AspeedPECIState peci;
SerialMM uart[ASPEED_UARTS_NUM];
Clock *sysclk;
- UnimplementedDeviceState iomem;
- UnimplementedDeviceState iomem0;
- UnimplementedDeviceState iomem1;
- UnimplementedDeviceState video;
- UnimplementedDeviceState emmc_boot_controller;
- UnimplementedDeviceState dpmcu;
- UnimplementedDeviceState espi;
- UnimplementedDeviceState udc;
- UnimplementedDeviceState jtag[ASPEED_JTAG_NUM];
AspeedAPB2OPBState fsi[2];
AspeedLTPIState ltpi_ctrl[ASPEED_IOEXP_NUM];
AspeedAST1700SoCState ioexp[ASPEED_IOEXP_NUM];
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 08/12] hw/arm/aspeed_ast27x0: Use a table for unimplemented devices for SSP/TSP
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (6 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 07/12] hw/arm/aspeed: Remove unused unimplemented device fields Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 09/12] hw/arm/aspeed_coprocessor: Remove unused unimplemented device fields Jamin Lin
` (6 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
Before this change, each unimplemented device needed its own field in
the coprocessor state. This made the code hard to maintain.
Add an unimp_devs table in AspeedCoprocessorClass 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
AST2700 SSP and TSP to use them.
This also fixes a type mismatch. SSP and TSP used the "timerctrl"
field (AspeedTimerCtrlState) to create an unimplemented device. It is
not used for that anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/arm/aspeed_coprocessor.h | 1 +
hw/arm/aspeed_ast27x0-ssp.c | 44 +++++++++--------------------
hw/arm/aspeed_ast27x0-tsp.c | 44 +++++++++--------------------
3 files changed, 27 insertions(+), 62 deletions(-)
diff --git a/include/hw/arm/aspeed_coprocessor.h b/include/hw/arm/aspeed_coprocessor.h
index acb8b06457..39209d2579 100644
--- a/include/hw/arm/aspeed_coprocessor.h
+++ b/include/hw/arm/aspeed_coprocessor.h
@@ -37,6 +37,7 @@ struct AspeedCoprocessorClass {
/** valid_cpu_types: NULL terminated array of a single CPU type. */
const char * const *valid_cpu_types;
const hwaddr *memmap;
+ const UnimplementedDeviceConfig *unimp_devs;
const int *irqmap;
};
diff --git a/hw/arm/aspeed_ast27x0-ssp.c b/hw/arm/aspeed_ast27x0-ssp.c
index e03653086c..0238dc3672 100644
--- a/hw/arm/aspeed_ast27x0-ssp.c
+++ b/hw/arm/aspeed_ast27x0-ssp.c
@@ -101,6 +101,16 @@ static struct nvic_intc_irq_info ast2700_ssp_intcmap[] = {
{169, 1, 9, NULL},
};
+static const UnimplementedDeviceConfig aspeed_soc_ast27x0ssp_unimp_devs[] = {
+ { "timerctrl", "aspeed.timerctrl", 0x72C10000, 0x200, -1000 },
+ { "ipc0", "aspeed.ipc0", 0x72C1C000, 0x1000, -1000 },
+ { "ipc1", "aspeed.ipc1", 0x74C39000, 0x1000, -1000 },
+ { "pric0", "aspeed.pric0", 0x72140000, 0x1000, -1000 },
+ { "pric1", "aspeed.pric1", 0x74100000, 0x1000, -1000 },
+ { "otp", "aspeed.otp", 0x74C07000, 0x800, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast27x0ssp_get_irq(AspeedCoprocessorState *s,
int dev)
{
@@ -136,19 +146,6 @@ static void aspeed_soc_ast27x0ssp_init(Object *obj)
TYPE_ASPEED_2700SSP_INTC);
object_initialize_child(obj, "intc1", &a->intc[1],
TYPE_ASPEED_2700SSP_INTCIO);
-
- object_initialize_child(obj, "timerctrl", &s->timerctrl,
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "ipc0", &a->ipc[0],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "ipc1", &a->ipc[1],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "pric0", &a->pric[0],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "pric1", &a->pric[1],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "otp", &a->otp,
- TYPE_UNIMPLEMENTED_DEVICE);
}
static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
@@ -283,24 +280,8 @@ static void aspeed_soc_ast27x0ssp_realize(DeviceState *dev_soc, Error **errp)
memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_FMC],
&a->fmc_alias);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->timerctrl),
- "aspeed.timerctrl",
- sc->memmap[ASPEED_DEV_TIMER1], 0x200);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->ipc[0]),
- "aspeed.ipc0",
- sc->memmap[ASPEED_DEV_IPC0], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->ipc[1]),
- "aspeed.ipc1",
- sc->memmap[ASPEED_DEV_IPC1], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->pric[0]),
- "aspeed.pric0",
- sc->memmap[ASPEED_DEV_PRIC0], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->pric[1]),
- "aspeed.pric1",
- sc->memmap[ASPEED_DEV_PRIC1], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->otp),
- "aspeed.otp",
- sc->memmap[ASPEED_DEV_OTP], 0x800);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
}
static const Property aspeed_27x0_coprocessor_properties[] = {
@@ -330,6 +311,7 @@ static void aspeed_soc_ast27x0ssp_class_init(ObjectClass *klass,
sc->valid_cpu_types = valid_cpu_types;
sc->irqmap = aspeed_soc_ast27x0ssp_irqmap;
sc->memmap = aspeed_soc_ast27x0ssp_memmap;
+ sc->unimp_devs = aspeed_soc_ast27x0ssp_unimp_devs;
}
static const TypeInfo aspeed_soc_ast27x0ssp_types[] = {
diff --git a/hw/arm/aspeed_ast27x0-tsp.c b/hw/arm/aspeed_ast27x0-tsp.c
index 39ba062a20..7f057ff135 100644
--- a/hw/arm/aspeed_ast27x0-tsp.c
+++ b/hw/arm/aspeed_ast27x0-tsp.c
@@ -101,6 +101,16 @@ static struct nvic_intc_irq_info ast2700_tsp_intcmap[] = {
{169, 1, 9, NULL},
};
+static const UnimplementedDeviceConfig aspeed_soc_ast27x0tsp_unimp_devs[] = {
+ { "timerctrl", "aspeed.timerctrl", 0x72C10000, 0x200, -1000 },
+ { "ipc0", "aspeed.ipc0", 0x72C1C000, 0x1000, -1000 },
+ { "ipc1", "aspeed.ipc1", 0x74C39000, 0x1000, -1000 },
+ { "pric0", "aspeed.pric0", 0x72140000, 0x1000, -1000 },
+ { "pric1", "aspeed.pric1", 0x74100000, 0x1000, -1000 },
+ { "otp", "aspeed.otp", 0x74C07000, 0x800, -1000 },
+ { }
+};
+
static qemu_irq aspeed_soc_ast27x0tsp_get_irq(AspeedCoprocessorState *s,
int dev)
{
@@ -136,19 +146,6 @@ static void aspeed_soc_ast27x0tsp_init(Object *obj)
TYPE_ASPEED_2700TSP_INTC);
object_initialize_child(obj, "intc1", &a->intc[1],
TYPE_ASPEED_2700TSP_INTCIO);
-
- object_initialize_child(obj, "timerctrl", &s->timerctrl,
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "ipc0", &a->ipc[0],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "ipc1", &a->ipc[1],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "pric0", &a->pric[0],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "pric1", &a->pric[1],
- TYPE_UNIMPLEMENTED_DEVICE);
- object_initialize_child(obj, "otp", &a->otp,
- TYPE_UNIMPLEMENTED_DEVICE);
}
static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)
@@ -283,24 +280,8 @@ static void aspeed_soc_ast27x0tsp_realize(DeviceState *dev_soc, Error **errp)
memory_region_add_subregion(s->memory, sc->memmap[ASPEED_DEV_FMC],
&a->fmc_alias);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&s->timerctrl),
- "aspeed.timerctrl",
- sc->memmap[ASPEED_DEV_TIMER1], 0x200);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->ipc[0]),
- "aspeed.ipc0",
- sc->memmap[ASPEED_DEV_IPC0], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->ipc[1]),
- "aspeed.ipc1",
- sc->memmap[ASPEED_DEV_IPC1], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->pric[0]),
- "aspeed.pric0",
- sc->memmap[ASPEED_DEV_PRIC0], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->pric[1]),
- "aspeed.pric1",
- sc->memmap[ASPEED_DEV_PRIC1], 0x1000);
- aspeed_mmio_map_unimplemented(s->memory, SYS_BUS_DEVICE(&a->otp),
- "aspeed.otp",
- sc->memmap[ASPEED_DEV_OTP], 0x800);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), s->memory, sc->unimp_devs);
}
static const Property aspeed_27x0_coprocessor_properties[] = {
@@ -330,6 +311,7 @@ static void aspeed_soc_ast27x0tsp_class_init(ObjectClass *klass,
sc->valid_cpu_types = valid_cpu_types;
sc->irqmap = aspeed_soc_ast27x0tsp_irqmap;
sc->memmap = aspeed_soc_ast27x0tsp_memmap;
+ sc->unimp_devs = aspeed_soc_ast27x0tsp_unimp_devs;
}
static const TypeInfo aspeed_soc_ast27x0tsp_types[] = {
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 09/12] hw/arm/aspeed_coprocessor: Remove unused unimplemented device fields
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (7 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 08/12] hw/arm/aspeed_ast27x0: Use a table for unimplemented devices for SSP/TSP Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 10/12] hw/arm/aspeed_ast1700: Use a table for unimplemented devices Jamin Lin
` (5 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee, Cédric Le Goater
AST2700 SSP and TSP now use the unimp_devs table and
create_unimplemented_devices() for their unimplemented devices. Remove
the old "ipc", "pric" and "otp" fields in Aspeed27x0CoprocessorState
and the "timerctrl" field in AspeedCoprocessorState, which are not used
anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
---
include/hw/arm/aspeed_coprocessor.h | 4 ----
1 file changed, 4 deletions(-)
diff --git a/include/hw/arm/aspeed_coprocessor.h b/include/hw/arm/aspeed_coprocessor.h
index 39209d2579..b0d72f9163 100644
--- a/include/hw/arm/aspeed_coprocessor.h
+++ b/include/hw/arm/aspeed_coprocessor.h
@@ -22,7 +22,6 @@ struct AspeedCoprocessorState {
MemoryRegion uart_alias;
Clock *sysclk;
- AspeedTimerCtrlState timerctrl;
SerialMM *uart;
int uart_dev;
};
@@ -44,9 +43,6 @@ struct AspeedCoprocessorClass {
struct Aspeed27x0CoprocessorState {
AspeedCoprocessorState parent;
AspeedINTCState intc[2];
- UnimplementedDeviceState ipc[2];
- UnimplementedDeviceState pric[2];
- UnimplementedDeviceState otp;
ARMv7MState armv7m;
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 10/12] hw/arm/aspeed_ast1700: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (8 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 09/12] hw/arm/aspeed_coprocessor: Remove unused unimplemented device fields Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 11/12] hw/arm/aspeed_ast1700: Remove unused unimplemented device field Jamin Lin
` (4 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
Before this change, the I3C unimplemented device of AST1700 needed its
own field in AspeedAST1700SoCState and was created and mapped with
open-coded calls.
Describe it in a table and use create_unimplemented_devices() to create
and map it in the AST1700 memory region. This makes the code easier to
maintain and read.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/arm/aspeed_ast1700.c | 21 ++++++++-------------
1 file changed, 8 insertions(+), 13 deletions(-)
diff --git a/hw/arm/aspeed_ast1700.c b/hw/arm/aspeed_ast1700.c
index 5af5da5b8a..e5d5bf4056 100644
--- a/hw/arm/aspeed_ast1700.c
+++ b/hw/arm/aspeed_ast1700.c
@@ -15,7 +15,6 @@
#define AST2700_SOC_LTPI_SIZE 0x01000000
#define AST1700_SOC_SRAM_SIZE 0x00040000
-#define AST1700_SOC_I3C_SIZE 0x00010000
enum {
ASPEED_AST1700_DEV_SPI0,
@@ -51,6 +50,11 @@ static const hwaddr aspeed_ast1700_io_memmap[] = {
[ASPEED_AST1700_DEV_SPI0_MEM] = 0x04000000,
};
+static const UnimplementedDeviceConfig aspeed_ast1700_unimp_devs[] = {
+ { "ioexp-i3c", "ioexp-i3c", 0x00C20000, 0x00010000, -1000 },
+ { }
+};
+
static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
{
AspeedAST1700SoCState *s = ASPEED_AST1700(dev);
@@ -181,14 +185,9 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->wdt[i]), 0));
}
- /* I3C */
- qdev_prop_set_string(DEVICE(&s->i3c), "name", "ioexp-i3c");
- qdev_prop_set_uint64(DEVICE(&s->i3c), "size", AST1700_SOC_I3C_SIZE);
- sysbus_realize(SYS_BUS_DEVICE(&s->i3c), errp);
- memory_region_add_subregion_overlap(&s->iomem,
- aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_I3C],
- sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->i3c), 0),
- -1000);
+ /* Unimplemented devices */
+ create_unimplemented_devices(OBJECT(s), &s->iomem,
+ aspeed_ast1700_unimp_devs);
}
static void aspeed_ast1700_instance_init(Object *obj)
@@ -238,10 +237,6 @@ static void aspeed_ast1700_instance_init(Object *obj)
&s->wdt[i], "aspeed.wdt-ast2700");
}
- /* I3C */
- object_initialize_child(obj, "ioexp-i3c", &s->i3c,
- TYPE_UNIMPLEMENTED_DEVICE);
-
return;
}
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 11/12] hw/arm/aspeed_ast1700: Remove unused unimplemented device field
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (9 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 10/12] hw/arm/aspeed_ast1700: Use a table for unimplemented devices Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 6:44 ` [PATCH v2 12/12] hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented() Jamin Lin
` (3 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee, Cédric Le Goater
AST1700 now uses create_unimplemented_devices() for its unimplemented
devices. Remove the old "i3c" field in AspeedAST1700SoCState, which is
not used anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
---
include/hw/arm/aspeed_ast1700.h | 2 --
1 file changed, 2 deletions(-)
diff --git a/include/hw/arm/aspeed_ast1700.h b/include/hw/arm/aspeed_ast1700.h
index 39c5977cf1..d30483c88a 100644
--- a/include/hw/arm/aspeed_ast1700.h
+++ b/include/hw/arm/aspeed_ast1700.h
@@ -47,8 +47,6 @@ struct AspeedAST1700SoCState {
AspeedI2CState i2c;
AspeedPWMState pwm;
AspeedWDTState wdt[AST1700_WDT_NUM];
-
- UnimplementedDeviceState i3c;
};
#endif /* ASPEED_AST1700_H */
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* [PATCH v2 12/12] hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented()
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (10 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 11/12] hw/arm/aspeed_ast1700: Remove unused unimplemented device field Jamin Lin
@ 2026-10-12 6:44 ` Jamin Lin
2026-10-12 17:04 ` [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Cédric Le Goater
` (2 subsequent siblings)
14 siblings, 0 replies; 17+ messages in thread
From: Jamin Lin @ 2026-10-12 6:44 UTC (permalink / raw)
To: philmd@oss.qualcomm.com, Cédric Le Goater, Peter Maydell,
Steven Lee, Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley,
Ani Sinha, open list:ASPEED BMCs, open list:All patches CC here
Cc: Jamin Lin, Troy Lee
All Aspeed SoCs now use create_unimplemented_devices() to create and
map their unimplemented devices. Remove aspeed_mmio_map_unimplemented(),
which is not used anymore.
No functional change.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
include/hw/arm/aspeed_soc.h | 3 ---
hw/arm/aspeed_soc_common.c | 11 -----------
2 files changed, 14 deletions(-)
diff --git a/include/hw/arm/aspeed_soc.h b/include/hw/arm/aspeed_soc.h
index 4ef1014ad0..fd860ef9ae 100644
--- a/include/hw/arm/aspeed_soc.h
+++ b/include/hw/arm/aspeed_soc.h
@@ -307,9 +307,6 @@ void aspeed_soc_uart_set_chr(SerialMM *uart, int dev, int uarts_base,
bool aspeed_soc_dram_init(AspeedSoCState *s, Error **errp);
void aspeed_mmio_map(MemoryRegion *memory, SysBusDevice *dev, int n,
hwaddr addr);
-void aspeed_mmio_map_unimplemented(MemoryRegion *memory, SysBusDevice *dev,
- const char *name, hwaddr addr,
- uint64_t size);
void aspeed_board_init_flashes(AspeedSMCState *s, const char *flashtype,
unsigned int count, int unit0);
void aspeed_write_boot_rom(BlockBackend *blk, hwaddr addr, size_t rom_size,
diff --git a/hw/arm/aspeed_soc_common.c b/hw/arm/aspeed_soc_common.c
index fd08793575..54a128c965 100644
--- a/hw/arm/aspeed_soc_common.c
+++ b/hw/arm/aspeed_soc_common.c
@@ -104,17 +104,6 @@ void aspeed_mmio_map(MemoryRegion *memory, SysBusDevice *dev, int n,
memory_region_add_subregion(memory, addr, sysbus_mmio_get_region(dev, n));
}
-void aspeed_mmio_map_unimplemented(MemoryRegion *memory, SysBusDevice *dev,
- const char *name, hwaddr addr, uint64_t size)
-{
- qdev_prop_set_string(DEVICE(dev), "name", name);
- qdev_prop_set_uint64(DEVICE(dev), "size", size);
- sysbus_realize(dev, &error_abort);
-
- memory_region_add_subregion_overlap(memory, addr,
- sysbus_mmio_get_region(dev, 0), -1000);
-}
-
void aspeed_board_init_flashes(AspeedSMCState *s, const char *flashtype,
unsigned int count, int unit0)
{
--
2.53.0
^ permalink raw reply related [flat|nested] 17+ messages in thread* Re: [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (11 preceding siblings ...)
2026-10-12 6:44 ` [PATCH v2 12/12] hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented() Jamin Lin
@ 2026-10-12 17:04 ` Cédric Le Goater
2026-10-13 8:33 ` Philippe Mathieu-Daudé
2026-10-13 12:23 ` Cédric Le Goater
14 siblings, 0 replies; 17+ messages in thread
From: Cédric Le Goater @ 2026-10-12 17:04 UTC (permalink / raw)
To: Jamin Lin, philmd@oss.qualcomm.com, Peter Maydell, Steven Lee,
Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley, Ani Sinha,
open list:ASPEED BMCs, open list:All patches CC here
Cc: Troy Lee
On 10/12/26 08:44, Jamin Lin wrote:
> v1:
> 1. Use unimp array and table for unimplemented devices
> 2. Sort device IDs alphabetically
>
> v2:
> 1. Add a common create_unimplemented_devices() helper and
> UnimplementedDeviceConfig in hw/misc/unimp, as suggested by Philippe.
> 2. Define the unimplemented device table at the SoC class level
> 3. Drop the "unimp" array and the AspeedUnimpDevice table.
> 4. Remove aspeed_mmio_map_unimplemented(), which is not used anymore.
>
> Jamin Lin (12):
> hw/misc/unimp: Add create_unimplemented_devices() helper
> hw/arm/aspeed_ast2400: Use a table for unimplemented devices
> hw/arm/aspeed_ast2600: Use a table for unimplemented devices
> hw/arm/aspeed_ast27x0: Use a table for unimplemented devices
> hw/arm/aspeed_ast10x0: Use a table for unimplemented devices
> hw/arm/aspeed_ast1040: Use a table for unimplemented devices
> hw/arm/aspeed: Remove unused unimplemented device fields
> hw/arm/aspeed_ast27x0: Use a table for unimplemented devices for
> SSP/TSP
> hw/arm/aspeed_coprocessor: Remove unused unimplemented device fields
> hw/arm/aspeed_ast1700: Use a table for unimplemented devices
> hw/arm/aspeed_ast1700: Remove unused unimplemented device field
> hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented()
>
> include/hw/arm/aspeed_ast1700.h | 2 --
> include/hw/arm/aspeed_coprocessor.h | 5 +--
> include/hw/arm/aspeed_soc.h | 14 +-------
> include/hw/misc/unimp.h | 21 +++++++++++
> hw/arm/aspeed_ast1040.c | 40 +++++++--------------
> hw/arm/aspeed_ast10x0.c | 55 ++++++++---------------------
> hw/arm/aspeed_ast1700.c | 21 +++++------
> hw/arm/aspeed_ast2400.c | 25 ++++++-------
> hw/arm/aspeed_ast2600.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0-ssp.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0-tsp.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0.c | 41 +++++++--------------
> hw/arm/aspeed_soc_common.c | 11 ------
> hw/misc/unimp.c | 20 +++++++++++
> 14 files changed, 138 insertions(+), 249 deletions(-)
>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Thanks,
C.
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (12 preceding siblings ...)
2026-10-12 17:04 ` [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Cédric Le Goater
@ 2026-10-13 8:33 ` Philippe Mathieu-Daudé
2026-10-13 12:23 ` Cédric Le Goater
14 siblings, 0 replies; 17+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-10-13 8:33 UTC (permalink / raw)
To: Jamin Lin, Cédric Le Goater, Peter Maydell, Steven Lee,
Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley, Ani Sinha,
open list:ASPEED BMCs, open list:All patches CC here
Cc: Troy Lee
On 12/10/26 08:44, Jamin Lin wrote:
> include/hw/arm/aspeed_ast1700.h | 2 --
> include/hw/arm/aspeed_coprocessor.h | 5 +--
> include/hw/arm/aspeed_soc.h | 14 +-------
> include/hw/misc/unimp.h | 21 +++++++++++
> hw/arm/aspeed_ast1040.c | 40 +++++++--------------
> hw/arm/aspeed_ast10x0.c | 55 ++++++++---------------------
> hw/arm/aspeed_ast1700.c | 21 +++++------
> hw/arm/aspeed_ast2400.c | 25 ++++++-------
> hw/arm/aspeed_ast2600.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0-ssp.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0-tsp.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0.c | 41 +++++++--------------
> hw/arm/aspeed_soc_common.c | 11 ------
> hw/misc/unimp.c | 20 +++++++++++
> 14 files changed, 138 insertions(+), 249 deletions(-)
Per the diff-stat it was worth it IMHO :)
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 17+ messages in thread* Re: [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices
2026-10-12 6:44 [PATCH v2 00/12] hw/arm/aspeed: Use a table for unimplemented devices Jamin Lin
` (13 preceding siblings ...)
2026-10-13 8:33 ` Philippe Mathieu-Daudé
@ 2026-10-13 12:23 ` Cédric Le Goater
14 siblings, 0 replies; 17+ messages in thread
From: Cédric Le Goater @ 2026-10-13 12:23 UTC (permalink / raw)
To: Jamin Lin, philmd@oss.qualcomm.com, Peter Maydell, Steven Lee,
Troy Lee, Kane Chen, Andrew Jeffery, Joel Stanley, Ani Sinha,
open list:ASPEED BMCs, open list:All patches CC here
Cc: Troy Lee
On 10/12/26 08:44, Jamin Lin wrote:
> v1:
> 1. Use unimp array and table for unimplemented devices
> 2. Sort device IDs alphabetically
>
> v2:
> 1. Add a common create_unimplemented_devices() helper and
> UnimplementedDeviceConfig in hw/misc/unimp, as suggested by Philippe.
> 2. Define the unimplemented device table at the SoC class level
> 3. Drop the "unimp" array and the AspeedUnimpDevice table.
> 4. Remove aspeed_mmio_map_unimplemented(), which is not used anymore.
>
> Jamin Lin (12):
> hw/misc/unimp: Add create_unimplemented_devices() helper
> hw/arm/aspeed_ast2400: Use a table for unimplemented devices
> hw/arm/aspeed_ast2600: Use a table for unimplemented devices
> hw/arm/aspeed_ast27x0: Use a table for unimplemented devices
> hw/arm/aspeed_ast10x0: Use a table for unimplemented devices
> hw/arm/aspeed_ast1040: Use a table for unimplemented devices
> hw/arm/aspeed: Remove unused unimplemented device fields
> hw/arm/aspeed_ast27x0: Use a table for unimplemented devices for
> SSP/TSP
> hw/arm/aspeed_coprocessor: Remove unused unimplemented device fields
> hw/arm/aspeed_ast1700: Use a table for unimplemented devices
> hw/arm/aspeed_ast1700: Remove unused unimplemented device field
> hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented()
>
> include/hw/arm/aspeed_ast1700.h | 2 --
> include/hw/arm/aspeed_coprocessor.h | 5 +--
> include/hw/arm/aspeed_soc.h | 14 +-------
> include/hw/misc/unimp.h | 21 +++++++++++
> hw/arm/aspeed_ast1040.c | 40 +++++++--------------
> hw/arm/aspeed_ast10x0.c | 55 ++++++++---------------------
> hw/arm/aspeed_ast1700.c | 21 +++++------
> hw/arm/aspeed_ast2400.c | 25 ++++++-------
> hw/arm/aspeed_ast2600.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0-ssp.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0-tsp.c | 44 +++++++----------------
> hw/arm/aspeed_ast27x0.c | 41 +++++++--------------
> hw/arm/aspeed_soc_common.c | 11 ------
> hw/misc/unimp.c | 20 +++++++++++
> 14 files changed, 138 insertions(+), 249 deletions(-)
>
Applied to
https://github.com/legoater/qemu aspeed-next
Thanks,
C.
^ permalink raw reply [flat|nested] 17+ messages in thread