aboutsummaryrefslogtreecommitdiff
path: root/hw/usb/hcd-ehci-sysbus.c
diff options
context:
space:
mode:
authorHongbo Zhang <hongbo.zhang@linaro.org>2018-12-29 18:00:57 +0800
committerGerd Hoffmann <kraxel@redhat.com>2019-01-08 12:41:32 +0100
commit114529f79ec37261dda7e3c7846a04a5bfc212bd (patch)
treee0c3442d8787e5e4edf428417b99c6dfdf9ee6b6 /hw/usb/hcd-ehci-sysbus.c
parent8e3759ef04dbd87ad21502e78b068d6473c6b5d9 (diff)
downloadqemu-114529f79ec37261dda7e3c7846a04a5bfc212bd.zip
qemu-114529f79ec37261dda7e3c7846a04a5bfc212bd.tar.gz
qemu-114529f79ec37261dda7e3c7846a04a5bfc212bd.tar.bz2
hw/usb: Add generic sys-bus EHCI controller
This patch introduces a new system bus generic EHCI controller. For the system bus EHCI controller, we've already had "xlnx", "exynos4210", "tegra2", "ppc4xx" and "fusbh200", they are specific and only suitable for their own platforms, platforms such as an Arm server, may need a generic system bus EHCI controller, this patch creates it, and the kernel driver ehci_platform.c works well on it. Signed-off-by: Hongbo Zhang <hongbo.zhang@linaro.org> Message-id: 1546077657-22637-1-git-send-email-hongbo.zhang@linaro.org Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/usb/hcd-ehci-sysbus.c')
-rw-r--r--hw/usb/hcd-ehci-sysbus.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 3b83beb..331faf8 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -94,6 +94,22 @@ static const TypeInfo ehci_type_info = {
.class_size = sizeof(SysBusEHCIClass),
};
+static void ehci_platform_class_init(ObjectClass *oc, void *data)
+{
+ SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc);
+ DeviceClass *dc = DEVICE_CLASS(oc);
+
+ sec->capsbase = 0x0;
+ sec->opregbase = 0x20;
+ set_bit(DEVICE_CATEGORY_USB, dc->categories);
+}
+
+static const TypeInfo ehci_platform_type_info = {
+ .name = TYPE_PLATFORM_EHCI,
+ .parent = TYPE_SYS_BUS_EHCI,
+ .class_init = ehci_platform_class_init,
+};
+
static void ehci_xlnx_class_init(ObjectClass *oc, void *data)
{
SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc);
@@ -245,6 +261,7 @@ static const TypeInfo ehci_fusbh200_type_info = {
static void ehci_sysbus_register_types(void)
{
type_register_static(&ehci_type_info);
+ type_register_static(&ehci_platform_type_info);
type_register_static(&ehci_xlnx_type_info);
type_register_static(&ehci_exynos4210_type_info);
type_register_static(&ehci_tegra2_type_info);