diff options
| author | Jamin Lin <jamin_lin@aspeedtech.com> | 2026-09-02 02:15:46 +0000 |
|---|---|---|
| committer | Cédric Le Goater <clg@redhat.com> | 2026-09-05 07:05:11 +0200 |
| commit | 8c5b23d0700108be9a1e6aa9cc625ff083cca5aa (patch) | |
| tree | 038eb286355f15840d30183fe18835a39e3de514 /include | |
| parent | 2ceae485fcf114a744ab332bcd61b89bd005fb2d (diff) | |
| download | qemu-8c5b23d0700108be9a1e6aa9cc625ff083cca5aa.tar.gz qemu-8c5b23d0700108be9a1e6aa9cc625ff083cca5aa.zip | |
hw/usb/aspeed-udc: Add programmable endpoint DMA transfers
Add the bulk data plane for the four programmable endpoints. The gadget
driver queues IN data through the descriptor-list DMA ring and arms OUT
buffers through the single-stage DMA registers; host bulk transactions
are served from / delivered into those.
The DMA mode is taken from EP_DMA_CTRL.DESC_OP_EN: IN endpoints use the
descriptor-list ring, OUT endpoints use single-stage buffers.
A transfer larger than one host packet is served across several polls,
with the host packet parked (USB_RET_ASYNC) until the gadget queues (IN)
or arms (OUT) more data, then completed from the matching DMA kick.
With this the gadget data endpoints work, e.g. a mass-storage gadget can
be enumerated and read/written end to end.
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Cédric Le Goater <clg@redhat.com>
Link: https://lore.kernel.org/qemu-devel/20260902021542.3194812-4-jamin_lin@aspeedtech.com
Signed-off-by: Cédric Le Goater <clg@redhat.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/hw/usb/aspeed-udc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/hw/usb/aspeed-udc.h b/include/hw/usb/aspeed-udc.h index ab9d016c61..7701c1aa34 100644 --- a/include/hw/usb/aspeed-udc.h +++ b/include/hw/usb/aspeed-udc.h @@ -42,6 +42,14 @@ typedef struct AspeedUDCEP { MemoryRegion mr; uint32_t regs[ASPEED_UDC_EP_NR_REGS]; int index; + + /* + * host packet parked until the guest gadget driver queues (IN) or + * arms (OUT) data + */ + USBPacket *pkt; + /* bytes of the current IN descriptor already served */ + uint32_t desc_off; } AspeedUDCEP; struct AspeedUDCGadget { |
