1# USB device configuration options
2
3# Copyright (c) 2016 Wind River Systems, Inc.
4# SPDX-License-Identifier: Apache-2.0
5
6menuconfig USB_DEVICE_DRIVER
7	bool "USB device controller drivers"
8	select DEPRECATED
9	help
10	  Enable USB device controller drivers.
11
12if USB_DEVICE_DRIVER
13
14config USB_DC_HAS_HS_SUPPORT
15	bool "USB device controller supports high speed"
16	help
17	  USB device controller supports high speed.
18
19config USB_DEVICE_REMOTE_WAKEUP
20	bool "Remote wakeup support"
21	help
22	  USB device controller supports remote wakeup feature.
23
24config USB_DW
25	bool "Designware USB Device Controller Driver"
26	default y
27	depends on DT_HAS_SNPS_DWC2_ENABLED
28	help
29	  Designware USB Device Controller Driver.
30
31config USB_DW_USB_2_0
32	bool "DesignWare Controller and PHY support for USB specification 2.0"
33	depends on USB_DW
34	help
35	  Indicates whether or not USB specification version 2.0 is supported
36
37config USB_DC_RPI_PICO
38	bool "USB device controller driver for Raspberry Pi Pico devices"
39	default y
40	depends on DT_HAS_RASPBERRYPI_PICO_USBD_ENABLED
41	select PINCTRL
42	help
43	  Enable USB support on the RP2 family of processors.
44
45DT_STM32_USBHS := $(dt_nodelabel_path,usbotg_hs)
46DT_STM32_USBHS_SPEED := $(dt_node_str_prop_equals,$(DT_STM32_USBHS),maximum-speed,high-speed)
47
48config USB_DC_STM32
49	bool "USB device controller driver for STM32 devices"
50	default y
51	depends on DT_HAS_ST_STM32_OTGFS_ENABLED \
52		|| DT_HAS_ST_STM32_OTGHS_ENABLED \
53		|| DT_HAS_ST_STM32_USB_ENABLED
54	select USE_STM32_LL_USB
55	select USE_STM32_HAL_PCD
56	select USE_STM32_HAL_PCD_EX
57	select USB_DC_HAS_HS_SUPPORT if "$(DT_STM32_USBHS_SPEED)"
58	select PINCTRL
59	imply USB_DEVICE_REMOTE_WAKEUP
60	help
61	  Enable STM32 family USB device controller shim driver.
62
63config USB_DC_STM32_CLOCK_CHECK
64	bool "Runtime USB 48MHz clock check"
65	depends on USB_DC_STM32
66	default y if !(SOC_SERIES_STM32F1X || SOC_SERIES_STM32F3X || SOC_SERIES_STM32U5X)
67	help
68	  Enable USB clock 48MHz configuration runtime check.
69	  In specific cases, this check might provide wrong verdict and should
70	  be disabled.
71
72config USB_DC_SAM0
73	bool "SAM0 series USB Device Controller driver"
74	default y
75	depends on DT_HAS_ATMEL_SAM0_USB_ENABLED
76	select PINCTRL
77	help
78	  SAM0 family USB device controller Driver.
79
80config USB_DC_SMARTBOND
81	bool "SmartBond series USB Device Controller driver"
82	default y
83	select CLOCK_CONTROL_SMARTBOND
84	select CLOCK_CONTROL
85	select DMA
86	depends on DT_HAS_RENESAS_SMARTBOND_USBD_ENABLED
87	help
88	  SmartBond family USB device controller Driver.
89
90config USB_DC_SAM_USBC
91	bool "SAM4L USBC Device Controller driver"
92	default y
93	depends on DT_HAS_ATMEL_SAM_USBC_ENABLED
94	select PINCTRL
95	help
96	  SAM4L family USBC device controller Driver.
97
98DT_SAM_USBHS := $(dt_nodelabel_path,usbhs)
99DT_SAM_USBHS_SPEED := $(dt_node_str_prop_equals,$(DT_SAM_USBHS),maximum-speed,high-speed)
100
101config USB_DC_SAM_USBHS
102	bool "SAM series USB HS Device Controller driver"
103	default y
104	depends on DT_HAS_ATMEL_SAM_USBHS_ENABLED
105	imply USB_DC_HAS_HS_SUPPORT if "$(DT_SAM_USBHS_SPEED)"
106	help
107	  SAM family USB HS device controller Driver.
108
109config USB_NRFX
110	bool "Nordic Semiconductor USB Device Controller Driver"
111	default y
112	depends on DT_HAS_NORDIC_NRF_USBD_ENABLED
113	select NRF_USBD_COMMON
114	select NRFX_POWER
115	imply USB_DEVICE_REMOTE_WAKEUP
116	help
117	  nRF USB Device Controller Driver
118
119config USB_NRFX_EVT_QUEUE_SIZE
120	int "USBD event queue size"
121	range 4 64
122	default 32
123	depends on USB_NRFX
124	help
125	  Size of the driver's internal event queue.
126	  Required size will depend on number of endpoints (class instances) in use.
127
128config USB_NRFX_WORK_QUEUE_STACK_SIZE
129	int "USBD work queue stack size"
130	default 1024
131	depends on USB_NRFX
132	help
133	  Size of the stack for the work queue thread that is used in the driver
134	  for handling the events from the USBD ISR, i.e. executing endpoint
135	  callbacks and providing proper notifications to the USB device stack.
136
137config USB_NRFX_ATTACHED_EVENT_DELAY
138	int "USBD attached event delay"
139	range 0 1000
140	default 0
141	depends on USB_NRFX
142	help
143	  Configurable attached event delay in milliseconds. Delay can be used
144	  to give USB Charging Controller time for initialization.
145
146config USB_KINETIS
147	bool "Kinetis USB Device Controller Driver"
148	default y
149	depends on DT_HAS_NXP_KINETIS_USBD_ENABLED
150	help
151	  Kinetis USB Device Controller Driver.
152
153config USB_MCUX
154	bool "NXP MCUX USB Device Controller Driver"
155	default y
156	depends on DT_HAS_NXP_EHCI_ENABLED || DT_HAS_NXP_LPCIP3511_ENABLED
157	select PINCTRL
158	imply USB_DEVICE_REMOTE_WAKEUP
159	help
160	  NXP MCUX USB Device Controller Driver for MXRT and LPC SoC's.
161
162if USB_MCUX
163
164config USB_DC_NXP_EHCI
165	bool "MXRT EHCI USB Device Controller"
166	default y
167	depends on DT_HAS_NXP_EHCI_ENABLED
168	select NOCACHE_MEMORY if ARCH_HAS_NOCACHE_MEMORY_SUPPORT
169	select USB_DC_HAS_HS_SUPPORT
170	help
171	  Kinetis and RT EHCI USB Device Controller Driver.
172
173config USB_DC_NXP_LPCIP3511
174	bool "LPC USB Device Controller"
175	default y
176	depends on DT_HAS_NXP_LPCIP3511_ENABLED
177	select USB_DC_HAS_HS_SUPPORT if "$(dt_nodelabel_enabled,usbhs)"
178	select PINCTRL
179	help
180	  LPC USB Device Controller Driver.
181
182config USB_DC_MSG_QUEUE_LEN
183	int
184	default 10
185	help
186	  Maximum number of messages USB device controller interrupt can queue
187	  for callback thread
188
189config USB_MCUX_THREAD_STACK_SIZE
190	int "Stack size for the USB driver"
191	default 2048 if USB_DEVICE_LOG_LEVEL_DBG
192	default 1024
193	help
194	  Size of the stack used for the internal USB thread.
195
196endif # USB_MCUX
197
198config USB_DC_IT82XX2
199	bool "ITE IT82XX2 USB Device Controller Driver"
200	default y
201	depends on DT_HAS_ITE_IT82XX2_USB_ENABLED
202	select PINCTRL
203	help
204	  ITE IT82XX2 USB Device Controller Driver
205
206config USB_DC_NUMAKER
207	bool "Nuvoton NuMaker USB 1.1 device controller"
208	default y
209	depends on DT_HAS_NUVOTON_NUMAKER_USBD_ENABLED
210	select PINCTRL
211	help
212	  Enable Nuvoton NuMaker USB 1.1 device controller driver
213
214if USB_DC_NUMAKER
215
216config USB_DC_NUMAKER_MSG_QUEUE_SIZE
217	int "USB DC message queue size"
218	default 32
219	help
220	  Maximum number of messages the driver can queue for interrupt bottom half processing
221
222config USB_DC_NUMAKER_MSG_HANDLER_THREAD_STACK_SIZE
223	int "USB DC message handler thread stack size"
224	default 1536
225	help
226	  Size of the stack for the message handler thread that is used in the driver
227	  for handling messages from the USB DC ISR, i.e. interrupt bottom half processing,
228	  including callbacks to the USB device stack.
229
230endif # USB_DC_NUMAKER
231
232config USB_NATIVE_POSIX
233	bool "Native Posix USB Device Controller Driver"
234	depends on ARCH_POSIX && EXTERNAL_LIBC
235	default y if BOARD_NATIVE_SIM
236	help
237	  Native Posix USB Device Controller Driver.
238
239DT_ZEPHYR_UDC0 := $(dt_nodelabel_path,zephyr_udc0)
240DT_ZEPHYR_UDC0_HS_SPEED := $(dt_node_str_prop_equals,$(DT_ZEPHYR_UDC0),maximum-speed,high-speed)
241
242config USB_NATIVE_POSIX_HS
243	bool "High speed support"
244	select USB_DC_HAS_HS_SUPPORT
245	depends on USB_NATIVE_POSIX
246	default y if "$(DT_ZEPHYR_UDC0_HS_SPEED)"
247	help
248	  Enable high speed support in the Native Posix USB device controller driver.
249
250module = USB_DRIVER
251module-str = usb driver
252source "subsys/logging/Kconfig.template.log_config"
253
254endif # USB_DEVICE_DRIVER
255