From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "kraxel@redhat.com" <kraxel@redhat.com>,
"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>,
"junjie.cao@intel.com" <junjie.cao@intel.com>,
"junjie.cao@linux.dev" <junjie.cao@linux.dev>,
"clg@kaod.org" <clg@kaod.org>,
"Pierrick Bouvier" <pierrick.bouvier@oss.qualcomm.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Kane Chen" <kane_chen@aspeedtech.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>,
"Tyrone Ting" <kfting@nuvoton.com>,
"Hao Wu" <wuhaotsh@google.com>, "Zhao Liu" <zhao1.liu@intel.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Helge Deller" <deller@gmx.de>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Anthony PERARD" <anthony@xenproject.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
"open list:All patches CC here" <qemu-devel@nongnu.org>,
"open list:ASPEED BMCs" <qemu-arm@nongnu.org>,
"open list:X86 Xen CPUs" <xen-devel@lists.xenproject.org>
Cc: Jamin Lin <jamin_lin@aspeedtech.com>, Troy Lee <troy_lee@aspeedtech.com>
Subject: [PATCH v8 06/18] hw/usb/hcd-dwc2: Add an auto-hub property and leave it off
Date: Mon, 2 Nov 2026 09:22:11 +0000 [thread overview]
Message-ID: <20261102092201.1729245-7-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20261102092201.1729245-1-jamin_lin@aspeedtech.com>
dwc2 has one root port and runs at full speed, so a second device only
fits behind the hub.
Add auto-hub and leave it off. raspi has no versioned machine type, so
compat cannot reach it. bcm2835_peripherals turns the property on, and
raspi keeps the hub it has today.
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/usb/hcd-dwc2.h | 1 +
hw/arm/bcm2835_peripherals.c | 1 +
hw/usb/hcd-dwc2.c | 2 ++
3 files changed, 4 insertions(+)
diff --git a/hw/usb/hcd-dwc2.h b/hw/usb/hcd-dwc2.h
index 68877661ca..be06f0b0e7 100644
--- a/hw/usb/hcd-dwc2.h
+++ b/hw/usb/hcd-dwc2.h
@@ -167,6 +167,7 @@ struct DWC2State {
uint16_t fi;
uint16_t next_chan;
bool working;
+ bool auto_hub;
USBPort uport;
DWC2Packet packet[DWC2_NB_CHAN]; /* one packet per chan */
uint8_t usb_buf[DWC2_NB_CHAN][DWC2_MAX_XFER_SIZE]; /* one buffer per chan */
diff --git a/hw/arm/bcm2835_peripherals.c b/hw/arm/bcm2835_peripherals.c
index 558c180df9..9187376812 100644
--- a/hw/arm/bcm2835_peripherals.c
+++ b/hw/arm/bcm2835_peripherals.c
@@ -152,6 +152,7 @@ static void raspi_peripherals_base_init(Object *obj)
/* DWC2 */
object_initialize_child(obj, "dwc2", &s->dwc2, TYPE_DWC2_USB);
+ qdev_prop_set_bit(DEVICE(&s->dwc2), "auto-hub", true);
/* CPRMAN clock manager */
object_initialize_child(obj, "cprman", &s->cprman, TYPE_BCM2835_CPRMAN);
diff --git a/hw/usb/hcd-dwc2.c b/hw/usb/hcd-dwc2.c
index cd3b61158d..14211e6413 100644
--- a/hw/usb/hcd-dwc2.c
+++ b/hw/usb/hcd-dwc2.c
@@ -1354,6 +1354,7 @@ static void dwc2_realize(DeviceState *dev, Error **errp)
address_space_init(&s->dma_as, s->dma_mr, "dwc2");
usb_bus_new(&s->bus, sizeof(s->bus), &dwc2_bus_ops, dev);
+ s->bus.auto_hub = s->auto_hub;
usb_register_port(&s->bus, &s->uport, s, 0, &dwc2_port_ops,
USB_SPEED_MASK_LOW | USB_SPEED_MASK_FULL |
(s->usb_version == 2 ? USB_SPEED_MASK_HIGH : 0));
@@ -1450,6 +1451,7 @@ const VMStateDescription vmstate_dwc2_state = {
static const Property dwc2_usb_properties[] = {
DEFINE_PROP_UINT32("usb_version", DWC2State, usb_version, 2),
+ DEFINE_PROP_BOOL("auto-hub", DWC2State, auto_hub, false),
};
static void dwc2_class_init(ObjectClass *klass, const void *data)
--
2.43.0
next prev parent reply other threads:[~2026-11-02 9:25 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 9:22 [PATCH v8 00/18] hw/usb: Add a usbredir server transport Jamin Lin
2026-11-02 9:22 ` [PATCH v8 01/18] hw/usb/bus: Add an auto-hub flag to the USB bus Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-02 9:22 ` [PATCH v8 02/18] hw/usb/hcd-xhci: Add an auto-hub property and leave it off Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 03/18] hw/usb/hcd-ehci: " Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-02 9:22 ` [PATCH v8 04/18] hw/usb/hcd-uhci: " Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-02 9:22 ` [PATCH v8 05/18] hw/usb/hcd-ohci: " Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 1:29 ` Jamin Lin
2026-11-02 9:22 ` Jamin Lin [this message]
2026-11-02 14:07 ` [PATCH v8 06/18] hw/usb/hcd-dwc2: " marcandre.lureau
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 07/18] hw/usb/xen-usb: Do not insert an automatic hub Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-02 9:22 ` [PATCH v8 08/18] hw/usb/bus: Turn off the automatic hub by default Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-02 9:22 ` [PATCH v8 09/18] hw/arm/npcm7xx: Keep the automatic hub Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 1:06 ` Jamin Lin
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 10/18] docs/system/devices/usb: Note the automatic hub change Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 11/18] hw/usb/redirect-server: Add a usbredir server device Jamin Lin
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 12/18] hw/usb/redirect-server: Connect usbredirparser to a chardev Jamin Lin
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 13/18] hw/usb/redirect-server: Announce the exported device Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 7:14 ` Jamin Lin
2026-11-02 9:22 ` [PATCH v8 14/18] hw/usb/redirect-server: Implement control transfers Jamin Lin
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 15/18] hw/usb/redirect-server: Implement bulk and interrupt transfers Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 16/18] hw/usb/redirect-server: Stream interrupt IN endpoints Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-02 9:22 ` [PATCH v8 17/18] hw/usb/redirect-server: Implement isochronous OUT transfers Jamin Lin
2026-11-02 14:07 ` marcandre.lureau
2026-11-03 14:23 ` Junjie Cao
2026-11-02 9:22 ` [PATCH v8 18/18] hw/arm/aspeed: Enable 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=20261102092201.1729245-7-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=anthony@xenproject.org \
--cc=clg@kaod.org \
--cc=deller@gmx.de \
--cc=edgar.iglesias@gmail.com \
--cc=junjie.cao@intel.com \
--cc=junjie.cao@linux.dev \
--cc=kane_chen@aspeedtech.com \
--cc=kfting@nuvoton.com \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@oss.qualcomm.com \
--cc=pierrick.bouvier@oss.qualcomm.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=sstabellini@kernel.org \
--cc=troy_lee@aspeedtech.com \
--cc=wuhaotsh@google.com \
--cc=xen-devel@lists.xenproject.org \
--cc=zhao1.liu@intel.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.