[PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model

Kane Chen via posted 17 patches 1 week, 2 days ago
Maintainers: "Cédric Le Goater" <clg@kaod.org>, Peter Maydell <peter.maydell@linaro.org>, Steven Lee <steven_lee@aspeedtech.com>, Troy Lee <leetroy@gmail.com>, Jamin Lin <jamin_lin@aspeedtech.com>, Andrew Jeffery <andrew@codeconstruct.com.au>, Joel Stanley <joel@jms.id.au>
[PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model
Posted by Kane Chen via 1 week, 2 days ago
From: Kane-Chen-AS <kane_chen@aspeedtech.com>

Connect the SPI device to AST1700 model.

Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
---
 include/hw/misc/aspeed_ast1700.h |  1 +
 hw/misc/aspeed_ast1700.c         | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/include/hw/misc/aspeed_ast1700.h b/include/hw/misc/aspeed_ast1700.h
index 391c8687f5..e55deea67a 100644
--- a/include/hw/misc/aspeed_ast1700.h
+++ b/include/hw/misc/aspeed_ast1700.h
@@ -33,6 +33,7 @@ struct AspeedAST1700SoCState {
     AspeedLTPIState ltpi;
     SerialMM uart;
     MemoryRegion sram;
+    AspeedSMCState spi;
 };
 
 #endif /* ASPEED_AST1700_H */
diff --git a/hw/misc/aspeed_ast1700.c b/hw/misc/aspeed_ast1700.c
index 6f7ff625b5..ba44e484e8 100644
--- a/hw/misc/aspeed_ast1700.c
+++ b/hw/misc/aspeed_ast1700.c
@@ -20,15 +20,19 @@
 #define AST1700_SOC_SRAM_SIZE        0x00040000
 
 enum {
+    ASPEED_AST1700_DEV_SPI0,
     ASPEED_AST1700_DEV_SRAM,
     ASPEED_AST1700_DEV_UART12,
     ASPEED_AST1700_DEV_LTPI_CTRL,
+    ASPEED_AST1700_DEV_SPI0_MEM,
 };
 
 static const hwaddr aspeed_ast1700_io_memmap[] = {
+    [ASPEED_AST1700_DEV_SPI0]      =  0x00030000,
     [ASPEED_AST1700_DEV_SRAM]      =  0x00BC0000,
     [ASPEED_AST1700_DEV_UART12]    =  0x00C33B00,
     [ASPEED_AST1700_DEV_LTPI_CTRL] =  0x00C34000,
+    [ASPEED_AST1700_DEV_SPI0_MEM]  =  0x04000000,
 };
 static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
 {
@@ -76,6 +80,20 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
                         aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_UART12],
                         sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0));
 
+    /* SPI */
+    object_property_set_link(OBJECT(&s->spi), "dram",
+                             OBJECT(&s->iomem), &error_abort);
+    if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi), errp)) {
+        return;
+    }
+    memory_region_add_subregion(&s->iomem,
+                        aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0],
+                        sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 0));
+
+    memory_region_add_subregion(&s->iomem,
+                        aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0_MEM],
+                        sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 1));
+
     /* LTPI controller */
     if (!sysbus_realize(SYS_BUS_DEVICE(&s->ltpi), errp)) {
         return;
@@ -88,11 +106,21 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
 static void aspeed_ast1700_instance_init(Object *obj)
 {
     AspeedAST1700SoCState *s = ASPEED_AST1700(obj);
+    char socname[8];
+    char typename[64];
+
+    if (sscanf(object_get_typename(obj), "aspeed.ast1700-%7s", socname) != 1) {
+        g_assert_not_reached();
+    }
 
     /* UART */
     object_initialize_child(obj, "uart[*]", &s->uart,
                             TYPE_SERIAL_MM);
 
+    /* SPI */
+    snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", 0, socname);
+    object_initialize_child(obj, "ioexp-spi[*]", &s->spi,
+                            typename);
     /* LTPI controller */
     object_initialize_child(obj, "ltpi-ctrl",
                             &s->ltpi, TYPE_ASPEED_LTPI);
-- 
2.43.0
Re: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model
Posted by Nabih Estefan 1 week, 1 day ago
This patch seems to break qtest-arm
```
37/56 qemu:qtest+qtest-arm / qtest-arm/device-introspect-test ERROR
5.18s killed by signal 6 SIGABRT
>>> QTEST_QEMU_IMG=./qemu-img G_TEST_DBUS_DAEMON=/b/f/w/src/git/qemu/tests/dbus-vmstate-daemon.sh QTEST_QEMU_BINARY=./qemu-system-arm PYTHON=/b/f/w/src/git/qemu/build/pyvenv/bin/python3 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MESON_TEST_ITERATION=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storage-daemon RUST_BACKTRACE=1 ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MALLOC_PERTURB_=175 /b/f/w/src/git/qemu/build/tests/qtest/device-introspect-test --tap -k
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
stderr:
**
ERROR:../hw/misc/aspeed_ast1700.c:113:aspeed_ast1700_instance_init:
code should not be reached
Broken pipe
../tests/qtest/libqtest.c:208: kill_qemu() detected QEMU death from
signal 6 (Aborted) (core dumped)

(test program exited with status code -6)
```

Failed by running:
```
./configure \
  --target-list=arm-softmmu,arm-linux-user,aarch64-softmmu,aarch64-linux-user,i386-softmmu
\
  --cc=clang-18 --extra-cflags=-Wno-deprecated-declarations \
  --cxx=clang++-18 --extra-cxxflags=-Wno-deprecated-declarations
make -j 32 all check-report-unit.junit.xml
check-report-qtest-arm.junit.xml check-report-qtest-aarch64.junit.xml
check-report-qtest-i386.junit.xml

Thanks,
Nabih

Nabih Estefan (he/him) |  Software Engineer |
nabihestefan@google.com |  857-308-9574



On Tue, Nov 4, 2025 at 8:03 PM Kane Chen via <qemu-devel@nongnu.org> wrote:
>
> From: Kane-Chen-AS <kane_chen@aspeedtech.com>
>
> Connect the SPI device to AST1700 model.
>
> Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
> ---
>  include/hw/misc/aspeed_ast1700.h |  1 +
>  hw/misc/aspeed_ast1700.c         | 28 ++++++++++++++++++++++++++++
>  2 files changed, 29 insertions(+)
>
> diff --git a/include/hw/misc/aspeed_ast1700.h b/include/hw/misc/aspeed_ast1700.h
> index 391c8687f5..e55deea67a 100644
> --- a/include/hw/misc/aspeed_ast1700.h
> +++ b/include/hw/misc/aspeed_ast1700.h
> @@ -33,6 +33,7 @@ struct AspeedAST1700SoCState {
>      AspeedLTPIState ltpi;
>      SerialMM uart;
>      MemoryRegion sram;
> +    AspeedSMCState spi;
>  };
>
>  #endif /* ASPEED_AST1700_H */
> diff --git a/hw/misc/aspeed_ast1700.c b/hw/misc/aspeed_ast1700.c
> index 6f7ff625b5..ba44e484e8 100644
> --- a/hw/misc/aspeed_ast1700.c
> +++ b/hw/misc/aspeed_ast1700.c
> @@ -20,15 +20,19 @@
>  #define AST1700_SOC_SRAM_SIZE        0x00040000
>
>  enum {
> +    ASPEED_AST1700_DEV_SPI0,
>      ASPEED_AST1700_DEV_SRAM,
>      ASPEED_AST1700_DEV_UART12,
>      ASPEED_AST1700_DEV_LTPI_CTRL,
> +    ASPEED_AST1700_DEV_SPI0_MEM,
>  };
>
>  static const hwaddr aspeed_ast1700_io_memmap[] = {
> +    [ASPEED_AST1700_DEV_SPI0]      =  0x00030000,
>      [ASPEED_AST1700_DEV_SRAM]      =  0x00BC0000,
>      [ASPEED_AST1700_DEV_UART12]    =  0x00C33B00,
>      [ASPEED_AST1700_DEV_LTPI_CTRL] =  0x00C34000,
> +    [ASPEED_AST1700_DEV_SPI0_MEM]  =  0x04000000,
>  };
>  static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
>  {
> @@ -76,6 +80,20 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
>                          aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_UART12],
>                          sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0));
>
> +    /* SPI */
> +    object_property_set_link(OBJECT(&s->spi), "dram",
> +                             OBJECT(&s->iomem), &error_abort);
> +    if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi), errp)) {
> +        return;
> +    }
> +    memory_region_add_subregion(&s->iomem,
> +                        aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0],
> +                        sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 0));
> +
> +    memory_region_add_subregion(&s->iomem,
> +                        aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0_MEM],
> +                        sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 1));
> +
>      /* LTPI controller */
>      if (!sysbus_realize(SYS_BUS_DEVICE(&s->ltpi), errp)) {
>          return;
> @@ -88,11 +106,21 @@ static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)
>  static void aspeed_ast1700_instance_init(Object *obj)
>  {
>      AspeedAST1700SoCState *s = ASPEED_AST1700(obj);
> +    char socname[8];
> +    char typename[64];
> +
> +    if (sscanf(object_get_typename(obj), "aspeed.ast1700-%7s", socname) != 1) {
> +        g_assert_not_reached();
> +    }
>
>      /* UART */
>      object_initialize_child(obj, "uart[*]", &s->uart,
>                              TYPE_SERIAL_MM);
>
> +    /* SPI */
> +    snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", 0, socname);
> +    object_initialize_child(obj, "ioexp-spi[*]", &s->spi,
> +                            typename);
>      /* LTPI controller */
>      object_initialize_child(obj, "ltpi-ctrl",
>                              &s->ltpi, TYPE_ASPEED_LTPI);
> --
> 2.43.0
>
>
RE: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model
Posted by Kane Chen 1 week, 1 day ago
Hi Nabih,

Thanks for pointing this out. It seems I need to add the abstract attribute to the aspeed_ast1700_info
structure, as shown below:

diff --git a/hw/misc/aspeed_ast1700.c b/hw/misc/aspeed_ast1700.c
index 3d9a920a7a..ec95217f16 100644
--- a/hw/misc/aspeed_ast1700.c
+++ b/hw/misc/aspeed_ast1700.c
@@ -286,6 +286,7 @@ static const TypeInfo aspeed_ast1700_info = {
     .instance_size = sizeof(AspeedAST1700SoCState),
     .class_init    = aspeed_ast1700_class_init,
     .instance_init = aspeed_ast1700_instance_init,
+    .abstract      = true,
 };

On the other hand, I encountered a timeout error while running the make check-functional test.
I need to investigate why the test case failed.
Once this issue is clarified, I’ll submit another patch for further review.

Best Regards,
Kane
> -----Original Message-----
> From: Nabih Estefan <nabihestefan@google.com>
> Sent: Thursday, November 6, 2025 5:20 AM
> To: Kane Chen <kane_chen@aspeedtech.com>
> Cc: Cédric Le Goater <clg@kaod.org>; Peter Maydell
> <peter.maydell@linaro.org>; Steven Lee <steven_lee@aspeedtech.com>; Troy
> Lee <leetroy@gmail.com>; Jamin Lin <jamin_lin@aspeedtech.com>; Andrew
> Jeffery <andrew@codeconstruct.com.au>; Joel Stanley <joel@jms.id.au>;
> open list:ASPEED BMCs <qemu-arm@nongnu.org>; open list:All patches CC
> here <qemu-devel@nongnu.org>; Troy Lee <troy_lee@aspeedtech.com>
> Subject: Re: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700
> model
> 
> This patch seems to break qtest-arm
> ```
> 37/56 qemu:qtest+qtest-arm / qtest-arm/device-introspect-test ERROR 5.18s
> killed by signal 6 SIGABRT
> >>> QTEST_QEMU_IMG=./qemu-img
> >>>
> G_TEST_DBUS_DAEMON=/b/f/w/src/git/qemu/tests/dbus-vmstate-daemon.s
> h
> >>> QTEST_QEMU_BINARY=./qemu-system-arm
> >>> PYTHON=/b/f/w/src/git/qemu/build/pyvenv/bin/python3
> >>>
> MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_
> >>> stacktrace=1 MESON_TEST_ITERATION=1
> >>>
> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print
> >>> _stacktrace=1
> >>>
> QTEST_QEMU_STORAGE_DAEMON_BINARY=./storage-daemon/qemu-storag
> e-daemo
> >>> n RUST_BACKTRACE=1
> >>> ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1
> >>> MALLOC_PERTURB_=175
> >>> /b/f/w/src/git/qemu/build/tests/qtest/device-introspect-test --tap
> >>> -k
> ――――――――――――――――――――――――――――――――――――― ✀
> ―――――――――――――――――――――――――――――――――――――
> stderr:
> **
> ERROR:../hw/misc/aspeed_ast1700.c:113:aspeed_ast1700_instance_init:
> code should not be reached
> Broken pipe
> ../tests/qtest/libqtest.c:208: kill_qemu() detected QEMU death from signal 6
> (Aborted) (core dumped)
> 
> (test program exited with status code -6) ```
> 
> Failed by running:
> ```
> ./configure \
> 
> --target-list=arm-softmmu,arm-linux-user,aarch64-softmmu,aarch64-linux-us
> er,i386-softmmu
> \
>   --cc=clang-18 --extra-cflags=-Wno-deprecated-declarations \
>   --cxx=clang++-18 --extra-cxxflags=-Wno-deprecated-declarations
> make -j 32 all check-report-unit.junit.xml check-report-qtest-arm.junit.xml
> check-report-qtest-aarch64.junit.xml
> check-report-qtest-i386.junit.xml
> 
> Thanks,
> Nabih
> 
> Nabih Estefan (he/him) |  Software Engineer | nabihestefan@google.com |
> 857-308-9574
> 
> 
> 
> On Tue, Nov 4, 2025 at 8:03 PM Kane Chen via <qemu-devel@nongnu.org>
> wrote:
> >
> > From: Kane-Chen-AS <kane_chen@aspeedtech.com>
> >
> > Connect the SPI device to AST1700 model.
> >
> > Signed-off-by: Kane-Chen-AS <kane_chen@aspeedtech.com>
> > ---
> >  include/hw/misc/aspeed_ast1700.h |  1 +
> >  hw/misc/aspeed_ast1700.c         | 28
> ++++++++++++++++++++++++++++
> >  2 files changed, 29 insertions(+)
> >
> > diff --git a/include/hw/misc/aspeed_ast1700.h
> > b/include/hw/misc/aspeed_ast1700.h
> > index 391c8687f5..e55deea67a 100644
> > --- a/include/hw/misc/aspeed_ast1700.h
> > +++ b/include/hw/misc/aspeed_ast1700.h
> > @@ -33,6 +33,7 @@ struct AspeedAST1700SoCState {
> >      AspeedLTPIState ltpi;
> >      SerialMM uart;
> >      MemoryRegion sram;
> > +    AspeedSMCState spi;
> >  };
> >
> >  #endif /* ASPEED_AST1700_H */
> > diff --git a/hw/misc/aspeed_ast1700.c b/hw/misc/aspeed_ast1700.c index
> > 6f7ff625b5..ba44e484e8 100644
> > --- a/hw/misc/aspeed_ast1700.c
> > +++ b/hw/misc/aspeed_ast1700.c
> > @@ -20,15 +20,19 @@
> >  #define AST1700_SOC_SRAM_SIZE        0x00040000
> >
> >  enum {
> > +    ASPEED_AST1700_DEV_SPI0,
> >      ASPEED_AST1700_DEV_SRAM,
> >      ASPEED_AST1700_DEV_UART12,
> >      ASPEED_AST1700_DEV_LTPI_CTRL,
> > +    ASPEED_AST1700_DEV_SPI0_MEM,
> >  };
> >
> >  static const hwaddr aspeed_ast1700_io_memmap[] = {
> > +    [ASPEED_AST1700_DEV_SPI0]      =  0x00030000,
> >      [ASPEED_AST1700_DEV_SRAM]      =  0x00BC0000,
> >      [ASPEED_AST1700_DEV_UART12]    =  0x00C33B00,
> >      [ASPEED_AST1700_DEV_LTPI_CTRL] =  0x00C34000,
> > +    [ASPEED_AST1700_DEV_SPI0_MEM]  =  0x04000000,
> >  };
> >  static void aspeed_ast1700_realize(DeviceState *dev, Error **errp)  {
> > @@ -76,6 +80,20 @@ static void aspeed_ast1700_realize(DeviceState *dev,
> Error **errp)
> >
> aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_UART12],
> >
> > sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->uart), 0));
> >
> > +    /* SPI */
> > +    object_property_set_link(OBJECT(&s->spi), "dram",
> > +                             OBJECT(&s->iomem), &error_abort);
> > +    if (!sysbus_realize(SYS_BUS_DEVICE(&s->spi), errp)) {
> > +        return;
> > +    }
> > +    memory_region_add_subregion(&s->iomem,
> > +
> aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0],
> > +
> > + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 0));
> > +
> > +    memory_region_add_subregion(&s->iomem,
> > +
> aspeed_ast1700_io_memmap[ASPEED_AST1700_DEV_SPI0_MEM],
> > +
> > + sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->spi), 1));
> > +
> >      /* LTPI controller */
> >      if (!sysbus_realize(SYS_BUS_DEVICE(&s->ltpi), errp)) {
> >          return;
> > @@ -88,11 +106,21 @@ static void aspeed_ast1700_realize(DeviceState
> > *dev, Error **errp)  static void aspeed_ast1700_instance_init(Object
> > *obj)  {
> >      AspeedAST1700SoCState *s = ASPEED_AST1700(obj);
> > +    char socname[8];
> > +    char typename[64];
> > +
> > +    if (sscanf(object_get_typename(obj), "aspeed.ast1700-%7s",
> socname) != 1) {
> > +        g_assert_not_reached();
> > +    }
> >
> >      /* UART */
> >      object_initialize_child(obj, "uart[*]", &s->uart,
> >                              TYPE_SERIAL_MM);
> >
> > +    /* SPI */
> > +    snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", 0,
> socname);
> > +    object_initialize_child(obj, "ioexp-spi[*]", &s->spi,
> > +                            typename);
> >      /* LTPI controller */
> >      object_initialize_child(obj, "ltpi-ctrl",
> >                              &s->ltpi, TYPE_ASPEED_LTPI);
> > --
> > 2.43.0
> >
> >
Re: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model
Posted by Cédric Le Goater 1 week, 1 day ago
On 11/6/25 11:11, Kane Chen wrote:
> Hi Nabih,
> 
> Thanks for pointing this out. It seems I need to add the abstract attribute to the aspeed_ast1700_info
> structure, as shown below:
> 
> diff --git a/hw/misc/aspeed_ast1700.c b/hw/misc/aspeed_ast1700.c
> index 3d9a920a7a..ec95217f16 100644
> --- a/hw/misc/aspeed_ast1700.c
> +++ b/hw/misc/aspeed_ast1700.c
> @@ -286,6 +286,7 @@ static const TypeInfo aspeed_ast1700_info = {
>       .instance_size = sizeof(AspeedAST1700SoCState),
>       .class_init    = aspeed_ast1700_class_init,
>       .instance_init = aspeed_ast1700_instance_init,
> +    .abstract      = true,
>   };

Hmm,

Please rework all typenames in aspeed_ast1700_instance_init(): remove
all snprintf() and use directly strings like "aspeed.gpio-ast2700".
For now, It should be fine. We will see if extensions are needed
in the future.

Also, I don't see why you need :

   static const TypeInfo aspeed_ast1700_ast2700_info = {
       .name = TYPE_ASPEED_AST1700_AST2700,
       .parent = TYPE_ASPEED_AST1700,
   };

Can't you use directly TYPE_ASPEED_AST1700 instead  ?

> On the other hand, I encountered a timeout error while running the make check-functional test.
> I need to investigate why the test case failed.
> Once this issue is clarified, I’ll submit another patch for further review.

Wait for some feedback from me before resending.

Thanks,

C.

RE: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model
Posted by Kane Chen 1 week ago
Hi Cédric,

The reason I registered TypeInfo aspeed_ast1700_ast2700_info is that AST1700
may be connected to another SoC in the future. As you mentioned, at the current
stage it should be fine to use a fixed type name, since we only have AST2700
supporting AST1700. I'll update the related code and remove aspeed_ast1700_ast2700_info
accordingly.

If you have any other comments on the remaining patches, please let me know.
I'll wait for feedback from you or others before proceeding further.

Best Regards,
Kane
> -----Original Message-----
> From: Cédric Le Goater <clg@kaod.org>
> Sent: Thursday, November 6, 2025 6:22 PM
> To: Kane Chen <kane_chen@aspeedtech.com>; Nabih Estefan
> <nabihestefan@google.com>
> Cc: Peter Maydell <peter.maydell@linaro.org>; Steven Lee
> <steven_lee@aspeedtech.com>; Troy Lee <leetroy@gmail.com>; Jamin Lin
> <jamin_lin@aspeedtech.com>; Andrew Jeffery
> <andrew@codeconstruct.com.au>; Joel Stanley <joel@jms.id.au>; open
> list:ASPEED BMCs <qemu-arm@nongnu.org>; open list:All patches CC here
> <qemu-devel@nongnu.org>; Troy Lee <troy_lee@aspeedtech.com>
> Subject: Re: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700
> model
> 
> On 11/6/25 11:11, Kane Chen wrote:
> > Hi Nabih,
> >
> > Thanks for pointing this out. It seems I need to add the abstract
> > attribute to the aspeed_ast1700_info structure, as shown below:
> >
> > diff --git a/hw/misc/aspeed_ast1700.c b/hw/misc/aspeed_ast1700.c index
> > 3d9a920a7a..ec95217f16 100644
> > --- a/hw/misc/aspeed_ast1700.c
> > +++ b/hw/misc/aspeed_ast1700.c
> > @@ -286,6 +286,7 @@ static const TypeInfo aspeed_ast1700_info = {
> >       .instance_size = sizeof(AspeedAST1700SoCState),
> >       .class_init    = aspeed_ast1700_class_init,
> >       .instance_init = aspeed_ast1700_instance_init,
> > +    .abstract      = true,
> >   };
> 
> Hmm,
> 
> Please rework all typenames in aspeed_ast1700_instance_init(): remove all
> snprintf() and use directly strings like "aspeed.gpio-ast2700".
> For now, It should be fine. We will see if extensions are needed in the future.
> 
> Also, I don't see why you need :
> 
>    static const TypeInfo aspeed_ast1700_ast2700_info = {
>        .name = TYPE_ASPEED_AST1700_AST2700,
>        .parent = TYPE_ASPEED_AST1700,
>    };
> 
> Can't you use directly TYPE_ASPEED_AST1700 instead  ?
> 
> > On the other hand, I encountered a timeout error while running the make
> check-functional test.
> > I need to investigate why the test case failed.
> > Once this issue is clarified, I’ll submit another patch for further review.
> 
> Wait for some feedback from me before resending.
> 
> Thanks,
> 
> C.
Re: [PATCH v2 09/17] hw/arm/aspeed: Attach SPI device to AST1700 model
Posted by Cédric Le Goater 1 week ago
Hello Kane,

On 11/7/25 06:39, Kane Chen wrote:
> Hi Cédric,
> 
> The reason I registered TypeInfo aspeed_ast1700_ast2700_info is that AST1700
> may be connected to another SoC in the future. As you mentioned, at the current
> stage it should be fine to use a fixed type name, since we only have AST2700
> supporting AST1700. 

It is good to prepare ground but it's a bit early. Let's keep it simple for
now.

> I'll update the related code and remove aspeed_ast1700_ast2700_info
> accordingly.
> 
> If you have any other comments on the remaining patches, please let me know.
> I'll wait for feedback from you or others before proceeding further.

I will review in the following weeks.

Current focus is on QEMU 10.2 fixes. Please test !

Thanks,

C.