summaryrefslogtreecommitdiffstats
path: root/hw/usb/hcd-xhci-nec.c
diff options
context:
space:
mode:
authorStefan Hajnoczi2017-05-30 15:15:09 +0200
committerStefan Hajnoczi2017-05-30 15:15:10 +0200
commit697e42dec86d9ae706d4ed42c71acb5f35a463c8 (patch)
tree9a07c0d1490c761bb0165b2d0d1f4206b7870c49 /hw/usb/hcd-xhci-nec.c
parentMerge remote-tracking branch 'mst/tags/for_upstream' into staging (diff)
parentehci: fix frame timer invocation. (diff)
downloadqemu-697e42dec86d9ae706d4ed42c71acb5f35a463c8.tar.gz
qemu-697e42dec86d9ae706d4ed42c71acb5f35a463c8.tar.xz
qemu-697e42dec86d9ae706d4ed42c71acb5f35a463c8.zip
Merge remote-tracking branch 'kraxel/tags/pull-usb-20170529-1' into staging
usb: depricate legacy options and hmp commands usb: fixes for ehci and hub, split xhci variants # gpg: Signature made Mon 29 May 2017 02:07:17 PM BST # gpg: using RSA key 0x4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * kraxel/tags/pull-usb-20170529-1: ehci: fix frame timer invocation. usb: don't wakeup during coldplug usb-hub: set PORT_STAT_C_SUSPEND on host-initiated wake-up xhci: add CONFIG_USB_XHCI_NEC option xhci: split into multiple files usb: Simplify the parameter parsing of the legacy usb serial device usb: Deprecate HMP commands usb_add and usb_del usb: Deprecate the legacy -usbdevice option ehci: fix overflow in frame timer code Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'hw/usb/hcd-xhci-nec.c')
-rw-r--r--hw/usb/hcd-xhci-nec.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/hw/usb/hcd-xhci-nec.c b/hw/usb/hcd-xhci-nec.c
new file mode 100644
index 0000000000..75715a048a
--- /dev/null
+++ b/hw/usb/hcd-xhci-nec.c
@@ -0,0 +1,63 @@
+/*
+ * USB xHCI controller emulation
+ *
+ * Copyright (c) 2011 Securiforest
+ * Date: 2011-05-11 ; Author: Hector Martin <hector@marcansoft.com>
+ * Based on usb-ohci.c, emulates Renesas NEC USB 3.0
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "qemu/osdep.h"
+#include "hw/hw.h"
+#include "hw/usb.h"
+#include "hw/pci/pci.h"
+
+#include "hcd-xhci.h"
+
+static Property nec_xhci_properties[] = {
+ DEFINE_PROP_ON_OFF_AUTO("msi", XHCIState, msi, ON_OFF_AUTO_AUTO),
+ DEFINE_PROP_ON_OFF_AUTO("msix", XHCIState, msix, ON_OFF_AUTO_AUTO),
+ DEFINE_PROP_BIT("superspeed-ports-first",
+ XHCIState, flags, XHCI_FLAG_SS_FIRST, true),
+ DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags,
+ XHCI_FLAG_FORCE_PCIE_ENDCAP, false),
+ DEFINE_PROP_UINT32("intrs", XHCIState, numintrs, MAXINTRS),
+ DEFINE_PROP_UINT32("slots", XHCIState, numslots, MAXSLOTS),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void nec_xhci_class_init(ObjectClass *klass, void *data)
+{
+ PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ dc->props = nec_xhci_properties;
+ k->vendor_id = PCI_VENDOR_ID_NEC;
+ k->device_id = PCI_DEVICE_ID_NEC_UPD720200;
+ k->revision = 0x03;
+}
+
+static const TypeInfo nec_xhci_info = {
+ .name = TYPE_NEC_XHCI,
+ .parent = TYPE_XHCI,
+ .class_init = nec_xhci_class_init,
+};
+
+static void nec_xhci_register_types(void)
+{
+ type_register_static(&nec_xhci_info);
+}
+
+type_init(nec_xhci_register_types)