qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 2/2] usb: windup ich9_ehci_with_companion_init via -usb2 switch.
Date: Fri,  1 Jul 2011 13:27:26 +0200	[thread overview]
Message-ID: <1309519646-3206-3-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1309519646-3206-1-git-send-email-kraxel@redhat.com>

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/pc_piix.c    |   14 ++++++++++----
 qemu-options.hx |   13 +++++++++++--
 vl.c            |    3 +++
 3 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/hw/pc_piix.c b/hw/pc_piix.c
index c5c16b4..c9aed67 100644
--- a/hw/pc_piix.c
+++ b/hw/pc_piix.c
@@ -39,6 +39,7 @@
 #include "blockdev.h"
 #include "smbus.h"
 #include "xen.h"
+#include "usb.h"
 #ifdef CONFIG_XEN
 #  include <xen/hvm/hvm_info_table.h>
 #endif
@@ -134,6 +135,15 @@ static void pc_init1(ram_addr_t ram_size,
 
     pc_register_ferr_irq(isa_get_irq(13));
 
+    if (pci_enabled && usb_enabled) {
+        if (usb_enabled == 2) {
+            int slot = PCI_SLOT(piix3_devfn) + 1;
+            ich9_ehci_with_companion_init(pci_bus, PCI_DEVFN(slot, 0), "ehci");
+        } else {
+            usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
+        }
+    }
+
     pc_vga_init(pci_enabled? pci_bus: NULL);
 
     if (xen_enabled()) {
@@ -172,10 +182,6 @@ static void pc_init1(ram_addr_t ram_size,
     pc_cmos_init(below_4g_mem_size, above_4g_mem_size, boot_device,
                  idebus[0], idebus[1], rtc_state);
 
-    if (pci_enabled && usb_enabled) {
-        usb_uhci_piix3_init(pci_bus, piix3_devfn + 2);
-    }
-
     if (pci_enabled && acpi_enabled) {
         i2c_bus *smbus;
 
diff --git a/qemu-options.hx b/qemu-options.hx
index 37e54ee..c59b532 100644
--- a/qemu-options.hx
+++ b/qemu-options.hx
@@ -411,7 +411,7 @@ STEXI
 ETEXI
 
 DEF("usb", 0, QEMU_OPTION_usb,
-    "-usb            enable the USB driver (will be the default soon)\n",
+    "-usb            enable the USB 1.1 driver (will be the default soon)\n",
     QEMU_ARCH_ALL)
 STEXI
 USB options:
@@ -419,7 +419,16 @@ USB options:
 
 @item -usb
 @findex -usb
-Enable the USB driver (will be the default soon)
+Enable the USB 1.1 driver (will be the default soon)
+ETEXI
+
+DEF("usb2", 0, QEMU_OPTION_usb2,
+    "-usb2           enable the USB 2.0 driver\n",
+    QEMU_ARCH_ALL)
+STEXI
+@item -usb2
+@findex -usb2
+Enable the USB 2.0 driver
 ETEXI
 
 DEF("usbdevice", HAS_ARG, QEMU_OPTION_usbdevice,
diff --git a/vl.c b/vl.c
index 52402a2..f4f23ce 100644
--- a/vl.c
+++ b/vl.c
@@ -2698,6 +2698,9 @@ int main(int argc, char **argv, char **envp)
             case QEMU_OPTION_usb:
                 usb_enabled = 1;
                 break;
+            case QEMU_OPTION_usb2:
+                usb_enabled = 2;
+                break;
             case QEMU_OPTION_usbdevice:
                 usb_enabled = 1;
                 add_device_config(DEV_USB, optarg);
-- 
1.7.1

  parent reply	other threads:[~2011-07-01 11:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01 11:27 [Qemu-devel] PCI: how handle multifunction / compound devices best? Gerd Hoffmann
2011-07-01 11:27 ` [Qemu-devel] [PATCH 1/2] usb: add ich9_ehci_with_companion_init() Gerd Hoffmann
2011-07-01 11:27 ` Gerd Hoffmann [this message]
2011-07-01 12:19 ` [Qemu-devel] PCI: how handle multifunction / compound devices best? Anthony Liguori
2011-07-04 15:19   ` Markus Armbruster
2011-07-04 16:09 ` Markus Armbruster
2011-07-05  7:41   ` Gerd Hoffmann

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=1309519646-3206-3-git-send-email-kraxel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).