1# Copyright (c) 2023 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4config UDC_DWC2
5	bool "DWC2 USB device controller driver"
6	default y
7	depends on DT_HAS_SNPS_DWC2_ENABLED
8	select UDC_DRIVER_HAS_HIGH_SPEED_SUPPORT
9	select NRFS if NRFS_HAS_VBUS_DETECTOR_SERVICE
10	select NRFS_VBUS_DETECTOR_SERVICE_ENABLED if NRFS_HAS_VBUS_DETECTOR_SERVICE
11	select EVENTS
12	help
13	  DWC2 USB device controller driver.
14
15config UDC_DWC2_DMA
16	bool "DWC2 USB DMA support"
17	default y
18	depends on UDC_DWC2
19	help
20	  Enable Buffer DMA if DWC2 USB controller supports Internal DMA.
21
22config UDC_DWC2_HIBERNATION
23	bool "DWC2 USB Hibernation support"
24	default y
25	depends on UDC_DWC2
26	help
27	  Enable Hibernation if DWC2 USB controller supports hibernation.
28
29config UDC_DWC2_PTI
30	bool "DWC2 USB Periodic Transfer Interrupt"
31	depends on UDC_DWC2
32	help
33	  Ignore frame number when scheduling isochronous endpoints. Use this
34	  when isochronous transfers should finish only after receiving token
35	  (IN or OUT) from host. In Periodic Transfer Interrupt, DWC2 driver is
36	  not automatically retiring transfers if host does not issue token
37	  during microframe. Enable to reduce isochronous endpoint CPU overhead.
38
39config UDC_DWC2_STACK_SIZE
40	int "UDC DWC2 driver internal thread stack size"
41	depends on UDC_DWC2
42	default 512
43	help
44	  DWC2 driver internal thread stack size.
45
46config UDC_DWC2_THREAD_PRIORITY
47	int "UDC DWC2 driver thread priority"
48	depends on UDC_DWC2
49	default 8
50	help
51	  DWC2 driver thread priority.
52
53config UDC_DWC2_USBHS_VBUS_READY_TIMEOUT
54	int "UDC DWC2 USBHS VBUS ready event timeout in ms"
55	depends on UDC_DWC2
56	depends on NRFS_HAS_VBUS_DETECTOR_SERVICE
57	default 0
58	help
59	  UDC DWC2 USBHS VBUS ready event timeout. If the VBUS is not ready
60	  and the Nordic USBHS controller is used, the udc_enable() is
61	  blocked for this amount of time. Set it to zero to wait forever.
62