QEMU-Arm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "junjie.cao@linux.dev" <junjie.cao@linux.dev>,
	"junjie.cao@intel.com" <junjie.cao@intel.com>,
	"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Kane Chen" <kane_chen@aspeedtech.com>,
	"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 v6 8/8] hw/arm/aspeed: Enable the usbredir server transport
Date: Mon, 19 Oct 2026 09:24:58 +0000	[thread overview]
Message-ID: <20261019092448.278079-9-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20261019092448.278079-1-jamin_lin@aspeedtech.com>

Let the ASPEED machines accept "x-usb-redir-server" with -device, so a
UDC gadget can be exported to a USB host running in another QEMU:

  -device x-usb-redir-server,id=redirsrv,chardev=<chr>
  -device aspeed.udc-gadget,bus=redirsrv.0,udc=/machine/soc/udc

x-usb-redir-server sits on the main system bus so that the USB bus it
provides can be found by "bus=<id>.0". That makes it a sysbus device, and
a sysbus device can only be created with -device if the machine lists it.

Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 hw/arm/aspeed.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/hw/arm/aspeed.c b/hw/arm/aspeed.c
index a7cfbd6c5e..fc27ac1788 100644
--- a/hw/arm/aspeed.c
+++ b/hw/arm/aspeed.c
@@ -409,6 +409,13 @@ static void aspeed_machine_class_init(ObjectClass *oc, const void *data)
     mc->no_cdrom = 1;
     mc->no_parallel = 1;
     mc->default_ram_id = "ram";
+    /*
+     * Lets a UDC gadget be exported to another QEMU instance over usbredir.
+     * The type name is spelled out rather than used through its macro so
+     * that this still builds when the usbredir library is absent.
+     */
+    machine_class_allow_dynamic_sysbus_dev(mc,
+                                           "x-usb-redir-server");
     amc->macs_mask = ASPEED_MAC0_ON;
     amc->uart_default = ASPEED_DEV_UART5;
 
-- 
2.43.0


      parent reply	other threads:[~2026-10-19  9:26 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-19  9:24 [PATCH v6 0/8] hw/usb: Add a usbredir server transport Jamin Lin
2026-10-19  9:24 ` [PATCH v6 1/8] hw/usb/bus: Let a bus opt out of automatic hub insertion Jamin Lin
2026-10-19 10:27   ` Gerd Hoffmann
2026-10-27  5:39     ` Jamin Lin
2026-10-28 11:34       ` Gerd Hoffmann
2026-10-29  2:05         ` Jamin Lin
2026-10-19  9:24 ` [PATCH v6 2/8] hw/usb/redirect-server: Add a usbredir server device Jamin Lin
2026-10-19  9:24 ` [PATCH v6 3/8] hw/usb/redirect-server: Connect usbredirparser to a chardev Jamin Lin
2026-10-19  9:24 ` [PATCH v6 4/8] hw/usb/redirect-server: Announce the exported device Jamin Lin
2026-10-19  9:24 ` [PATCH v6 5/8] hw/usb/redirect-server: Implement control transfers Jamin Lin
2026-10-19 12:44   ` marcandre.lureau
2026-10-21  5:51     ` Jamin Lin
2026-10-19  9:24 ` [PATCH v6 6/8] hw/usb/redirect-server: Implement bulk and interrupt transfers Jamin Lin
2026-10-19 12:44   ` marcandre.lureau
2026-10-20  7:41     ` Jamin Lin
2026-10-19  9:24 ` [PATCH v6 7/8] hw/usb/redirect-server: Stream interrupt IN endpoints Jamin Lin
2026-10-19 12:44   ` marcandre.lureau
2026-10-20  6:00     ` Jamin Lin
2026-10-22  6:08   ` Junjie Cao
2026-10-22  6:42     ` Jamin Lin
2026-10-19  9:24 ` Jamin Lin [this message]

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=20261019092448.278079-9-jamin_lin@aspeedtech.com \
    --to=jamin_lin@aspeedtech.com \
    --cc=clg@kaod.org \
    --cc=junjie.cao@intel.com \
    --cc=junjie.cao@linux.dev \
    --cc=kane_chen@aspeedtech.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox