Skip to content

Commit 43b77a2

Browse files
petejohansoncarlescufi
authored andcommitted
drivers: usb: Add RP2040 USB device support.
Add USB device driver for Rasberry Pico family of controllers. Signed-off-by: Peter Johanson <[email protected]>
1 parent a883e77 commit 43b77a2

File tree

7 files changed

+792
-0
lines changed

7 files changed

+792
-0
lines changed

boards/arm/rpi_pico/doc/index.rst

+3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ hardware features:
6060
* - I2C
6161
- :kconfig:option:`CONFIG_I2C`
6262
- :dtcompatible:`snps,designware-i2c`
63+
* - USB Device
64+
- :kconfig:option:`CONFIG_USB_DEVICE_STACK`
65+
- :dtcompatible:`raspberrypi,pico-usbd`
6366
* - HWINFO
6467
- :kconfig:option:`CONFIG_HWINFO`
6568
- N/A

boards/arm/rpi_pico/rpi_pico.dts

+4
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,7 @@
8484
pinctrl-0 = <&i2c1_default>;
8585
pinctrl-names = "default";
8686
};
87+
88+
zephyr_udc0: &usbd {
89+
status = "okay";
90+
};

drivers/usb/device/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ if(CONFIG_USB_DEVICE_DRIVER)
55
zephyr_library()
66

77
zephyr_library_sources_ifdef(CONFIG_USB_DW usb_dc_dw.c)
8+
zephyr_library_sources_ifdef(CONFIG_USB_DC_RPI_PICO usb_dc_rpi_pico.c)
89
zephyr_library_sources_ifdef(CONFIG_USB_DC_STM32 usb_dc_stm32.c)
910
zephyr_library_sources_ifdef(CONFIG_USB_DC_SAM0 usb_dc_sam0.c)
1011
zephyr_library_sources_ifdef(CONFIG_USB_DC_SAM_USBC usb_dc_sam_usbc.c)

drivers/usb/device/Kconfig

+9
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# Copyright (c) 2016 Wind River Systems, Inc.
44
# SPDX-License-Identifier: Apache-2.0
55

6+
DT_COMPAT_RPI_PICO_USBD := raspberrypi,pico-usbd
7+
68
menuconfig USB_DEVICE_DRIVER
79
bool "USB device controller drivers"
810
help
@@ -31,6 +33,13 @@ config USB_DW_USB_2_0
3133
help
3234
Indicates whether or not USB specification version 2.0 is supported
3335

36+
config USB_DC_RPI_PICO
37+
bool "USB device controller driver for Raspberry Pi Pico devices"
38+
default $(dt_compat_enabled,$(DT_COMPAT_RPI_PICO_USBD))
39+
depends on SOC_SERIES_RP2XXX
40+
help
41+
Enable USB support on the RP2 family of processors.
42+
3443
config USB_DC_STM32
3544
bool "USB device controller driver for STM32 devices"
3645
depends on SOC_FAMILY_STM32

0 commit comments

Comments
 (0)