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