[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-arm] [PATCH 1/2] usb/ehci: Add SysBus EHCI device for Allwinner So
From: |
Icenowy Zheng |
Subject: |
[Qemu-arm] [PATCH 1/2] usb/ehci: Add SysBus EHCI device for Allwinner SoCs |
Date: |
Sun, 29 Jan 2017 09:00:12 +0800 |
It uses a register map like the one in Exynos SoCs.
Signed-off-by: Icenowy Zheng <address@hidden>
---
hw/usb/hcd-ehci-sysbus.c | 17 +++++++++++++++++
hw/usb/hcd-ehci.h | 1 +
2 files changed, 18 insertions(+)
diff --git a/hw/usb/hcd-ehci-sysbus.c b/hw/usb/hcd-ehci-sysbus.c
index 6c20604d07..d99bb4abe7 100644
--- a/hw/usb/hcd-ehci-sysbus.c
+++ b/hw/usb/hcd-ehci-sysbus.c
@@ -218,6 +218,22 @@ static const TypeInfo ehci_fusbh200_type_info = {
.class_init = fusbh200_ehci_class_init,
};
+static void ehci_allwinner_class_init(ObjectClass *oc, void *data)
+{
+ SysBusEHCIClass *sec = SYS_BUS_EHCI_CLASS(oc);
+ DeviceClass *dc = DEVICE_CLASS(oc);
+
+ sec->capsbase = 0x0;
+ sec->opregbase = 0x10;
+ set_bit(DEVICE_CATEGORY_USB, dc->categories);
+}
+
+static const TypeInfo ehci_allwinner_type_info = {
+ .name = TYPE_ALLWINNER_EHCI,
+ .parent = TYPE_SYS_BUS_EHCI,
+ .class_init = ehci_allwinner_class_init,
+};
+
static void ehci_sysbus_register_types(void)
{
type_register_static(&ehci_type_info);
@@ -225,6 +241,7 @@ static void ehci_sysbus_register_types(void)
type_register_static(&ehci_exynos4210_type_info);
type_register_static(&ehci_tegra2_type_info);
type_register_static(&ehci_fusbh200_type_info);
+ type_register_static(&ehci_allwinner_type_info);
}
type_init(ehci_sysbus_register_types)
diff --git a/hw/usb/hcd-ehci.h b/hw/usb/hcd-ehci.h
index 3fd7038658..89f3c7d922 100644
--- a/hw/usb/hcd-ehci.h
+++ b/hw/usb/hcd-ehci.h
@@ -343,6 +343,7 @@ typedef struct EHCIPCIState {
#define TYPE_EXYNOS4210_EHCI "exynos4210-ehci-usb"
#define TYPE_TEGRA2_EHCI "tegra2-ehci-usb"
#define TYPE_FUSBH200_EHCI "fusbh200-ehci-usb"
+#define TYPE_ALLWINNER_EHCI "allwinner-ehci-usb"
#define SYS_BUS_EHCI(obj) \
OBJECT_CHECK(EHCISysBusState, (obj), TYPE_SYS_BUS_EHCI)
--
2.11.0
- [Qemu-arm] [PATCH 1/2] usb/ehci: Add SysBus EHCI device for Allwinner SoCs,
Icenowy Zheng <=