Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions boards/atmel/sam/sam4e_xpro/sam4e_xpro-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,11 @@
<PA27C_HSMCI_MCDA3>;
};
};

udp_default: udp_default {
group1 {
pinmux = <PB10S_UDP_DDM>,
<PB11S_UDP_DDP>;
};
};
};
7 changes: 7 additions & 0 deletions boards/atmel/sam/sam4e_xpro/sam4e_xpro.dts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@
status = "okay";
};

zephyr_udc0: &udp {
status = "okay";

pinctrl-0 = <&udp_default>;
pinctrl-names = "default";
};

ext1_spi: &spi0 {};

ext1_i2c: &twi0 {};
Expand Down
1 change: 1 addition & 0 deletions boards/atmel/sam/sam4e_xpro/sam4e_xpro.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ supported:
- sdhc
- spi
- uart
- usbd
- watchdog
- xpro_gpio
- xpro_i2c
Expand Down
7 changes: 7 additions & 0 deletions boards/atmel/sam/sam4s_xplained/sam4s_xplained-pinctrl.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,11 @@
<PC8A_EBI_NWE>;
};
};

udp_default: udp_default {
group1 {
pinmux = <PB10S_UDP_DDM>,
<PB11S_UDP_DDP>;
};
};
};
7 changes: 7 additions & 0 deletions boards/atmel/sam/sam4s_xplained/sam4s_xplained.dts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,13 @@ xplained4_spi: &spi0 {};

xplained4_serial: &uart1 {};

zephyr_udc0: &udp {
status = "okay";

pinctrl-0 = <&udp_default>;
pinctrl-names = "default";
};

&smc {
status = "okay";
pinctrl-0 = <&smc_default>;
Expand Down
1 change: 1 addition & 0 deletions boards/atmel/sam/sam4s_xplained/sam4s_xplained.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ supported:
- memc
- pwm
- spi
- usbd
- watchdog
- xplained_gpio
- xplained_i2c
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/udc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ zephyr_library_sources_ifdef(CONFIG_UDC_AMBIQ udc_ambiq.c)
zephyr_library_sources_ifdef(CONFIG_UDC_RENESAS_RA udc_renesas_ra.c)
zephyr_library_sources_ifdef(CONFIG_UDC_MAX32 udc_max32.c)
zephyr_library_sources_ifdef(CONFIG_UDC_SAM0 udc_sam0.c)
zephyr_library_sources_ifdef(CONFIG_UDC_SAM_UDP udc_sam_udp.c)
zephyr_library_sources_ifdef(CONFIG_UDC_SAM_USBC udc_sam_usbc.c)
zephyr_library_sources_ifdef(CONFIG_UDC_SAM_USBHS udc_sam_usbhs.c)
1 change: 1 addition & 0 deletions drivers/usb/udc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ source "drivers/usb/udc/Kconfig.ambiq"
source "drivers/usb/udc/Kconfig.renesas_ra"
source "drivers/usb/udc/Kconfig.max32"
source "drivers/usb/udc/Kconfig.sam0"
source "drivers/usb/udc/Kconfig.sam_udp"
source "drivers/usb/udc/Kconfig.sam_usbc"
source "drivers/usb/udc/Kconfig.sam_usbhs"

Expand Down
33 changes: 33 additions & 0 deletions drivers/usb/udc/Kconfig.sam_udp
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright (c) 2026 Gerson Fernando Budke <nandojve@gmail.com>
# SPDX-License-Identifier: Apache-2.0

config UDC_SAM_UDP
bool "Atmel SAM USB Device Port (UDP) Controller"
default y
depends on DT_HAS_ATMEL_SAM_UDP_ENABLED
depends on SOC_FAMILY_ATMEL_SAM
select PINCTRL
select EVENTS
help
Enable Atmel SAM USB Device Port (UDP) controller driver.
This controller supports full-speed USB 2.0 device mode with
8 endpoints.

if UDC_SAM_UDP

config UDC_SAM_UDP_THREAD_STACK_SIZE
int "USB device controller driver thread stack size"
default 2048
help
Stack size of the USB device controller driver thread.
The thread processes USB events including OUT data reception.
A larger stack is needed to handle the callback chain from
udc_submit_ep_event() which may invoke USB class drivers.

config UDC_SAM_UDP_THREAD_PRIORITY
int "USB device controller driver thread priority"
default 8
help
Priority of the USB device controller driver thread.

endif # UDC_SAM_UDP
Loading
Loading