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 <[email protected]>
> Sent: Thursday, November 6, 2025 5:20 AM
> To: Kane Chen <[email protected]>
> Cc: Cédric Le Goater <[email protected]>; Peter Maydell
> <[email protected]>; Steven Lee <[email protected]>; Troy
> Lee <[email protected]>; Jamin Lin <[email protected]>; Andrew
> Jeffery <[email protected]>; Joel Stanley <[email protected]>;
> open list:ASPEED BMCs <[email protected]>; open list:All patches CC
> here <[email protected]>; Troy Lee <[email protected]>
> 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 | [email protected] |
> 857-308-9574
> 
> 
> 
> On Tue, Nov 4, 2025 at 8:03 PM Kane Chen via <[email protected]>
> wrote:
> >
> > From: Kane-Chen-AS <[email protected]>
> >
> > Connect the SPI device to AST1700 model.
> >
> > Signed-off-by: Kane-Chen-AS <[email protected]>
> > ---
> >  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
> >
> >

Reply via email to