Skip to contentSkip to conversation

USB OTG: make dwc2 otg driver dependent on Exynos platform

PATCH In review Marius Dinu 5 participants 6 messages Aug 4, 2025 – Aug 11, 2025 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB OTG: make dwc2 otg driver dependent on Exynos platform

drivers/usb/gadget/dwc2_udc_otg_phy.c uses s5p_cpu_id, which is only defined for Exynos CPUs.

---
 drivers/usb/gadget/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/Kconfig +2 -1
index 46a83141481..deabcb3e51f 100644
@@ -108,10 +108,11 @@ config USB_GADGET_AT91
 
 config USB_GADGET_DWC2_OTG
 	bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
+	depends on ARCH_EXYNOS5
 	select USB_GADGET_DUALSPEED
 	help
 	  The Designware USB2.0 high-speed gadget controller
-	  integrated into many SoCs. Select this option if you want the
+	  integrated into many Exynos SoCs. Select this option if you want the
 	  driver to operate in Peripheral mode. This option requires
 	  USB_GADGET to be enabled.
 
Signature · 1 line
2.49.0
#1 lore raw

Hi Marius,

Quoted 13 lines · Marius Dinu

drivers/usb/gadget/dwc2_udc_otg_phy.c uses s5p_cpu_id, which is only defined for Exynos CPUs.

---
 drivers/usb/gadget/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/Kconfig +0 -0
index 46a83141481..deabcb3e51f 100644

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 111

Quoted 4 lines
drivers/usb/gadget/Kconfig +1 -0
@@ -108,10 +108,11 @@ config USB_GADGET_AT91
 
 config USB_GADGET_DWC2_OTG
 	bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
+	depends on ARCH_EXYNOS5

There are other platforms using this driver not just exynos.

You should probably change

if (s5p_cpu_id == 0x4412)

into something like

  if (IS_ENABLED(CONFIG_ARCH_EXYNOS5) && s5p_cpu_id == 0x4412)

instead of breaking use of this driver for other platforms.

Regards,
Jonas

Quoted 8 lines
drivers/usb/gadget/Kconfig +1 -1
 	select USB_GADGET_DUALSPEED
 	help
 	  The Designware USB2.0 high-speed gadget controller
-	  integrated into many SoCs. Select this option if you want the
+	  integrated into many Exynos SoCs. Select this option if you want the
 	  driver to operate in Peripheral mode. This option requires
 	  USB_GADGET to be enabled.
 
#2 lore raw
Quoted 36 lines · Jonas Karlman

Hi Marius,

Quoted 13 lines · Marius Dinu

drivers/usb/gadget/dwc2_udc_otg_phy.c uses s5p_cpu_id, which is only defined for Exynos CPUs.

---
 drivers/usb/gadget/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/Kconfig +0 -0
index 46a83141481..deabcb3e51f 100644

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 111

Quoted 4 lines
drivers/usb/gadget/Kconfig +1 -0
@@ -108,10 +108,11 @@ config USB_GADGET_AT91
 
 config USB_GADGET_DWC2_OTG
 	bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
+	depends on ARCH_EXYNOS5

There are other platforms using this driver not just exynos.

You should probably change

if (s5p_cpu_id == 0x4412)

into something like

  if (IS_ENABLED(CONFIG_ARCH_EXYNOS5) && s5p_cpu_id == 0x4412)

instead of breaking use of this driver for other platforms.

Regards,
Jonas

Quoted 9 lines

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 118

Quoted 8 lines
drivers/usb/gadget/Kconfig +1 -1
 	select USB_GADGET_DUALSPEED
 	help
 	  The Designware USB2.0 high-speed gadget controller
-	  integrated into many SoCs. Select this option if you want the
+	  integrated into many Exynos SoCs. Select this option if you want the
 	  driver to operate in Peripheral mode. This option requires
 	  USB_GADGET to be enabled.
 

I'm sorry. I'm unable to fix this driver. My C skills are not that good. I didn't even know this was a bug.

BTW, what's the difference between IS_ENABLED(CONFIG_something) and CONFIG_IS_ENABLED(something) ? I saw both variants.

#3 lore raw
Quoted 47 lines · Marius Dinu
Quoted 36 lines · Jonas Karlman

Hi Marius,

Quoted 13 lines · Marius Dinu

drivers/usb/gadget/dwc2_udc_otg_phy.c uses s5p_cpu_id, which is only defined for Exynos CPUs.

---
  drivers/usb/gadget/Kconfig | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/Kconfig +0 -0
index 46a83141481..deabcb3e51f 100644

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 111

Quoted 4 lines
drivers/usb/gadget/Kconfig +1 -0
@@ -108,10 +108,11 @@ config USB_GADGET_AT91
 
  config USB_GADGET_DWC2_OTG
  	bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
+	depends on ARCH_EXYNOS5

There are other platforms using this driver not just exynos.

You should probably change

   if (s5p_cpu_id == 0x4412)

into something like

   if (IS_ENABLED(CONFIG_ARCH_EXYNOS5) && s5p_cpu_id == 0x4412)

instead of breaking use of this driver for other platforms.

Regards,
Jonas

Quoted 9 lines

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 118

Quoted 8 lines
drivers/usb/gadget/Kconfig +1 -1
  	select USB_GADGET_DUALSPEED
  	help
  	  The Designware USB2.0 high-speed gadget controller
-	  integrated into many SoCs. Select this option if you want the
+	  integrated into many Exynos SoCs. Select this option if you want the
  	  driver to operate in Peripheral mode. This option requires
  	  USB_GADGET to be enabled.
 
Quoted 6 lines

I'm sorry. I'm unable to fix this driver. My C skills are not that good. I didn't even know this was a bug.

BTW, what's the difference between IS_ENABLED(CONFIG_something) and CONFIG_IS_ENABLED(something) ? I saw both variants.

https://docs.u-boot.org/en/latest/develop/codingstyle.html#conditional-compilation

#4 lore raw
In reply to Jonas Karlman
Quoted 36 lines · Jonas Karlman

Hi Marius,

Quoted 13 lines · Marius Dinu

drivers/usb/gadget/dwc2_udc_otg_phy.c uses s5p_cpu_id, which is only defined for Exynos CPUs.

---
 drivers/usb/gadget/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/Kconfig +0 -0
index 46a83141481..deabcb3e51f 100644

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 111

Quoted 4 lines
drivers/usb/gadget/Kconfig +1 -0
@@ -108,10 +108,11 @@ config USB_GADGET_AT91
 
 config USB_GADGET_DWC2_OTG
 	bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
+	depends on ARCH_EXYNOS5

There are other platforms using this driver not just exynos.

You should probably change

if (s5p_cpu_id == 0x4412)

into something like

  if (IS_ENABLED(CONFIG_ARCH_EXYNOS5) && s5p_cpu_id == 0x4412)

instead of breaking use of this driver for other platforms.

Regards,
Jonas

Quoted 9 lines

drivers/usb/gadget/Kconfig config USB_GADGET_AT91 · line 118

Quoted 8 lines
drivers/usb/gadget/Kconfig +1 -1
 	select USB_GADGET_DUALSPEED
 	help
 	  The Designware USB2.0 high-speed gadget controller
-	  integrated into many SoCs. Select this option if you want the
+	  integrated into many Exynos SoCs. Select this option if you want the
 	  driver to operate in Peripheral mode. This option requires
 	  USB_GADGET to be enabled.
 

I'm sorry. I'm unable to fix this driver. My C skills are not that good. I didn't even know this was a bug.

Marius

#5 lore raw
In reply to Marius Dinu
Quoted 28 lines · Marius Dinu

drivers/usb/gadget/dwc2_udc_otg_phy.c uses s5p_cpu_id, which is only defined for Exynos CPUs.

---
 drivers/usb/gadget/Kconfig | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/gadget/Kconfig +2 -1
index 46a83141481..deabcb3e51f 100644
@@ -108,10 +108,11 @@ config USB_GADGET_AT91
 
 config USB_GADGET_DWC2_OTG
 	bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
+	depends on ARCH_EXYNOS5
 	select USB_GADGET_DUALSPEED
 	help
 	  The Designware USB2.0 high-speed gadget controller
-	  integrated into many SoCs. Select this option if you want the
+	  integrated into many Exynos SoCs. Select this option if you want the
 	  driver to operate in Peripheral mode. This option requires
 	  USB_GADGET to be enabled.
 
Signature · 1 line
2.49.0

PS:
This might be a bug; I can't tell.
Even so, it should be merged to avoid build errors until someone can take a better look at the driver.