Skip to content

Enable nxp usb host controllers #68232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
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
4 changes: 4 additions & 0 deletions boards/nxp/frdm_k22f/frdm_k22f.dts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ zephyr_udc0: &usbotg {
num-bidir-endpoints = <8>;
};

zephyr_uhc0: &uhc1 {
status = "okay";
};

&gpioa {
status = "okay";
};
Expand Down
24 changes: 24 additions & 0 deletions boards/nxp/mimxrt1060_evk/mimxrt1060_evk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,30 @@ zephyr_udc0: &usb1 {
status = "okay";
};

zephyr_uhc0: &uhc1 {
status = "okay";
phy_handle = <&usbphy1>;
};

zephyr_uhc1: &uhc2 {
status = "okay";
phy_handle = <&usbphy2>;
};

&usbphy1 {
status = "okay";
d-cal = <12>;
txcal45dp = <6>;
txcal45dm = <6>;
};

&usbphy2 {
status = "okay";
d-cal = <12>;
txcal45dp = <6>;
txcal45dm = <6>;
};

&flexpwm2_pwm3 {
status = "okay";
pinctrl-0 = <&pinmux_flexpwm2_3>;
Expand Down
2 changes: 2 additions & 0 deletions drivers/usb/uhc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# Copyright (c) 2022 Nordic Semiconductor
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

zephyr_library()

zephyr_library_sources(uhc_common.c)
zephyr_library_sources_ifdef(CONFIG_UHC_MAX3421E uhc_max3421e.c)
zephyr_library_sources_ifdef(CONFIG_UHC_VIRTUAL uhc_virtual.c)
zephyr_library_sources_ifdef(CONFIG_USB_UHC_NXP_MCUX uhc_mcux.c)
1 change: 1 addition & 0 deletions drivers/usb/uhc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ source "subsys/logging/Kconfig.template.log_config"

source "drivers/usb/uhc/Kconfig.max3421e"
source "drivers/usb/uhc/Kconfig.virtual"
source "drivers/usb/uhc/Kconfig.mcux"

endif # UHC_DRIVER
43 changes: 43 additions & 0 deletions drivers/usb/uhc/Kconfig.mcux
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright 2024 NXP
# SPDX-License-Identifier: Apache-2.0

config USB_UHC_NXP_EHCI
bool "NXP MCUX USB EHCI Host controller driver"
default y
depends on DT_HAS_NXP_UHC_EHCI_ENABLED
select USB_UHC_NXP_MCUX
help
NXP MCUX USB Host Controller Driver for EHCI.

config USB_UHC_NXP_KHCI
bool "NXP MCUX USB KHCI Host controller driver"
default y
depends on DT_HAS_NXP_UHC_KHCI_ENABLED
select USB_UHC_NXP_MCUX
help
NXP MCUX USB Host Controller Driver for KHCI.

config USB_UHC_NXP_MCUX
bool
# Hidden option to simplify MCUX uhc requirement
select EVENTS
select NOCACHE_MEMORY if ARCH_HAS_NOCACHE_MEMORY_SUPPORT
select NXP_FSL_OSA
select NXP_FSL_OSA_HEAP

config USB_UHC_NXP_PHY
bool "NXP MCUX USB Phy"
default y
depends on DT_HAS_NXP_USBPHY_ENABLED
help
NXP MCUX USB Phy.

if USB_UHC_NXP_MCUX

config UHC_MCUX_THREAD_STACK_SIZE
int "MCUX UHC Driver internal thread stack size"
default 2048
help
Size of the stack used in the driver.

endif #USB_UHC_NXP_MCUX
Loading