From: Jamin Lin <jamin_lin@aspeedtech.com>
To: "berrange@redhat.com" <berrange@redhat.com>,
"junjie.cao@linux.dev" <junjie.cao@linux.dev>,
"kraxel@redhat.com" <kraxel@redhat.com>,
"marcandre.lureau@redhat.com" <marcandre.lureau@redhat.com>,
"clg@kaod.org" <clg@kaod.org>,
"junjie.cao@intel.com" <junjie.cao@intel.com>,
"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 v9 05/19] hw/usb/hcd-ohci: Add an auto-hub property and leave it off
Date: Tue, 10 Nov 2026 07:28:26 +0000 [thread overview]
Message-ID: <20261110072818.2883349-6-jamin_lin@aspeedtech.com> (raw)
In-Reply-To: <20261110072818.2883349-1-jamin_lin@aspeedtech.com>
Add auto-hub and leave it off. hw_compat_11_1 turns it on for
pci-ohci and sysbus-ohci, so an older machine type keeps the hub it
has today and a guest saved by an older QEMU still loads.
pc87560-ohci is its own PCI front end, not a pci-ohci, so it defines
the property itself.
A companion OHCI adds its ports to the EHCI bus instead of making one,
so there the EHCI property decides.
TODO: Move the entries to hw_compat_11_2 before merge. The series
goes into 12.0, so 11.2 is an old machine type too. hw_compat_11_2
does not exist yet.
Suggested-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Jamin Lin <jamin_lin@aspeedtech.com>
---
hw/usb/hcd-ohci.h | 1 +
hw/core/machine.c | 2 ++
hw/usb/hcd-ohci-pci.c | 1 +
hw/usb/hcd-ohci-sysbus.c | 1 +
hw/usb/hcd-ohci.c | 1 +
hw/usb/pc87560-ohci.c | 1 +
6 files changed, 7 insertions(+)
diff --git a/hw/usb/hcd-ohci.h b/hw/usb/hcd-ohci.h
index d079f8d24e..43240622ef 100644
--- a/hw/usb/hcd-ohci.h
+++ b/hw/usb/hcd-ohci.h
@@ -98,6 +98,7 @@ struct OHCIState {
bool big_endian;
bool consistency_check;
+ bool auto_hub;
};
#define TYPE_SYSBUS_OHCI "sysbus-ohci"
diff --git a/hw/core/machine.c b/hw/core/machine.c
index f79337e7d7..22d2b83459 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -47,6 +47,8 @@ GlobalProperty hw_compat_11_1[] = {
{ "pci-ehci-usb", "auto-hub", "on" },
{ "base-xhci", "auto-hub", "on" },
{ "pci-uhci-usb", "auto-hub", "on" },
+ { "sysbus-ohci", "auto-hub", "on" },
+ { "pci-ohci", "auto-hub", "on" },
};
const size_t hw_compat_11_1_len = G_N_ELEMENTS(hw_compat_11_1);
diff --git a/hw/usb/hcd-ohci-pci.c b/hw/usb/hcd-ohci-pci.c
index 70c9e9ac4f..11c754a948 100644
--- a/hw/usb/hcd-ohci-pci.c
+++ b/hw/usb/hcd-ohci-pci.c
@@ -112,6 +112,7 @@ static const Property ohci_pci_properties[] = {
DEFINE_PROP_STRING("masterbus", OHCIPCIState, masterbus),
DEFINE_PROP_UINT32("num-ports", OHCIPCIState, num_ports, 3),
DEFINE_PROP_UINT32("firstport", OHCIPCIState, firstport, 0),
+ DEFINE_PROP_BOOL("auto-hub", OHCIPCIState, state.auto_hub, false),
};
static const VMStateDescription vmstate_ohci = {
diff --git a/hw/usb/hcd-ohci-sysbus.c b/hw/usb/hcd-ohci-sysbus.c
index 4f51eebccb..69f38b9fce 100644
--- a/hw/usb/hcd-ohci-sysbus.c
+++ b/hw/usb/hcd-ohci-sysbus.c
@@ -61,6 +61,7 @@ static const Property ohci_sysbus_properties[] = {
DEFINE_PROP_UINT32("num-ports", OHCISysBusState, num_ports, 3),
DEFINE_PROP_UINT32("firstport", OHCISysBusState, firstport, 0),
DEFINE_PROP_UINT64("dma-offset", OHCISysBusState, dma_offset, 0),
+ DEFINE_PROP_BOOL("auto-hub", OHCISysBusState, ohci.auto_hub, false),
};
static void ohci_sysbus_class_init(ObjectClass *klass, const void *data)
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 5e5fe41f47..2c25829b76 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1987,6 +1987,7 @@ void usb_ohci_init(OHCIState *ohci, DeviceState *dev, uint32_t num_ports,
}
} else {
usb_bus_new(&ohci->bus, sizeof(ohci->bus), &ohci_bus_ops, dev);
+ ohci->bus.auto_hub = ohci->auto_hub;
for (i = 0; i < num_ports; i++) {
usb_register_port(&ohci->bus, &ohci->rhport[i].port,
ohci, i, &ohci_port_ops,
diff --git a/hw/usb/pc87560-ohci.c b/hw/usb/pc87560-ohci.c
index cc00f6e936..66c1e62d48 100644
--- a/hw/usb/pc87560-ohci.c
+++ b/hw/usb/pc87560-ohci.c
@@ -296,6 +296,7 @@ static const Property ohci_pci_properties[] = {
DEFINE_PROP_STRING("masterbus", OHCIPCIState, masterbus),
DEFINE_PROP_UINT32("num-ports", OHCIPCIState, num_ports, 3),
DEFINE_PROP_UINT32("firstport", OHCIPCIState, firstport, 0),
+ DEFINE_PROP_BOOL("auto-hub", OHCIPCIState, state.auto_hub, false),
};
static const VMStateDescription vmstate_ohci = {
--
2.43.0
next prev parent reply other threads:[~2026-11-10 7:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 7:28 [PATCH v9 00/19] hw/usb: Add a usbredir server transport Jamin Lin
2026-11-10 7:28 ` [PATCH v9 01/19] hw/usb/bus: Add an auto-hub flag to the USB bus Jamin Lin
2026-11-10 7:28 ` [PATCH v9 02/19] hw/usb/hcd-xhci: Add an auto-hub property and leave it off Jamin Lin
2026-11-10 7:28 ` [PATCH v9 03/19] hw/usb/hcd-ehci: " Jamin Lin
2026-11-10 7:28 ` [PATCH v9 04/19] hw/usb/hcd-uhci: " Jamin Lin
2026-11-10 7:28 ` Jamin Lin [this message]
2026-11-10 7:28 ` [PATCH v9 06/19] hw/usb/hcd-dwc2: " Jamin Lin
2026-11-10 7:28 ` [PATCH v9 07/19] hw/usb/xen-usb: Do not insert an automatic hub Jamin Lin
2026-11-10 7:28 ` [PATCH v9 08/19] hw/arm/npcm7xx: Keep the " Jamin Lin
2026-11-10 7:28 ` [PATCH v9 09/19] hw/usb/bus: Turn off the automatic hub by default Jamin Lin
2026-11-10 7:28 ` [PATCH v9 10/19] docs/system/devices/usb: Note the automatic hub change Jamin Lin
2026-11-10 7:28 ` [PATCH v9 11/19] hw/usb/redirect-server: Add a usbredir server device Jamin Lin
2026-11-10 7:28 ` [PATCH v9 12/19] hw/usb/redirect-server: Connect usbredirparser to a chardev Jamin Lin
2026-11-10 7:28 ` [PATCH v9 13/19] hw/usb/redirect-server: Announce the exported device Jamin Lin
2026-11-10 7:28 ` [PATCH v9 14/19] hw/usb/redirect-server: Implement control transfers Jamin Lin
2026-11-10 7:28 ` [PATCH v9 15/19] hw/usb/redirect-server: Send device and interface information Jamin Lin
2026-11-10 7:28 ` [PATCH v9 16/19] hw/usb/redirect-server: Implement bulk and interrupt transfers Jamin Lin
2026-11-10 7:28 ` [PATCH v9 17/19] hw/usb/redirect-server: Stream interrupt IN endpoints Jamin Lin
2026-11-10 7:28 ` [PATCH v9 18/19] hw/usb/redirect-server: Implement isochronous OUT transfers Jamin Lin
2026-11-10 7:28 ` [PATCH v9 19/19] 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=20261110072818.2883349-6-jamin_lin@aspeedtech.com \
--to=jamin_lin@aspeedtech.com \
--cc=anthony@xenproject.org \
--cc=berrange@redhat.com \
--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.