From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "Cédric Le Goater" <clg@kaod.org>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Steven Lee" <steven_lee@aspeedtech.com>,
"Troy Lee" <leetroy@gmail.com>,
"Kane Chen" <kane_chen@aspeedtech.com>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Joel Stanley" <joel@jms.id.au>,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
"open list:All patches CC here" <qemu-devel@nongnu.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>, Troy Lee <troy_lee@aspeedtech.com>
Subject: [PATCH v2 00/11] hw/usb/aspeed-udc: Add AST1030 UDC support
Date: Mon, 5 Oct 2026 06:44:19 +0000 [thread overview]
Message-ID: <20261005064418.3060881-1-jamin_lin@aspeedtech.com> (raw)
This series adds USB Device Controller (UDC) support for the ASPEED
AST1030 and extends the existing ASPEED UDC model with the transfer
handling required by the AST1030.
The v1 series included both the usbredir server transport and the ASPEED
AST1030 UDC support. Following review feedback, the two parts have been
split into separate series. The usbredir server transport is now sent
separately, while this series contains the ASPEED AST1030 UDC changes.
Dependency
==========
The AST1030 UDC implementation itself does not depend on the usbredir
server transport series. However, the functional test in this series
does depend on it, because the AST1030 has no USB host controller and
requires usb-redir-server to export the emulated USB gadget to a USB
host controller in another QEMU instance.
The functional test therefore depends on:
[PATCH v2 0/8] hw/usb: Add a usbredir server transport
https://patchwork.kernel.org/project/qemu-devel/cover/20261005032022.3980903-1-jamin_lin@aspeedtech.com/
Background
==========
This work is part of a larger plan to model USB device-side support on
ASPEED BMC/BIC SoCs, which has three goals:
1. Model the ASPEED UDC (AST2600 / AST1030). The AST2600 also has USB host
(EHCI) controllers, so that work targets the AST2600 UDC: its gadget can
be attached to the SoC's own EHCI bus, letting the guest enumerate its
own gadget and exercise the UDC end-to-end. [Done]
https://lore.kernel.org/qemu-devel/20260902021542.3194812-1-jamin_lin@aspeedtech.com/
2. AST1030 UDC. The AST1030 has no USB host controller, so testing its UDC
needs a second QEMU instance. The UDC gadget is redirected out of the
guest with libusbredir and attached to another QEMU that runs a USB host
(a VMM, or an AST2600 / AST2700 guest). [this series]
3. ASPEED vHub, as a longer-term goal towards BMC KVM / Virtual Media
support in QEMU. [future]
This series implements goal 2.
AST1030 gadget to an AST2700 host
=================================
QEMU #1 -M ast1030-evb QEMU #2 -M ast2700a2-evb
+-----------------------------+ +-----------------------------+
| Zephyr usb_dc_aspeed | | Linux ehci-platform |
+--------------+--------------+ +--------------+--------------+
| MMIO | MMIO
+--------------v--------------+ +--------------v--------------+
| aspeed.udc | | EHCI3 (usb-bus.3) |
+--------------+--------------+ +--------------+--------------+
| USBPacket | USBPacket
+--------------v--------------+ +--------------v--------------+
| aspeed.udc-gadget | | usb-redir |
+--------------+--------------+ +--------------+--------------+
| USBPacket |
+--------------v--------------+ |
| usb-redir-server | |
+--------------+--------------+ |
| |
+=========== unix socket ============+
usbredir protocol
Testing
=======
The AST1030 UDC was tested with a Zephyr CDC-ACM gadget. The AST1030
side exports the gadget through usb-redir-server:
$ qemu-system-arm -M ast1030-evb -nographic
-kernel zephyr.bin
-chardev socket,id=u,path=/tmp/usbredir.sock,server=on,wait=off
-device usb-redir-server,id=udcredir,chardev=u
-device aspeed.udc-gadget,bus=udcredir.0,udc=/machine/soc/udc
uart:~$ usb enable
uart:~$ usb print 1
The gadget is attached to EHCI3 of an AST2700 guest through the
usb-redir client:
$ qemu-system-aarch64 -M ast2700a2-evb -nographic
-drive file=image-bmc,if=mtd,format=raw -snapshot
-net nic -net user
-chardev socket,id=r,path=/tmp/usbredir.sock
-device usb-redir,chardev=r,bus=usb-bus.3
The AST2700 guest enumerates the AST1030 gadget:
root@ast2700-default:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.18.36 ehci_hcd EHCI Host Controller
Bus 001 Device 002: ID 2245:1030 ZEPHYR Zephyr DFU sample
Data transfer was also checked:
2700 -> 1030
echo '1234567890' > /dev/ttyACM0
1030 console: Print Data: 0x31 0x32 ... 0x30
A functional test is added to exercise the AST1030 UDC through this
usbredir setup.
v1:
1. Make the SETUP buffer byte addressable
2. Support single-stage IN transfers
3. Clear EP_POOL_ACK when no endpoint ack is left
4. Mask the reserved bits on register writes
5. Use the endpoint max packet size for OUT transfers
6. Test the usbredir server transport
7. Add the USB device controller for AST1030
v2:
1. Split the usbredir server transport into a separate series as
suggested during review.
2. Keep this series focused on the ASPEED UDC changes and AST1030
UDC support.
3. Add the AST1030 functional test using the usbredir server transport.
Jamin Lin (11):
hw/usb/aspeed-udc: Make the SETUP buffer byte addressable
hw/usb/aspeed-udc: Mask the reserved bits on register writes
hw/usb/aspeed-udc: Clear EP_POOL_ACK when no endpoint ack is left
hw/usb/aspeed-udc: Rename the transfer helpers after their DMA mode
hw/usb/aspeed-udc: Store the EP_DMA_STS write first
hw/usb/aspeed-udc: Pick the EP_DMA_STS path by direction
hw/usb/aspeed-udc: Support single-stage IN transfers
hw/usb/aspeed-udc: Use the endpoint max packet size for OUT transfers
hw/usb/aspeed-udc: Add trace events for the transfer paths
hw/arm/aspeed_ast10x0: Add the USB device controller
tests/functional/arm/test_aspeed_ast1030: Test the usbredir server
transport
include/hw/arm/aspeed_soc.h | 1 +
include/hw/usb/aspeed-udc.h | 13 +-
hw/arm/aspeed_ast10x0.c | 17 +-
hw/usb/aspeed-udc.c | 290 ++++++++++++++++----
hw/usb/trace-events | 9 +
tests/functional/arm/meson.build | 1 +
tests/functional/arm/test_aspeed_ast1030.py | 52 ++++
7 files changed, 330 insertions(+), 53 deletions(-)
--
2.43.0
next reply other threads:[~2026-10-05 6:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-05 6:44 Jamin Lin [this message]
2026-10-05 6:44 ` [PATCH v2 01/11] hw/usb/aspeed-udc: Make the SETUP buffer byte addressable Jamin Lin
2026-10-12 6:27 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 02/11] hw/usb/aspeed-udc: Mask the reserved bits on register writes Jamin Lin
2026-10-12 6:27 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 03/11] hw/usb/aspeed-udc: Clear EP_POOL_ACK when no endpoint ack is left Jamin Lin
2026-10-12 6:28 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 04/11] hw/usb/aspeed-udc: Rename the transfer helpers after their DMA mode Jamin Lin
2026-10-12 6:28 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 05/11] hw/usb/aspeed-udc: Store the EP_DMA_STS write first Jamin Lin
2026-10-12 6:28 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 06/11] hw/usb/aspeed-udc: Pick the EP_DMA_STS path by direction Jamin Lin
2026-10-12 6:29 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 07/11] hw/usb/aspeed-udc: Support single-stage IN transfers Jamin Lin
2026-10-05 6:44 ` [PATCH v2 08/11] hw/usb/aspeed-udc: Use the endpoint max packet size for OUT transfers Jamin Lin
2026-10-05 6:44 ` [PATCH v2 09/11] hw/usb/aspeed-udc: Add trace events for the transfer paths Jamin Lin
2026-10-12 6:29 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 10/11] hw/arm/aspeed_ast10x0: Add the USB device controller Jamin Lin
2026-10-12 6:29 ` Cédric Le Goater
2026-10-05 6:44 ` [PATCH v2 11/11] tests/functional/arm/test_aspeed_ast1030: Test the usbredir server transport Jamin Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261005064418.3060881-1-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=andrew@codeconstruct.com.au \
--cc=clg@kaod.org \
--cc=joel@jms.id.au \
--cc=kane_chen@aspeedtech.com \
--cc=leetroy@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=steven_lee@aspeedtech.com \
--cc=troy_lee@aspeedtech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.