Skip to contentSkip to conversation

hw/arm/Kconfig: Fix issues with USB_CHIPIDEA / IMX_USBPHY symbols

PATCH In review Philippe Mathieu-Daudé 2 participants 7 messages May 19, 2021 – May 27, 2021 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

cover hw/arm/Kconfig: Fix issues with USB_CHIPIDEA / IMX_USBPHY symbols

Fix 2 more issues when using --without-default-devices builds (xilinx-zynq-a9 and mcimx6ul-evk machines).

In an ideal world we'd have infinite compute power and would run all tests, but in this one I only test this configuration manually from time to time. We might start using it more...

Philippe Mathieu-Daudé (3):
hw/usb/Kconfig: Introduce USB_CHIPIDEA symbol hw/arm/Kconfig: Add missing dependency ZYNQ -> USB_CHIPIDEA hw/arm/Kconfig: Add missing dependency IMX_USBPHY -> FSL_IMX6UL

 hw/arm/Kconfig     | 6 ++++++
 hw/usb/Kconfig     | 3 +++
 hw/usb/meson.build | 2 +-
 3 files changed, 10 insertions(+), 1 deletion(-)
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/3 hw/usb/Kconfig: Introduce USB_CHIPIDEA symbol

Currently the TYPE_CHIPIDEA model is only built when the IMX machines are built. Since it is not specific to IMX, add its symbol to allow other machines to use it.

---
 hw/arm/Kconfig     | 4 ++++
 hw/usb/Kconfig     | 3 +++
 hw/usb/meson.build | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
hw/arm/Kconfig +4 -0
index b887f6a5b17..585de92f00a 100644
@@ -385,6 +385,7 @@ config FSL_IMX25
     select IMX_I2C
     select WDT_IMX2
     select DS1338
+    select USB_CHIPIDEA
 
 config FSL_IMX31
     bool
@@ -403,6 +404,7 @@ config FSL_IMX6
     select IMX_USBPHY
     select WDT_IMX2
     select SDHCI
+    select USB_CHIPIDEA
 
 config ASPEED_SOC
     bool
@@ -447,6 +449,7 @@ config FSL_IMX7
     select PCI_EXPRESS_DESIGNWARE
     select SDHCI
     select UNIMP
+    select USB_CHIPIDEA
 
 config ARM_SMMUV3
     bool
@@ -460,6 +463,7 @@ config FSL_IMX6UL
     select WDT_IMX2
     select SDHCI
     select UNIMP
+    select USB_CHIPIDEA
 
 config MICROBIT
     bool
hw/usb/Kconfig +3 -0
index 53f8283ffdc..5b230cfbf33 100644
@@ -133,3 +133,6 @@ config XLNX_USB_SUBSYS
     bool
     default y if XLNX_VERSAL
     select USB_DWC3
+
+config USB_CHIPIDEA
+    bool
hw/usb/meson.build +1 -1
index f357270d0b6..67df878f0f3 100644
@@ -27,7 +27,7 @@
 softmmu_ss.add(when: 'CONFIG_USB_DWC3', if_true: files('hcd-dwc3.c'))
 
 softmmu_ss.add(when: 'CONFIG_TUSB6010', if_true: files('tusb6010.c'))
-softmmu_ss.add(when: 'CONFIG_IMX', if_true: files('chipidea.c'))
+softmmu_ss.add(when: 'CONFIG_USB_CHIPIDEA', if_true: files('chipidea.c'))
 softmmu_ss.add(when: 'CONFIG_IMX_USBPHY', if_true: files('imx-usb-phy.c'))
 softmmu_ss.add(when: 'CONFIG_VT82C686', if_true: files('vt82c686-uhci-pci.c'))
 specific_ss.add(when: 'CONFIG_XLNX_VERSAL', if_true: files('xlnx-versal-usb2-ctrl-regs.c'))
Signature · 1 line
2.26.3
#2 lore raw

Re: [PATCH 1/3] hw/usb/Kconfig: Introduce USB_CHIPIDEA symbol

Quoted 41 lines · Philippe Mathieu-Daudé

Currently the TYPE_CHIPIDEA model is only built when the IMX machines are built. Since it is not specific to IMX, add its symbol to allow other machines to use it.

---
 hw/arm/Kconfig     | 4 ++++
 hw/usb/Kconfig     | 3 +++
 hw/usb/meson.build | 2 +-
 3 files changed, 8 insertions(+), 1 deletion(-)
hw/arm/Kconfig +3 -0
index b887f6a5b17..585de92f00a 100644
@@ -385,6 +385,7 @@ config FSL_IMX25
     select IMX_I2C
     select WDT_IMX2
     select DS1338
+    select USB_CHIPIDEA
 
 config FSL_IMX31
     bool
@@ -403,6 +404,7 @@ config FSL_IMX6
     select IMX_USBPHY
     select WDT_IMX2
     select SDHCI
+    select USB_CHIPIDEA
 
 config ASPEED_SOC
     bool
@@ -447,6 +449,7 @@ config FSL_IMX7
     select PCI_EXPRESS_DESIGNWARE
     select SDHCI
     select UNIMP
+    select USB_CHIPIDEA
 
 config ARM_SMMUV3
     bool

hw/arm/Kconfig config FSL_IMX6UL · line 469

Quoted 7 lines
hw/arm/Kconfig +1 -0
@@ -460,6 +463,7 @@ config FSL_IMX6UL
     select WDT_IMX2
     select SDHCI
     select UNIMP
+    select USB_CHIPIDEA
 
 config MICROBIT
     bool

Missing "select USB_CHIPIDEA" in "config FSL_IMX31" ?

(Side note: is it worth moving the FSL_* config sections so they're all next to each other? We seem to have allowed them to become separated by some other unrelated sections...)

thanks
-- PMM

#3 lore raw

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

In reply to Philippe Mathieu-Daudé

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")
---
 hw/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/arm/Kconfig +1 -0
index 585de92f00a..838737656f7 100644
@@ -292,6 +292,7 @@ config ZYNQ
     select XILINX_SPI
     select XILINX_SPIPS
     select ZYNQ_DEVCFG
+    select USB_CHIPIDEA
 
 config ARM_V7M
     bool
Signature · 1 line
2.26.3
Reviewed-by on v1 2/3
#4 lore raw

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

Quoted 18 lines · Philippe Mathieu-Daudé

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
Quoted 8 lines

#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")

thanks
-- PMM

#5 lore raw

PATCH 3/3 hw/arm/Kconfig: Add missing dependency IMX_USBPHY -> FSL_IMX6UL

In reply to Philippe Mathieu-Daudé

We added IMX_USBPHY in commit 0701a5efa01 ("hw/usb: Add basic i.MX USB Phy support") and had the FSL_IMX6 machine select it, however this machine did not use the IMX_USBPHY until commit 49cd55789bb ("hw/arm/fsl-imx6: Wire up USB controllers"). Commit 17372bd812d ("hw/arm/fsl-imx6ul: Wire up USB controllers") added the similar dependency but forgot to select the Kconfig symbol. Do it now to solve when building using --without-default-devices:

  $ qemu-system-arm -M mcimx6ul-evk
  qemu-system-arm: missing object type 'imx.usbphy'
  Aborted (core dumped)
Fixes 17372bd812d ("hw/arm/fsl-imx6ul: Wire up USB controllers")
---
 hw/arm/Kconfig | 1 +
 1 file changed, 1 insertion(+)
hw/arm/Kconfig +1 -0
index 838737656f7..3c3e2e94086 100644
@@ -465,6 +465,7 @@ config FSL_IMX6UL
     select SDHCI
     select UNIMP
     select USB_CHIPIDEA
+    select IMX_USBPHY
 
 config MICROBIT
     bool
Signature · 1 line
2.26.3
Reviewed-by on v1 3/3
#6 lore raw

Re: [PATCH 3/3] hw/arm/Kconfig: Add missing dependency IMX_USBPHY -> FSL_IMX6UL

Quoted 9 lines · Philippe Mathieu-Daudé

We added IMX_USBPHY in commit 0701a5efa01 ("hw/usb: Add basic i.MX USB Phy support") and had the FSL_IMX6 machine select it, however this machine did not use the IMX_USBPHY until commit 49cd55789bb ("hw/arm/fsl-imx6: Wire up USB controllers"). Commit 17372bd812d ("hw/arm/fsl-imx6ul: Wire up USB controllers") added the similar dependency but forgot to select the Kconfig symbol. Do it now to solve when building using --without-default-devices:

Quoted 8 lines
  $ qemu-system-arm -M mcimx6ul-evk
  qemu-system-arm: missing object type 'imx.usbphy'
  Aborted (core dumped)
Fixes 17372bd812d ("hw/arm/fsl-imx6ul: Wire up USB controllers")
---
 hw/arm/Kconfig | 1 +

thanks
-- PMM