Skip to contentSkip to conversation

hw: Only compile the usb-dwc2 controller if it is really needed

PATCH Applied Thomas Huth 4 participants 5 messages Jul 22, 2020 – Jul 24, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hw: Only compile the usb-dwc2 controller if it is really needed

The USB_DWC2 switch is currently "default y", so it is included in all qemu-system-* builds, even if it is not needed. Even worse, it does a "select USB", so USB devices are now showing up as available on targets that do not support USB at all. This sysbus device should only be included by the boards that need it, i.e. by the Raspi machines.

Fixes 153ef1662c ("dwc-hsotg (dwc2) USB host controller emulation")
---
 hw/arm/Kconfig | 1 +
 hw/usb/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/arm/Kconfig +1 -0
index 4a224a6351..bc3a423940 100644
@@ -315,6 +315,7 @@ config RASPI
     select FRAMEBUFFER
     select PL011 # UART
     select SDHCI
+    select USB_DWC2
 
 config STM32F205_SOC
     bool
hw/usb/Kconfig +0 -1
index d4d8c37c28..5e63dc75f8 100644
@@ -48,7 +48,6 @@ config USB_MUSB
 
 config USB_DWC2
     bool
-    default y
     select USB
 
 config TUSB6010
Signature · 1 line
2.18.1
#1 lore raw
Quoted 5 lines · Thomas Huth

The USB_DWC2 switch is currently "default y", so it is included in all qemu-system-* builds, even if it is not needed. Even worse, it does a "select USB", so USB devices are now showing up as available on targets that do not support USB at all. This sysbus device should only be included by the boards that need it, i.e. by the Raspi machines.

Paul already sent that patch (your description is better although):
https://www.mail-archive.com/[email protected]/msg723681.html

Quoted 33 lines
Fixes 153ef1662c ("dwc-hsotg (dwc2) USB host controller emulation")
---
 hw/arm/Kconfig | 1 +
 hw/usb/Kconfig | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)
hw/arm/Kconfig +1 -0
index 4a224a6351..bc3a423940 100644
@@ -315,6 +315,7 @@ config RASPI
     select FRAMEBUFFER
     select PL011 # UART
     select SDHCI
+    select USB_DWC2
 
 config STM32F205_SOC
     bool
hw/usb/Kconfig +0 -1
index d4d8c37c28..5e63dc75f8 100644
@@ -48,7 +48,6 @@ config USB_MUSB
 
 config USB_DWC2
     bool
-    default y
     select USB
 
 config TUSB6010
#2 lore raw
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The USB_DWC2 switch is currently "default y", so it is included in all qemu-system-* builds, even if it is not needed. Even worse, it does a "select USB", so USB devices are now showing up as available on targets that do not support USB at all. This sysbus device should only be included by the boards that need it, i.e. by the Raspi machines.

Paul already sent that patch (your description is better although):
https://www.mail-archive.com/[email protected]/msg723681.html

Oh, thanks for the pointer, I should have checked my qemu-devel folder first... Please disregard my patch!

Thomas

Reviewed-by
#3 lore raw

Gerd, it's OK by me if you take Thomas's patch instead, I agree the changelog is better. It also has a fixes tag.

Quoted 17 lines · Thomas Huth
Quoted 9 lines · Philippe Mathieu-Daudé
Quoted 5 lines · Thomas Huth

The USB_DWC2 switch is currently "default y", so it is included in all qemu-system-* builds, even if it is not needed. Even worse, it does a "select USB", so USB devices are now showing up as available on targets that do not support USB at all. This sysbus device should only be included by the boards that need it, i.e. by the Raspi machines.

Paul already sent that patch (your description is better although):
https://www.mail-archive.com/[email protected]/msg723681.html

Oh, thanks for the pointer, I should have checked my qemu-devel folder first... Please disregard my patch!

Thomas