Skip to content

drivers: uhc: implement UHC shim driver for NXP KHCI and EHCI controller #77973

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MarkWangChinese
Copy link
Collaborator

Enablet the NXP MCUX UHC drivers.
Add uhc support for frdm_k22f, rt1060, lpc55s69 and lpc55s28. frdm_k22f supports the KHCI controller, rt1060 supports the EHCI controller, lpc55s69 and lpc55s28 support the OHCI and IP3516HS controller.

@zephyrbot zephyrbot added area: ARM ARM (32-bit) Architecture area: Architectures area: USB Universal Serial Bus platform: NXP NXP platform: NXP Drivers NXP Semiconductors, drivers labels Sep 4, 2024
@zephyrbot
Copy link
Collaborator

zephyrbot commented Sep 4, 2024

The following west manifest projects have changed revision in this Pull Request:

Name Old Revision New Revision Diff
hal_nxp zephyrproject-rtos/hal_nxp@6b11d19 zephyrproject-rtos/hal_nxp#496 zephyrproject-rtos/hal_nxp#496/files

DNM label due to: 1 project with PR revision

Note: This message is automatically posted and updated by the Manifest GitHub Action.

@PetervdPerk-NXP
Copy link
Collaborator

Any plans to enable 1170 and 1180 as well?
Since they share almost the same EHCI controller.

@MarkWangChinese
Copy link
Collaborator Author

Any plans to enable 1170 and 1180 as well? Since they share almost the same EHCI controller.

After this basic NXP UHC controller driver merges, I think next step is implementing the host stack. Because the host stack is not ready, so supporting more platforms does not make much sense.

@kartben kartben modified the milestones: v4.1.0, v4.2.0 Feb 15, 2025
@MarkWangChinese MarkWangChinese force-pushed the feature/enable_mcux_uhc branch 2 times, most recently from f5b85c1 to e029aff Compare February 19, 2025 03:39
@MarkWangChinese
Copy link
Collaborator Author

Hi @jfischer-no In the NXP host controller driver, there is one task function that process the interrupt of the controller and the transfers by using the Event, mcux uhc uses the task function to create task. mcux uhc codes don't use the Event directly. If you think the NXP host controller driver can't use EVENT because it is HAL driver, could we treat NXP host controller driver as non-hal driver?

jfischer-no
jfischer-no previously approved these changes Apr 8, 2025
default y
depends on DT_HAS_NXP_UHC_EHCI_ENABLED
select EVENTS
select NOCACHE_MEMORY if ARCH_HAS_NOCACHE_MEMORY_SUPPORT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

select NOCACHE_MEMORY if CPU_HAS_DCACHE? I see it is different in drivers/usb/udc/Kconfig.mcux

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@jfischer-no
Copy link
Collaborator

@MarkWangChinese Do you want to wait for #86920 or get this PR in and remove the bounce buffers afterwards?

tmon-nordic
tmon-nordic previously approved these changes Apr 9, 2025
@MarkWangChinese MarkWangChinese dismissed stale reviews from tmon-nordic and jfischer-no via 1438a47 April 10, 2025 12:47
@MarkWangChinese MarkWangChinese force-pushed the feature/enable_mcux_uhc branch 2 times, most recently from 1438a47 to cea054b Compare April 10, 2025 12:53
@MarkWangChinese
Copy link
Collaborator Author

MarkWangChinese commented Apr 10, 2025

Thanks @jfischer-no @tmon-nordic I rebase the pr and add one new commit that resolve the isr conflict between KHCI/EHCI host and device driver because the same IP support both host and device function. If both the device and host driver is enabled for the same IP instance, need to use the DYNAMIC_INTERRUPTS. Please help to review.

@MarkWangChinese MarkWangChinese force-pushed the feature/enable_mcux_uhc branch from cea054b to 797f1ef Compare April 18, 2025 07:31
tmon-nordic
tmon-nordic previously approved these changes Apr 23, 2025
@jfischer-no
Copy link
Collaborator

@MarkWangChinese Please fix style issues reported by compliance checks.

It is based on SDK USB Host controller driver.
Support NXP EHCI, KHCI, OHCI and IP3516HS controllers.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
…5s28

add uhc related items to dts.
add clock initialization
add BM4 if CONFIG_USB_UHC_NXP_KHCI is enabled
add pin mux
update board related CMakeLists.txt
update sdk-ng CMake to include NXP controller drivers
update west.yml to contain the hal_nxp pr

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
add uhc related items to dts.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
Because the same IP supports both device and host, so use
DYNAMIC_INTERRUPTS for KHCI and EHCI if both device and host
are enabled.

Signed-off-by: Mark Wang <yichang.wang@nxp.com>
@MarkWangChinese MarkWangChinese force-pushed the feature/enable_mcux_uhc branch from d8d68ab to debd1a2 Compare April 25, 2025 07:28
@MarkWangChinese
Copy link
Collaborator Author

@MarkWangChinese Please fix style issues reported by compliance checks.

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Architectures area: ARM ARM (32-bit) Architecture area: USB Universal Serial Bus DNM (manifest) This PR should not be merged (controlled by action-manifest) manifest manifest-hal_nxp platform: NXP Drivers NXP Semiconductors, drivers platform: NXP NXP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants