Skip to content
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

Generalize Synopsys DCD/HCD #382

Closed
hathach opened this issue Apr 27, 2020 · 12 comments · Fixed by #1163
Closed

Generalize Synopsys DCD/HCD #382

hathach opened this issue Apr 27, 2020 · 12 comments · Fixed by #1163

Comments

@hathach
Copy link
Owner

hathach commented Apr 27, 2020

Is your feature request related to a problem? Please describe.
95% of stm32 synopsys and esp32s2 are the same. The differences are mostly register name and address base. Merging them reduce maintaining effort for driver. It is also a good chance to generalize the synopsys driver making adding MCU from other vendor using the same IP easier.

Describe the solution you'd like
merge and rename common driver as synopsys/dcd_synopsys

Ref: linux driver for dwc https://github.com/torvalds/linux/tree/master/drivers/usb/dwc2

MCUs that use synopsys IP

  • ST STM32 (F4, F7, H7 etc ..) OTG
  • Espressif ESP32 S2/S3
  • Giga GDVF103
  • Silabs EFM32
@hathach
Copy link
Owner Author

hathach commented Jan 22, 2021

closed seem it doesn't seem to be feasible at the moment

@hathach hathach closed this as completed Jan 22, 2021
@cr1901
Copy link
Collaborator

cr1901 commented Feb 21, 2021

Yea, I'm a month late.

I agree this is the best approach for now, but I'd love to eventually see if a "generic" driver is possible. Or at least whether there are "common" parts that are unlikely to change that can be factored out (or parts that change the same way for all chips using Synopsys IP as tinyusb evolves) .

@hathach
Copy link
Owner Author

hathach commented Feb 22, 2021

@cr1901 yeah, you are right, maybe we could extract the hanlding/processing function such as transfer into common function shared by these dcd rather than merging them all together. I will re-open this and will look at this later on.

@hathach hathach reopened this Feb 22, 2021
@cr1901
Copy link
Collaborator

cr1901 commented Feb 22, 2021

@hathach Appreciated, especially since I was a month late to actually say anything :D!

@hathach
Copy link
Owner Author

hathach commented Feb 22, 2021

no problem at all, I mostly file issue whenever idea come up as reminder anyway :)

@hathach hathach changed the title Merge DCD for stm32 synopsys and esp32s2 Generalize Synopsys DCD/HCD for stm32 and esp32s2 Mar 5, 2021
@hathach
Copy link
Owner Author

hathach commented Mar 5, 2021

Seem like EFM from EnergyMicro/Silab also use Synopsys as well, change The issue name for better meaning. I am hoping to implement it like ehci/ohci where multiple vendors can calls/implement common API to get the driver running.

@cr1901
Copy link
Collaborator

cr1901 commented Mar 5, 2021

If you're not using a broken compiler, a common API will be zero runtime cost anyway thanks to LTO. So this seems like a good idea.

@Novakov
Copy link

Novakov commented Mar 27, 2021

GD32VF103 (RISC-V from GigaDevice) is also using the same driver, in fact I was able to run TinyUSB just by copying stm32f1_fsdev driver plus some structs/defines from stm32 libraries - no changes at all :)

@hathach
Copy link
Owner Author

hathach commented Mar 29, 2021

thanks for confirmation that the stack work with gd32vf103, I also have this board in my drawer as well. Will put it into the official board later on when having time. However, fsdev driver is totally different than the synopsys one mentioned in this issue.

@Novakov
Copy link

Novakov commented Mar 29, 2021

thanks for confirmation that the stack work with gd32vf103, I also have this board in my drawer as well. Will put it into the official board later on when having time. However, fsdev driver is totally different than the synopsys one mentioned in this issue.

Sic, it seems that my reading skills are failing me. Sorry for making mess. Should I remove my comment?

@hathach
Copy link
Owner Author

hathach commented Mar 29, 2021

no problems at all, I have no issues with your comments. At least it provide information that it does work with the gd f103 risc-v :)

@hathach
Copy link
Owner Author

hathach commented Aug 10, 2021

@Novakov I am sorry for mistaking gdvf103 (rsicv) for the gd32f103 (m3). Apparently you are spot on, the risc v version use synopsys driver there is on-going PR to add support for vf103 that you may be interested in #959

@hathach hathach mentioned this issue Aug 10, 2021
@hathach hathach changed the title Generalize Synopsys DCD/HCD for stm32 and esp32s2 Generalize Synopsys DCD/HCD Aug 15, 2021
@hathach hathach pinned this issue Sep 26, 2021
@hathach hathach unpinned this issue Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants