drivers: usb: uhc_dwc2: add initial support#102967
drivers: usb: uhc_dwc2: add initial support#102967roma-jam wants to merge 1 commit intozephyrproject-rtos:mainfrom
Conversation
01ebd5f to
f63106f
Compare
f63106f to
cbcf576
Compare
abe9038 to
3d06d02
Compare
1df627f to
aae36b7
Compare
fcef282 to
17805b7
Compare
josuah
left a comment
There was a problem hiding this comment.
Some review pass to detail a bit more the ability to remove local definitions already provided in drivers/usb/common/usb_dwc2_hw.h.
8727bd1 to
32a4575
Compare
32a4575 to
fbaa637
Compare
4321f55 to
5c9e0be
Compare
|
I think I do not have any other modification to propose than those already opened. It works with nRF54LM20 on this branch, and I anticipate it would also work on other platforms. The driver is clearly a lot more robust than anything I could be coming-up with myself, and fixed many bugs due to my lack of deep understanding of DWC2 beyond the manual. Thank you once again for bearing in, and for all of your help and expertise on this driver! I will pursue with ISO support on top of it and stay reactive, i.e. rebase the nRF54LM20 branch frequently to keep testing things still work as you go. |
Note: Control transfers only Add initial usb host driver for Synopsys DWC2 with vendor quirks. Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
|
|
|
||
| err = 0; | ||
| } else { | ||
| LOG_ERR("Thread channel%d unhanlded evetns: %08Xh", channel->index, events); |
There was a problem hiding this comment.
| LOG_ERR("Thread channel%d unhanlded evetns: %08Xh", channel->index, events); | |
| LOG_ERR("Thread channel%d unhandled events: %08Xh", channel->index, events); |
|
Hi everyone, this PR is ready for the review and the incoming code might be tested with esp32s3 or nrf54lm20 (full-speed only for now). For more details, please refer to the PR description. |
| uint32_t ghwcfg2 = sys_read32((mem_addr_t)&dwc2->ghwcfg2); | ||
|
|
||
| if (usb_dwc2_get_ghwcfg2_hsphytype(ghwcfg2) == 0) { | ||
| dwc2_hal_config_hcfg_fsls(dwc2); |
There was a problem hiding this comment.
This is a PHY clock selection, so it won't change after configuration.
Might be moved to/inside the dwc2_hal_init_host()



Description
This is initial support of Synopsys DWC2 controller as a USB Host (esp32 vendor quirks included, so it might be tested on esp32s3).
These changes allow to init dwc2 as a host and enumerate attached USB device and utilize the Control Endpoint to get device information (for example, via shell example command:
usbh device info) for different devices.nRF54LM20 support
With vendor quirks #95723 it works with Full-speed devices as well, so the code might be tested on the
nRF54LM20-DKboard.Limitations
LOG_ERR()output followed byLOG_WRN()which reveals where handling is absent.uhc_dwc2_enqueuewill be added as a follow-up.TODO:in the code, where it should be done)And some other small limitations, that marked as TODOs in the code and can be solved in the future as a follow-up (with test coverage or without. "With" is better IMHO).
Testing with
usbh shellon ESP32S3/samples/subsys/usb/shellfolder, runand get:
then run:
and the the common usbh shell commands are available:
Related