Skip to content

Commit ecce802

Browse files
committed
drivers: usb: uhc_dwc2: Added uhc_dwc2 driver with vendor quirks
1 parent 1aea300 commit ecce802

File tree

6 files changed

+2813
-0
lines changed

6 files changed

+2813
-0
lines changed

drivers/usb/uhc/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
# SPDX-License-Identifier: Apache-2.0
44

55
zephyr_library()
6+
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers/usb/common/)
67

78
zephyr_library_sources(uhc_common.c)
9+
zephyr_library_sources_ifdef(CONFIG_UHC_DWC2 uhc_dwc2.c)
810
zephyr_library_sources_ifdef(CONFIG_UHC_MAX3421E uhc_max3421e.c)
911
zephyr_library_sources_ifdef(CONFIG_UHC_VIRTUAL uhc_virtual.c)
1012
zephyr_library_sources_ifdef(CONFIG_UHC_NXP_EHCI uhc_mcux_common.c uhc_mcux_ehci.c)

drivers/usb/uhc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ module = UHC_DRIVER
3636
module-str = uhc drv
3737
source "subsys/logging/Kconfig.template.log_config"
3838

39+
source "drivers/usb/uhc/Kconfig.dwc2"
3940
source "drivers/usb/uhc/Kconfig.max3421e"
4041
source "drivers/usb/uhc/Kconfig.virtual"
4142
source "drivers/usb/uhc/Kconfig.mcux"

drivers/usb/uhc/Kconfig.dwc2

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Copyright (c) 2025 Espressif Systems (Shanghai) Co., Ltd.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config UHC_DWC2
5+
bool "UHC DWC2 USB device controller driver"
6+
default n
7+
depends on DT_HAS_SNPS_DWC2_ENABLED
8+
select UHC_DRIVER_HAS_HIGH_SPEED_SUPPORT
9+
select EVENTS
10+
help
11+
DWC2 USB host controller driver.
12+
13+
config UHC_DWC2_DMA
14+
bool "UHC DWC2 USB DMA support"
15+
default n
16+
depends on UHC_DWC2
17+
help
18+
Enable Buffer DMA if DWC2 USB controller supports Internal DMA.
19+
20+
config UHC_DWC2_STACK_SIZE
21+
int "UHC DWC2 driver internal thread stack size"
22+
depends on UHC_DWC2
23+
default 512
24+
help
25+
DWC2 driver internal thread stack size.
26+
27+
config UHC_DWC2_THREAD_PRIORITY
28+
int "UDC DWC2 driver thread priority"
29+
depends on UHC_DWC2
30+
default 8
31+
help
32+
DWC2 driver thread priority.
33+
34+
menu "Root Hub configuration"
35+
36+
config UHC_DWC2_PORT_DEBOUNCE_DELAY_MS
37+
int "Debounce delay in ms"
38+
default 250
39+
help
40+
On connection of a USB device, the USB 2.0 specification requires
41+
a "debounce interval with a minimum duration of 100ms" to allow the connection to stabilize
42+
(see USB 2.0 chapter 7.1.7.3 for more details).
43+
During the debounce interval, no new connection/disconnection events are registered.
44+
45+
The default value is set to 250 ms to be safe.
46+
47+
config UHC_DWC2_PORT_RESET_HOLD_MS
48+
int "Reset hold in ms"
49+
default 30
50+
help
51+
The reset signaling can be generated on any Hub or Host Controller port by request from
52+
the USB System Software. The USB 2.0 specification requires that "the reset signaling must
53+
be driven for a minimum of 10ms" (see USB 2.0 chapter 7.1.7.5 for more details).
54+
After the reset, the hub port will transition to the Enabled state (refer to Section 11.5).
55+
56+
The default value is set to 30 ms to be safe.
57+
58+
config UHC_DWC2_PORT_RESET_RECOVERY_MS
59+
int "Reset recovery delay in ms"
60+
default 30
61+
help
62+
After a port stops driving the reset signal, the USB 2.0 specification requires that
63+
the "USB System Software guarantees a minimum of 10 ms for reset recovery" before the
64+
attached device is expected to respond to data transfers (see USB 2.0 chapter 7.1.7.3 for
65+
more details).
66+
The device may ignore any data transfers during the recovery interval.
67+
68+
The default value is set to 30 ms to be safe.
69+
70+
endmenu #Root Hub configuration

0 commit comments

Comments
 (0)