blob: c72a8047635c33d43e3f0478763be60ae7dfac31 [file] [log] [blame]
Sam Protsenkob084b0c2016-03-25 16:39:47 +02001#
2# USB Gadget support on a system involves
3# (a) a peripheral controller, and
4# (b) the gadget driver using it.
5#
6# NOTE: Gadget support ** DOES NOT ** depend on host-side CONFIG_USB !!
7#
8# - Host systems (like PCs) need CONFIG_USB (with "A" jacks).
9# - Peripherals (like PDAs) need CONFIG_USB_GADGET (with "B" jacks).
10# - Some systems have both kinds of controllers.
11#
12# With help from a special transceiver and a "Mini-AB" jack, systems with
13# both kinds of controller can also support "USB On-the-Go" (CONFIG_USB_OTG).
14#
15
16menuconfig USB_GADGET
17 bool "USB Gadget Support"
Tom Rini5b9e6162021-07-09 10:11:56 -040018 depends on DM
19 select DM_USB
Miquel Raynal75d63472023-10-10 11:03:02 +020020 imply CMD_BIND
Sam Protsenkob084b0c2016-03-25 16:39:47 +020021 help
22 USB is a master/slave protocol, organized with one master
23 host (such as a PC) controlling up to 127 peripheral devices.
24 The USB hardware is asymmetric, which makes it easier to set up:
25 you can't connect a "to-the-host" connector to a peripheral.
26
27 U-Boot can run in the host, or in the peripheral. In both cases
28 you need a low level bus controller driver, and some software
29 talking to it. Peripheral controllers are often discrete silicon,
30 or are integrated with the CPU in a microcontroller. The more
31 familiar host side controllers have names like "EHCI", "OHCI",
32 or "UHCI", and are usually integrated into southbridges on PC
33 motherboards.
34
35 Enable this configuration option if you want to run U-Boot inside
36 a USB peripheral device. Configure one hardware driver for your
37 peripheral/device side bus controller, and a "gadget driver" for
38 your peripheral protocol.
Sam Protsenkofb115b12016-04-13 14:20:24 +030039
Marek Vasut98b91932023-05-06 16:42:39 +020040config SPL_USB_GADGET
41 bool "USB Gadget Support in SPL"
42 help
43 Enable USB Gadget API which allows to enable USB device functions
44 in SPL.
45
Sam Protsenkofb115b12016-04-13 14:20:24 +030046if USB_GADGET
47
Maxime Ripard7f78b9d2017-09-07 08:58:08 +020048config USB_GADGET_MANUFACTURER
49 string "Vendor name of the USB device"
Maxim Schwalm562b9972023-02-14 19:35:30 +020050 default "NVIDIA" if ARCH_TEGRA
Maxime Ripard6375bd82017-09-12 19:41:15 +020051 default "Allwinner Technology" if ARCH_SUNXI
Jagan Tekic1153892019-11-19 13:56:14 +053052 default "Rockchip" if ARCH_ROCKCHIP
Maxime Ripard7f78b9d2017-09-07 08:58:08 +020053 default "U-Boot"
54 help
55 Vendor name of the USB device emulated, reported to the host device.
56 This is usually either the manufacturer of the device or the SoC.
57
58config USB_GADGET_VENDOR_NUM
59 hex "Vendor ID of the USB device"
Maxim Schwalm562b9972023-02-14 19:35:30 +020060 default 0x0955 if ARCH_TEGRA
Maxime Ripard6375bd82017-09-12 19:41:15 +020061 default 0x1f3a if ARCH_SUNXI
Jagan Tekiac6fb302019-11-19 13:56:15 +053062 default 0x2207 if ARCH_ROCKCHIP
Maxime Ripard7f78b9d2017-09-07 08:58:08 +020063 default 0x0
64 help
65 Vendor ID of the USB device emulated, reported to the host device.
66 This is usually the board or SoC vendor's, unless you've registered
67 for one.
68
69config USB_GADGET_PRODUCT_NUM
70 hex "Product ID of the USB device"
Maxim Schwalm562b9972023-02-14 19:35:30 +020071 default 0x701a if ARCH_TEGRA
Maxime Ripard6375bd82017-09-12 19:41:15 +020072 default 0x1010 if ARCH_SUNXI
Jagan Teki1de44f02019-11-19 13:56:16 +053073 default 0x310a if ROCKCHIP_RK3036
Paweł Jarosz8e3898f2022-04-29 23:40:05 +020074 default 0x300a if ROCKCHIP_RK3066
Jagan Teki668c56f2019-11-19 13:56:17 +053075 default 0x310c if ROCKCHIP_RK3128
Jagan Teki1de44f02019-11-19 13:56:16 +053076 default 0x320a if ROCKCHIP_RK3229 || ROCKCHIP_RK3288
77 default 0x330a if ROCKCHIP_RK3328
Jagan Teki5c8e27b2019-11-19 13:56:21 +053078 default 0x330c if ROCKCHIP_RK3399
Maxime Ripard7f78b9d2017-09-07 08:58:08 +020079 default 0x0
80 help
81 Product ID of the USB device emulated, reported to the host device.
82
Sam Protsenkob4a0bf72016-04-13 14:20:25 +030083config USB_GADGET_ATMEL_USBA
84 bool "Atmel USBA"
85 select USB_GADGET_DUALSPEED
86 help
87 USBA is the integrated high-speed USB Device controller on
88 the AT32AP700x, some AT91SAM9 and AT91CAP9 processors from Atmel.
89
Steve Rae437689f2016-08-15 17:26:26 -070090config USB_GADGET_BCM_UDC_OTG_PHY
91 bool "Broadcom UDC OTG PHY"
92 help
93 Enable the Broadcom UDC OTG physical device interface.
94
Tom Rinia7a1e6d2022-11-19 18:45:38 -050095config USB_GADGET_AT91
96 bool "Atmel AT91 USB Gadget Controller"
97 depends on ARCH_AT91
98
Sam Protsenkob4a0bf72016-04-13 14:20:25 +030099config USB_GADGET_DWC2_OTG
100 bool "DesignWare USB2.0 HS OTG controller (gadget mode)"
101 select USB_GADGET_DUALSPEED
102 help
103 The Designware USB2.0 high-speed gadget controller
104 integrated into many SoCs. Select this option if you want the
105 driver to operate in Peripheral mode. This option requires
106 USB_GADGET to be enabled.
107
Steve Raed7198f32016-06-07 15:35:21 -0700108if USB_GADGET_DWC2_OTG
109
Tom Rinifb9d4062022-06-15 12:03:52 -0400110config USB_GADGET_DWC2_OTG_PHY
111 bool "DesignWare USB2.0 HS OTG PHY"
112 help
113 Enable the DesignWare USB2.0 HS OTG physical device interface.
114
Steve Raed7198f32016-06-07 15:35:21 -0700115config USB_GADGET_DWC2_OTG_PHY_BUS_WIDTH_8
116 bool "DesignWare USB2.0 HS OTG controller 8-bit PHY bus width"
117 help
118 Set the Designware USB2.0 high-speed OTG controller
119 PHY interface width to 8 bits, rather than the default (16 bits).
120
121endif # USB_GADGET_DWC2_OTG
122
Peng Fana3669d22021-01-25 21:43:48 +0800123config USB_GADGET_OS_DESCRIPTORS
124 bool "USB OS Feature Descriptors support"
125 help
126 This is a porting patch from linux kernel: 37a3a533429e
127 ("usb: gadget: OS Feature Descriptors support"), the original commit
128 log see below:
129 There is a custom (non-USB IF) extension to the USB standard:
130 http://msdn.microsoft.com/library/windows/hardware/gg463182
131
Sam Protsenkob4a0bf72016-04-13 14:20:25 +0300132config CI_UDC
133 bool "ChipIdea device controller"
134 select USB_GADGET_DUALSPEED
135 help
136 Say Y here to enable device controller functionality of the
137 ChipIdea driver.
138
Jassi Brar9c5cb7f2020-07-29 20:51:27 -0500139config USB_GADGET_MAX3420
140 bool "MAX3420 USB Over SPI"
141 depends on DM_SPI
142 help
143 MAX3420, from MAXIM, implements USB-over-SPI Full-Speed device controller.
144
Sam Protsenkofb115b12016-04-13 14:20:24 +0300145config USB_GADGET_VBUS_DRAW
146 int "Maximum VBUS Power usage (2-500 mA)"
147 range 2 500
148 default 2
149 help
150 Some devices need to draw power from USB when they are
151 configured, perhaps to operate circuitry or to recharge
152 batteries. This is in addition to any local power supply,
153 such as an AC adapter or batteries.
154
155 Enter the maximum power your device draws through USB, in
156 milliAmperes. The permitted range of values is 2 - 500 mA;
157 0 mA would be legal, but can make some hosts misbehave.
158
159 This value will be used except for system-specific gadget
160 drivers that have more specific information.
161
Frank Lic2bdb582020-04-29 10:35:11 +0800162config SDP_LOADADDR
163 hex "Default load address at SDP_WRITE and SDP_JUMP"
Tom Rinif18679c2023-08-02 11:09:43 -0400164 default 0x0
Frank Lic2bdb582020-04-29 10:35:11 +0800165
Sam Protsenkob4a0bf72016-04-13 14:20:25 +0300166# Selected by UDC drivers that support high-speed operation.
167config USB_GADGET_DUALSPEED
168 bool
169
Sam Protsenko4d2439d2016-04-13 14:20:26 +0300170config USB_GADGET_DOWNLOAD
171 bool "Enable USB download gadget"
172 help
173 Composite USB download gadget support (g_dnl) for download functions.
174 This code works on top of composite gadget.
175
Sam Protsenkob706ffd2016-04-13 14:20:30 +0300176if USB_GADGET_DOWNLOAD
177
Lukasz Majewskie364e4b2018-01-29 19:25:54 +0100178config USB_FUNCTION_MASS_STORAGE
179 bool "Enable USB mass storage gadget"
180 help
181 Enable mass storage protocol support in U-Boot. It allows exporting
182 the eMMC/SD card content to HOST PC so it can be mounted.
183
Eddie Caif6460922017-12-15 08:17:10 +0800184config USB_FUNCTION_ROCKUSB
185 bool "Enable USB rockusb gadget"
186 help
187 Rockusb protocol is widely used by Rockchip SoC based devices. It can
188 read/write info, image to/from devices. This enables the USB part of
189 the rockusb gadget.for more detail about Rockusb protocol, please see
190 doc/README.rockusb
191
Lukasz Majewskib886ed92018-01-29 19:21:39 +0100192config USB_FUNCTION_SDP
193 bool "Enable USB SDP (Serial Download Protocol)"
194 help
195 Enable Serial Download Protocol (SDP) device support in U-Boot. This
196 allows to download images into memory and execute (jump to) them
197 using the same protocol as implemented by the i.MX family's boot ROM.
198
Lukasz Majewski3c32b422018-01-29 19:30:18 +0100199config USB_FUNCTION_THOR
200 bool "Enable USB THOR gadget"
201 help
202 Enable Tizen's THOR download protocol support in U-Boot. It
203 allows downloading images into memory and flash them to target device.
204
Loic Poulaineb78f832021-11-25 18:16:15 +0100205config USB_FUNCTION_ACM
206 bool "Enable CDC ACM gadget"
207 select SYS_STDIO_DEREGISTER
208 select CIRCBUF
209 help
210 ACM serial link. This function can be used to create a stdio device to
211 interoperate with MS-Windows hosts or with the Linux-USB "cdc-acm"
212 driver.
213
Maxime Riparda8ad6362017-09-06 22:54:52 +0200214endif # USB_GADGET_DOWNLOAD
215
Maxime Ripard65849772017-09-06 23:23:21 +0200216config USB_ETHER
217 bool "USB Ethernet Gadget"
Alex Kiernancc92df42018-04-01 09:22:36 +0000218 depends on NET
Maxime Ripard4a553ca2017-09-22 09:51:37 +0200219 default y if ARCH_SUNXI && USB_MUSB_GADGET
Maxime Ripard65849772017-09-06 23:23:21 +0200220 help
221 Creates an Ethernet network device through a USB peripheral
222 controller. This will create a network interface on both the device
223 (U-Boot) and the host (remote device) that can be used just like any
224 other nework interface.
225 It will bind on the peripheral USB controller, ignoring the USB hosts
226 controllers in the system.
227
228if USB_ETHER
229
Maxime Ripard7285f482017-09-07 08:46:14 +0200230choice
231 prompt "USB Ethernet Gadget Model"
232 default USB_ETH_RNDIS
233 help
234 There is several models (protocols) to implement Ethernet over USB
235 devices. The main ones are Microsoft's RNDIS and USB's CDC-Ethernet
236 (also called CDC-ECM). RNDIS is obviously compatible with Windows,
237 while CDC-ECM is not. Most other operating systems support both, so
238 if inter-operability is a concern, RNDIS is to be preferred.
239
240config USB_ETH_CDC
241 bool "CDC-ECM Protocol"
242 help
243 CDC (Communications Device Class) is the standard for Ethernet over
244 USB devices. While there's several alternatives, the most widely used
245 protocol is ECM (Ethernet Control Model). However, compatibility with
246 Windows is not that great.
247
248config USB_ETH_RNDIS
249 bool "RNDIS Protocol"
250 help
251 The RNDIS (Remote Network Driver Interface Specification) is a
252 Microsoft proprietary protocol to create an Ethernet device over USB.
253 Windows obviously supports it, as well as all the major operating
254 systems, so it's the best option for compatibility.
255
256endchoice
257
Ignacio Zamora3cf84bb2022-10-08 09:50:56 -0500258config USBNET_DEV_ADDR
Mugunthan V N095b7612016-11-18 11:09:15 +0530259 string "USB Gadget Ethernet device mac address"
260 default "de:ad:be:ef:00:01"
Maxime Ripardd4ff5312017-09-12 18:32:45 +0200261 help
262 Ethernet MAC address of the device-side (ie. local board's) MAC
263 address of the usb_ether interface
Mugunthan V N095b7612016-11-18 11:09:15 +0530264
Maxime Ripard764bf282017-09-06 22:53:43 +0200265config USBNET_HOST_ADDR
266 string "USB Gadget Ethernet host mac address"
267 default "de:ad:be:ef:00:00"
268 help
269 Ethernet MAC address of the host-side (ie. remote device's) MAC
270 address of the usb_ether interface
271
Maxime Ripard65849772017-09-06 23:23:21 +0200272endif # USB_ETHER
273
Sam Protsenkofb115b12016-04-13 14:20:24 +0300274endif # USB_GADGET
Marek Vasut98b91932023-05-06 16:42:39 +0200275
276if SPL_USB_GADGET
277
278config SPL_USB_ETHER
279 bool "Support USB Ethernet drivers in SPL"
280 depends on SPL_NET
281 help
282 Enable access to the USB network subsystem and associated
283 drivers in SPL. This permits SPL to load U-Boot over a
284 USB-connected Ethernet link (such as a USB Ethernet dongle) rather
285 than from an onboard peripheral. Environment support is required
286 since the network stack uses a number of environment variables.
287 See also SPL_NET and SPL_ETH.
288
Marek Vasutc2fc02b2023-05-06 16:42:40 +0200289if SPL_USB_ETHER
290
291choice
292 prompt "USB Ethernet Gadget Model in SPL"
293 default SPL_USB_ETH_RNDIS
294 help
295 There is several models (protocols) to implement Ethernet over USB
296 devices. The main ones are Microsoft's RNDIS and USB's CDC-Ethernet
297 (also called CDC-ECM). RNDIS is obviously compatible with Windows,
298 while CDC-ECM is not. Most other operating systems support both, so
299 if inter-operability is a concern, RNDIS is to be preferred.
300
301config SPL_USB_ETH_RNDIS
302 bool "RNDIS Protocol"
303 help
304 The RNDIS (Remote Network Driver Interface Specification) is a
305 Microsoft proprietary protocol to create an Ethernet device over USB.
306 Windows obviously supports it, as well as all the major operating
307 systems, so it's the best option for compatibility.
308
309endchoice
310
311endif # SPL_USB_ETHER
312
Marek Vasut98b91932023-05-06 16:42:39 +0200313config SPL_DFU
314 bool "Support DFU (Device Firmware Upgrade) in SPL"
315 select SPL_HASH
316 select SPL_DFU_NO_RESET
317 depends on SPL_RAM_SUPPORT
318 help
319 This feature enables the DFU (Device Firmware Upgrade) in SPL with
320 RAM memory device support. The ROM code will load and execute
321 the SPL built with dfu. The user can load binaries (u-boot/kernel) to
322 selected device partition from host-pc using dfu-utils.
323 This feature is useful to flash the binaries to factory or bare-metal
324 boards using USB interface.
325
326choice
327 bool "DFU device selection in SPL"
328 depends on SPL_DFU
329
330config SPL_DFU_RAM
331 bool "RAM device"
332 depends on SPL_DFU && SPL_RAM_SUPPORT
333 help
334 select RAM/DDR memory device for loading binary images
335 (u-boot/kernel) to the selected device partition using
336 DFU and execute the u-boot/kernel from RAM.
337
338endchoice
339
340config SPL_USB_SDP_SUPPORT
341 bool "Support SDP (Serial Download Protocol) in SPL"
342 depends on SPL_SERIAL
343 help
344 Enable Serial Download Protocol (SDP) device support in SPL. This
345 allows to download images into memory and execute (jump to) them
346 using the same protocol as implemented by the i.MX family's boot ROM.
347
348config SPL_SDP_USB_DEV
349 int "SDP USB controller index in SPL"
350 default 0
351 depends on SPL_USB_SDP_SUPPORT
352 help
353 Some boards have USB controller other than 0. Define this option
354 so it can be used in compiled environment.
355
356endif # SPL_USB_GADGET