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