From patchwork Fri Jul 1 11:27:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 102900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0C460B6EDF for ; Fri, 1 Jul 2011 21:47:38 +1000 (EST) Received: from localhost ([::1]:34366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QccC5-0001P4-Ap for incoming@patchwork.ozlabs.org; Fri, 01 Jul 2011 07:47:33 -0400 Received: from eggs.gnu.org ([140.186.70.92]:53046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qcbsx-0005HV-Vj for qemu-devel@nongnu.org; Fri, 01 Jul 2011 07:27:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qcbst-0005Cf-FO for qemu-devel@nongnu.org; Fri, 01 Jul 2011 07:27:47 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34776) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qcbss-0005By-FG for qemu-devel@nongnu.org; Fri, 01 Jul 2011 07:27:42 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p61BReBD010371 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 1 Jul 2011 07:27:40 -0400 Received: from rincewind.home.kraxel.org (vpn1-7-81.ams2.redhat.com [10.36.7.81]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p61BRZi4012086; Fri, 1 Jul 2011 07:27:38 -0400 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id 6FB5740F72; Fri, 1 Jul 2011 13:27:27 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 1 Jul 2011 13:27:26 +0200 Message-Id: <1309519646-3206-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1309519646-3206-1-git-send-email-kraxel@redhat.com> References: <1309519646-3206-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 2/2] usb: windup ich9_ehci_with_companion_init via -usb2 switch. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Gerd Hoffmann --- 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 #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);