Supports full-speed host with an high-speed PHY (DWC2)#3494
Supports full-speed host with an high-speed PHY (DWC2)#3494ceedriic wants to merge 1 commit intohathach:masterfrom
Conversation
Ok, I would prefer a dynamic config too. But I tried to do it the other way around. The problem with
Is that all buffers sizes will be based on "high speed" settings (big) Or do we need something like PR #3487 for the host side too? I was trying to tackle the problem with:
To have the stack settings based on full speed.
I think you misread the patch: the new CFG_TUH_PHY_SPEED is the "hardware" speed, so dwc2_core_is_highspeed() need to use that. I've tested the 3 following configs:
and it all works. |
You mean which buffer, FIFO in |
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in size
Changes <1% in sizeNo entries. No changes
|
| #endif | ||
| while ((dwc2->gintsts & GINTSTS_CMOD) != GINTSTS_CMODE_HOST) {} | ||
|
|
||
| if (hprt_speed_get(dwc2) != TUSB_SPEED_HIGH) { |
There was a problem hiding this comment.
hmm, what if there is no device connected, it would be full speed ?
There was a problem hiding this comment.
Hmm, yeah, I don't remember why exactly I used that function here. I will look for a better way.
| hcfg |= HCFG_FSLS_PHYCLK_SEL_30_60MHZ; | ||
| } | ||
|
|
||
| if (speed != TUSB_SPEED_HIGH) { |
There was a problem hiding this comment.
Yes, I was trying to keep it the same, but I'm not sure what I was thinking when I wrote part of that patch. I will redo that patch from scratch.
|
We should use tuh_configure() to force the phy selection e.g |
No, you're right, I made a mistake. I was thinking about code like:
But I now see that this only in the device side, and not in the host side. |
Ok, that makes a lot of sense, time for a v3 patch |
|
Bye Bye, welcome #3506 |

Describe the PR
This patch allows configuring a Full-Speed USB host with DWC2 on a board wired with a High-Speed ULPI PHY
Additional context
This implements #3450 proof-of-concept in a proper way (I hope).
It introduces an optional
CFG_TUH_PHY_SPEEDconfiguration option, which specify the PHY configuration and can be different (higher than) CFG_TUH_MAX_SPEEDFor example, this works on a stm32h747 board with external ULPI:
The effect of this configuration is to set the
HCFG_FSLS_ONLYbit on the DWC2 controller at the right place.