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	depends on DT_HAS_RENESAS_SMARTBOND_USBD_ENABLED
82	help
83	  SmartBond family USB device controller Driver.
84
85config USB_DC_SAM_USBC
86	bool "SAM4L USBC Device Controller driver"
87	default y
88	depends on DT_HAS_ATMEL_SAM_USBC_ENABLED
89	help
90	  SAM4L family USBC device controller Driver.
91
92DT_SAM_USBHS := $(dt_nodelabel_path,usbhs)
93DT_SAM_USBHS_SPEED := $(dt_node_str_prop_equals,$(DT_SAM_USBHS),maximum-speed,high-speed)
94
95config USB_DC_SAM_USBHS
96	bool "SAM series USB HS Device Controller driver"
97	default y
98	depends on DT_HAS_ATMEL_SAM_USBHS_ENABLED
99	imply USB_DC_HAS_HS_SUPPORT if "$(DT_SAM_USBHS_SPEED)"
100	help
101	  SAM family USB HS device controller Driver.
102
103config USB_NRFX
104	bool "Nordic Semiconductor USB Device Controller Driver"
105	default y
106	depends on DT_HAS_NORDIC_NRF_USBD_ENABLED
107	select NRFX_USBD
108	select NRFX_POWER
109	imply USB_DEVICE_REMOTE_WAKEUP
110	help
111	  nRF USB Device Controller Driver
112
113config USB_NRFX_EVT_QUEUE_SIZE
114	int "USBD event queue size"
115	range 4 64
116	default 32
117	depends on USB_NRFX
118	help
119	  Size of the driver's internal event queue.
120	  Required size will depend on number of endpoints (class instances) in use.
121
122config USB_NRFX_WORK_QUEUE_STACK_SIZE
123	int "USBD work queue stack size"
124	default 1024
125	depends on USB_NRFX
126	help
127	  Size of the stack for the work queue thread that is used in the driver
128	  for handling the events from the USBD ISR, i.e. executing endpoint
129	  callbacks and providing proper notifications to the USB device stack.
130
131config USB_NRFX_ATTACHED_EVENT_DELAY
132	int "USBD attached event delay"
133	range 0 1000
134	default 0
135	depends on USB_NRFX
136	help
137	  Configurable attached event delay in milliseconds. Delay can be used
138	  to give USB Charging Controller time for initialization.
139
140config USB_KINETIS
141	bool "Kinetis USB Device Controller Driver"
142	default y
143	depends on DT_HAS_NXP_KINETIS_USBD_ENABLED
144	help
145	  Kinetis USB Device Controller Driver.
146
147config USB_MCUX
148	bool "NXP MCUX USB Device Controller Driver"
149	default y
150	depends on DT_HAS_NXP_MCUX_USBD_ENABLED
151	help
152	  NXP MCUX USB Device Controller Driver for MXRT and LPC SoC's.
153
154if USB_MCUX
155
156choice USB_MCUX_CONTROLLER_TYPE
157	prompt "USB Controller type"
158	help
159	  Select the type of controller available in the SoC.
160
161config USB_DC_NXP_EHCI
162	bool "MXRT EHCI USB Device Controller"
163	select NOCACHE_MEMORY if HAS_MCUX_CACHE
164	select USB_DC_HAS_HS_SUPPORT
165	help
166	  Kinetis and RT EHCI USB Device Controller Driver.
167
168config USB_DC_NXP_LPCIP3511
169	bool "LPC USB Device Controller"
170	select USB_DC_HAS_HS_SUPPORT if "$(dt_nodelabel_enabled,usbhs)"
171	select PINCTRL
172	help
173	  LPC USB Device Controller Driver.
174
175endchoice
176
177config USB_DC_MSG_QUEUE_LEN
178	int
179	default 10
180	help
181	  Maximum number of messages USB device controller interrupt can queue
182	  for callback thread
183
184config USB_MCUX_THREAD_STACK_SIZE
185	int "Stack size for the USB driver"
186	default 2048 if USB_DEVICE_LOG_LEVEL_DBG
187	default 1024
188	help
189	  Size of the stack used for the internal USB thread.
190
191endif # USB_MCUX
192
193config USB_DC_IT82XX2
194	bool "ITE IT82XX2 USB Device Controller Driver"
195	default y
196	depends on DT_HAS_ITE_IT82XX2_USB_ENABLED
197	help
198	  ITE IT82XX2 USB Device Controller Driver
199
200config USB_NATIVE_POSIX
201	bool "Native Posix USB Device Controller Driver"
202	help
203	  Native Posix USB Device Controller Driver.
204
205module = USB_DRIVER
206module-str = usb driver
207source "subsys/logging/Kconfig.template.log_config"
208
209endif # USB_DEVICE_DRIVER
210