[PATCH 2/3] hw/arm/Kconfig: Add missing dependency ZYNQ -> USB_CHIPIDEA

Philippe Mathieu-Daudé posted 3 patches 4 years, 8 months ago
[PATCH 2/3] hw/arm/Kconfig: Add missing dependency ZYNQ -> USB_CHIPIDEA
Posted by Philippe Mathieu-Daudé 4 years, 8 months ago
When using a binary built using --without-default-devices we get:

  $ qemu-system-arm -M xilinx-zynq-a9
  **
  ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL)
  Bail out! ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL)

Looking at the stack trace:

(gdb) bt
  #3  0x00007ffff6e229ff in g_assertion_message_expr () at /lib64/libglib-2.0.so.0
  #4  0x00005555558d3f01 in object_new_with_type (type=<optimized out>) at qom/object.c:714
  #5  0x00005555558d3f59 in object_new (typename=typename@entry=0x555555ad4545 "usb-chipidea") at qom/object.c:747
  #6  0x00005555558cd526 in qdev_new (name=name@entry=0x555555ad4545 "usb-chipidea") at hw/core/qdev.c:153
  #7  0x0000555555739fc6 in sysbus_create_varargs (name=name@entry=0x555555ad4545 "usb-chipidea", addr=addr@entry=3758104576) at hw/core/sysbus.c:234
  #8  0x0000555555796b57 in sysbus_create_simple (irq=<optimized out>, addr=3758104576, name=0x555555ad4545 "usb-chipidea") at include/hw/sysbus.h:104
  #9  zynq_init (machine=0x555555de07a0) at hw/arm/xilinx_zynq.c:254
  #10 0x000055555573707c in machine_run_board_init (machine=machine@entry=0x555555de07a0) at hw/core/machine.c:1238

When replacing the xlnx,ps7-usb device by the IDEA one in commit
616ec12d0fc ("hw/arm/xilinx_zynq: Fix USB port instantiation") we
forgot to add the Kconfig dependency on the new device. Do it now.

Fixes: 616ec12d0fc ("hw/arm/xilinx_zynq: Fix USB port instantiation")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/arm/Kconfig b/hw/arm/Kconfig
index 585de92f00a..838737656f7 100644
--- a/hw/arm/Kconfig
+++ b/hw/arm/Kconfig
@@ -292,6 +292,7 @@ config ZYNQ
     select XILINX_SPI
     select XILINX_SPIPS
     select ZYNQ_DEVCFG
+    select USB_CHIPIDEA
 
 config ARM_V7M
     bool
-- 
2.26.3

Re: [PATCH 2/3] hw/arm/Kconfig: Add missing dependency ZYNQ -> USB_CHIPIDEA
Posted by Peter Maydell 4 years, 8 months ago
On Wed, 19 May 2021 at 21:09, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> When using a binary built using --without-default-devices we get:
>
>   $ qemu-system-arm -M xilinx-zynq-a9
>   **
>   ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL)
>   Bail out! ERROR:qom/object.c:714:object_new_with_type: assertion failed: (type != NULL)
>
> Looking at the stack trace:
>
> (gdb) bt
>   #3  0x00007ffff6e229ff in g_assertion_message_expr () at /lib64/libglib-2.0.so.0
>   #4  0x00005555558d3f01 in object_new_with_type (type=<optimized out>) at qom/object.c:714
>   #5  0x00005555558d3f59 in object_new (typename=typename@entry=0x555555ad4545 "usb-chipidea") at qom/object.c:747
>   #6  0x00005555558cd526 in qdev_new (name=name@entry=0x555555ad4545 "usb-chipidea") at hw/core/qdev.c:153
>   #7  0x0000555555739fc6 in sysbus_create_varargs (name=name@entry=0x555555ad4545 "usb-chipidea", addr=addr@entry=3758104576) at hw/core/sysbus.c:234
>   #8  0x0000555555796b57 in sysbus_create_simple (irq=<optimized out>, addr=3758104576, name=0x555555ad4545 "usb-chipidea") at include/hw/sysbus.h:104
>   #9  zynq_init (machine=0x555555de07a0) at hw/arm/xilinx_zynq.c:254
>   #10 0x000055555573707c in machine_run_board_init (machine=machine@entry=0x555555de07a0) at hw/core/machine.c:1238
>
> When replacing the xlnx,ps7-usb device by the IDEA one in commit
> 616ec12d0fc ("hw/arm/xilinx_zynq: Fix USB port instantiation") we
> forgot to add the Kconfig dependency on the new device. Do it now.
>
> Fixes: 616ec12d0fc ("hw/arm/xilinx_zynq: Fix USB port instantiation")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM