drivers: usb: uhc_dwc2: add bulk transfer support#105287
drivers: usb: uhc_dwc2: add bulk transfer support#105287roma-jam wants to merge 4 commits intozephyrproject-rtos:mainfrom
Conversation
|
|
This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time. |
8ad2afb to
343b640
Compare
Add 'gsnpsid' and 'ghwcfg3' to DWC2 USB peripheral in order to check that they are as expected at runtimne, which the host driver can use. Signed-off-by: Josuah Demangeon <josuah.demangeon@nordicsemi.no>
Note: Control transfers only Add initial usb host driver for Synopsys DWC2 with vendor quirks. Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
Add handling for a channel with type Bulk. Signed-off-by: Roman Leonov <jam_roma@yahoo.com>
343b640 to
c1676d3
Compare
|
| /* TODO: Do we need to toggle PID? */ | ||
| /* TODO: where to keep the toggle flag? How it is done in the other drivers? */ | ||
| /* PID support to be a part of EP or XFER, not channel */ |
There was a problem hiding this comment.
I think with BULK and Buffer DMA mode, the toggling of DATA0/DATA1 PIDs is automatic.
In completer mode, the CPU is involved every packet.
In buffer DMA, the CPU is involved at the beginning and the end.
So the CPU does not have access to the packet-level information, such as the PID (beyon the first one).
There was a problem hiding this comment.
Correct.
In buffer DMA, the CPU is involved at the beginning and the end.
But when we prepare the transfer in the begging - we need to understand, do we need to use the same PID on the next transfer with the same EP, or we need to toggle it:
This is why I added the calculation logic:
/* If amount of packets are even - do not toggle */
if ((pkt_cnt & 0x01U) == 0U) {
There are two common possible ways:
- fetch the
PIDin the end of transfer (CPLT) and count thenext_pidbased on this value, keep thenext_pidsomeplace for the next transfer - calculate
next_pidbefore schedule the transfer and keep it till the next transfer. But in this case we do not need to toggle it, if the result wasNACK.
There was a problem hiding this comment.
I see the problem now. It is not about toggling the PID every time, but detecting the current toggling state after feeding more buffers to an ongoing transfer.
Thank you for clarifying.



Collective Pull-request
Contains the incoming features and all the prerequisites.
Work in Progress
Description
N/A
Testing
/samples/subsys/usb/shellfolder, runand get:
then run:
and the the common usbh shell commands are available:
Changes
Updated
drivers/usb/uhc/uhc_dwc2.c- Added BULK transfer type.Related