Skip to content

drivers: usb: common: Added host register set for DWC2 controller [part1]#101886

Merged
MaureenHelm merged 1 commit intozephyrproject-rtos:mainfrom
roma-jam-lab:pr-add-dwc2-host-reg-set
Feb 16, 2026
Merged

drivers: usb: common: Added host register set for DWC2 controller [part1]#101886
MaureenHelm merged 1 commit intozephyrproject-rtos:mainfrom
roma-jam-lab:pr-add-dwc2-host-reg-set

Conversation

@roma-jam
Copy link
Copy Markdown
Contributor

@roma-jam roma-jam commented Jan 7, 2026

Description

Added host register description for DWC2 controller. Prerequisites for UHC DWC2 driver.

Changes

Updated

drivers/usb/common/usb_dwc2_hw.h : Added Host related def & structs

Related

@roma-jam roma-jam marked this pull request as ready for review January 7, 2026 20:16
@zephyrbot zephyrbot added the area: USB Universal Serial Bus label Jan 7, 2026
josuah
josuah previously approved these changes Jan 8, 2026
Copy link
Copy Markdown
Contributor

@josuah josuah left a comment

Choose a reason for hiding this comment

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

Identical to the original PR except for a typo fix...

--- a/drivers/usb/common/usb_dwc2_hw.h
+++ b/drivers/usb/common/usb_dwc2_hw.h
@@ -92,7 +92,7 @@ struct usb_dwc2_reg {
                volatile uint32_t dieptxf[15];
        };
        volatile uint32_t reserved2[176];
-       /* Host mode register 0x0400 .. 0x07FF */
+       /* Host mode registers 0x0400 .. 0x07FF */
        volatile uint32_t hcfg;
        volatile uint32_t hfir;
        volatile uint32_t hfnum;
@@ -106,7 +106,7 @@ struct usb_dwc2_reg {
        volatile uint32_t reserved_0x0444_0x04fc[47];
        struct usb_dwc2_host_chan host_chan_regs[16];
        volatile uint32_t reserved_0x0704_0x07fc[64];
-       /* Device mode register 0x0800 .. 0x0D00 */
+       /* Device mode registers 0x0800 .. 0x0D00 */
        volatile uint32_t dcfg;
        volatile uint32_t dctl;
        volatile uint32_t dsts;

So these registers were verified to work.

Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
@roma-jam roma-jam force-pushed the pr-add-dwc2-host-reg-set branch 6 times, most recently from 8f817a4 to d523701 Compare January 9, 2026 22:23
@roma-jam
Copy link
Copy Markdown
Contributor Author

roma-jam commented Jan 9, 2026

@tmon-nordic,

thanks for the review! All the notes are addressed.

PTAL.

@roma-jam roma-jam requested review from josuah and tmon-nordic January 9, 2026 22:30
@roma-jam roma-jam force-pushed the pr-add-dwc2-host-reg-set branch from d523701 to db5ae4e Compare January 9, 2026 22:46
@josuah
Copy link
Copy Markdown
Contributor

josuah commented Jan 10, 2026

To summarize the CI error, you might need to unify the Author of git configuration and the "Signed-off-by:" line in the commit to be the same.
Either @espressif.com or @yahoo.com.

Thank you for the submission and the modifications!

@roma-jam roma-jam marked this pull request as draft January 10, 2026 08:51
@roma-jam
Copy link
Copy Markdown
Contributor Author

Hi @josuah

thanks for additional clarification.

I’ll try to set up as much checks as possible localy and fix the CI, meanwhile I move the PR to draft and poke you once again when it will be ready.

@roma-jam roma-jam force-pushed the pr-add-dwc2-host-reg-set branch 3 times, most recently from 0317a4a to 13a2fca Compare January 10, 2026 19:55
@roma-jam roma-jam marked this pull request as ready for review January 12, 2026 12:22
@roma-jam
Copy link
Copy Markdown
Contributor Author

Hi @josuah,

thanks for the waiting, PTAL when possible. ⚡

Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
@roma-jam roma-jam force-pushed the pr-add-dwc2-host-reg-set branch from 13a2fca to 788af2c Compare January 14, 2026 09:06
@josuah josuah requested a review from tmon-nordic January 27, 2026 14:36
josuah
josuah previously approved these changes Jan 27, 2026
@josuah josuah linked an issue Jan 27, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@tmon-nordic tmon-nordic left a comment

Choose a reason for hiding this comment

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

I hope I got all the suggestions right. I will recheck against the specification once you update the PR. Getting the register definitions is very tiring, but absolutely critical - any problems here can lead to so many wasted hours during troubleshooting.

Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h
Comment thread drivers/usb/common/usb_dwc2_hw.h
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
Comment thread drivers/usb/common/usb_dwc2_hw.h
Comment thread drivers/usb/common/usb_dwc2_hw.h
Comment thread drivers/usb/common/usb_dwc2_hw.h Outdated
@roma-jam roma-jam marked this pull request as draft January 29, 2026 09:01
@roma-jam roma-jam changed the title drivers: usb: common: Added host register set for DWC2 controller [part1] [WIP] drivers: usb: common: Added host register set for DWC2 controller [part1] Jan 29, 2026
@roma-jam
Copy link
Copy Markdown
Contributor Author

Hi @tmon-nordic,

thanks a lot, I‘ll take the commit suggestions and update the rest.

I moved this to the draft and notify you when it will be ready.

@roma-jam roma-jam force-pushed the pr-add-dwc2-host-reg-set branch from 8a60ac0 to 119a661 Compare January 29, 2026 10:52
@roma-jam roma-jam marked this pull request as ready for review January 29, 2026 11:14
@roma-jam roma-jam changed the title [WIP] drivers: usb: common: Added host register set for DWC2 controller [part1] drivers: usb: common: Added host register set for DWC2 controller [part1] Jan 29, 2026
@sonarqubecloud
Copy link
Copy Markdown

@roma-jam
Copy link
Copy Markdown
Contributor Author

Hi @tmon-nordic,

I will recheck against the specification once you update the PR

Done, PTAL.

PS. I kept one thread as "not resolved" as I have concerns regarding the name, otherwise all done.

@roma-jam
Copy link
Copy Markdown
Contributor Author

roma-jam commented Feb 4, 2026

Hi @tmon-nordic,

will be there anything else from your side?

tmon-nordic
tmon-nordic previously approved these changes Feb 5, 2026
Copy link
Copy Markdown
Contributor

@tmon-nordic tmon-nordic left a comment

Choose a reason for hiding this comment

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

I just went through the changes against Databook and found no issues. There were few missing bits related to ULPI (autosuspend) and Descriptor DMA (error interrupt bit), but let's get over this for now.

Added register bitmask description with low-level abstraction

Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
Co-authored-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
@jfischer-no
Copy link
Copy Markdown
Contributor

@roma-jam I just fixed the indentation. Please follow the style in the file/subsystem next time.

@josuah josuah requested a review from tmon-nordic February 10, 2026 22:57
@roma-jam
Copy link
Copy Markdown
Contributor Author

Hi
@jfischer-no
@josuah

thanks for the review and for all suggestions.

The next one is also ready from my side, PTAL: #102963

There you may find adding common files and basic skeletal for the uhc_dwc2 driver and steps how to build the shell example for esp32.

I have split the changes from the original PR into several chunks to make them small, decrease the efforts of review and increase the pace of merging those changes, which we are already agreed on. (Sorry if I repeating myself, I feel I am saying that for the thousand times, but let it be the last one).

During the upcoming changes if there arise any other tasks/ideas from your side, like merging some logic from udc and uhc for dwc2 (something like to create dwc2_common or similar), please let me know, I will be happy to consider the task and help to implement it.

PS. I already found out, that it is possible to do that (dwc2_common.c for udc and uhc) and it makes sense as I need to reuse some features like core reset etc., but I decided to proceed with just "adding" the new code first and only then to propose any "changes" in the already implemented code.

@josuah
Copy link
Copy Markdown
Contributor

josuah commented Feb 16, 2026

dwc2_common.c for udc and uhc

I second you for keeping it as future improvement, which will make merging DWC2 UHC support quicker and save time for further integration later.

@MaureenHelm MaureenHelm merged commit c32c2d9 into zephyrproject-rtos:main Feb 16, 2026
25 checks passed
@github-actions
Copy link
Copy Markdown

Hi @roma-jam!
Congratulations on getting your very first Zephyr pull request merged 🎉🥳. This is a fantastic achievement, and we're thrilled to have you as part of our community!

To celebrate this milestone and showcase your contribution, we'd love to award you the Zephyr Technical Contributor badge. If you're interested, please claim your badge by filling out this form: Claim Your Zephyr Badge.

Thank you for your valuable input, and we look forward to seeing more of your contributions in the future! 🪁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: USB Universal Serial Bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DWC2 USB Host controller (UHC)

6 participants