All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "philmd@oss.qualcomm.com" <philmd@oss.qualcomm.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	"Troy Lee" <leetroy@gmail.com>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Joel Stanley" <joel@jms.id.au>,
	"Ani Sinha" <anisinha@redhat.com>,
	"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>, Troy Lee <troy_lee@aspeedtech.com>
Subject: [PATCH v2 10/12] hw/arm/aspeed_ast1700: Use a table for unimplemented devices
Date: Mon, 12 Oct 2026 06:44:57 +0000	[thread overview]
Message-ID: <20261012064445.2571633-11-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20261012064445.2571633-1-jamin_lin@aspeedtech.com>

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


  parent reply	other threads:[~2026-10-12  6:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-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
2026-10-12  6:44 ` [PATCH v2 03/12] hw/arm/aspeed_ast2600: " Jamin Lin
2026-10-12  6:44 ` [PATCH v2 04/12] hw/arm/aspeed_ast27x0: " Jamin Lin
2026-10-12  6:44 ` [PATCH v2 05/12] hw/arm/aspeed_ast10x0: " Jamin Lin
2026-10-12  6:44 ` [PATCH v2 06/12] hw/arm/aspeed_ast1040: " Jamin Lin
2026-10-12  6:44 ` [PATCH v2 07/12] hw/arm/aspeed: Remove unused unimplemented device fields 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
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 [this message]
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 ` [PATCH v2 12/12] hw/arm/aspeed: Remove unused aspeed_mmio_map_unimplemented() Jamin Lin
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

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=20261012064445.2571633-11-jamin_lin@aspeedtech.com \
    --to=jamin_lin@aspeedtech.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=anisinha@redhat.com \
    --cc=clg@kaod.org \
    --cc=joel@jms.id.au \
    --cc=kane_chen@aspeedtech.com \
    --cc=leetroy@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@oss.qualcomm.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=steven_lee@aspeedtech.com \
    --cc=troy_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 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.