From patchwork Tue Jun 29 02:50:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chen huacai X-Patchwork-Id: 57233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 5FA70B6F1C for ; Tue, 29 Jun 2010 12:50:10 +1000 (EST) Received: from localhost ([127.0.0.1]:38149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTQtZ-0004cp-3X for incoming@patchwork.ozlabs.org; Mon, 28 Jun 2010 22:49:57 -0400 Received: from [140.186.70.92] (port=36354 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTQsB-0004Zy-OX for qemu-devel@nongnu.org; Mon, 28 Jun 2010 22:48:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTQs9-0007pT-35 for qemu-devel@nongnu.org; Mon, 28 Jun 2010 22:48:30 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:65473) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTQs8-0007pN-Uu for qemu-devel@nongnu.org; Mon, 28 Jun 2010 22:48:29 -0400 Received: by pzk36 with SMTP id 36so1059509pzk.4 for ; Mon, 28 Jun 2010 19:48:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer; bh=0jsgM8LC8iCWRcY5UqnYqTfBQQ4qbJ5vRr12A9U3muQ=; b=jB6QOdjr9hK4/6dgs0Qtb2Tobayfuo4Ay887neZvLtaYWEv2ev3s3LO3DOEd55/evp yJ8vmf8TbsJT3mXvF4V8q2Rao8f2LNY3zxtFSgmmdBT+lnolZFjqlF4aFdlvc0OL/qAQ q36S+M4UzN0HdslS2gujNSCrGqyASO1Or4MAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=TS461rRGLzLfV9HMn2L0eVbFdg2HmgOyOcljtkt1XXdN6WeELkzN//ckv883ozm5Pi ylGDxPDEqxXzOlvvY5fKvlymfNTeXpD8oOaljVA1lYADuNVwy/pa1MI1rb9D9yogYIk3 zHWQMyrFD57+2+r+4f22y7h4xfOPWm5vxwIrM= Received: by 10.143.154.42 with SMTP id g42mr4874033wfo.108.1277779707861; Mon, 28 Jun 2010 19:48:27 -0700 (PDT) Received: from localhost.localdomain ([211.69.198.200]) by mx.google.com with ESMTPS id e32sm3984027wfj.15.2010.06.28.19.48.24 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jun 2010 19:48:26 -0700 (PDT) From: Huacai Chen To: aurelien@aurel32.net Date: Tue, 29 Jun 2010 10:50:09 +0800 Message-Id: <1277779809-8749-1-git-send-email-zltjiangshi@gmail.com> X-Mailer: git-send-email 1.7.0.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: blauwirbel@gmail.com, yamahata@valinux.co.jp, qemu-devel@nongnu.org, Huacai Chen Subject: [Qemu-devel] [PATCH v6 4/6] MIPS: Initial support of VIA USB controller used by fulong mini pc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Huacai Chen --- hw/usb-uhci.c | 28 ++++++++++++++++++++++++++++ hw/usb-uhci.h | 1 + 2 files changed, 29 insertions(+), 0 deletions(-) diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 624d55b..3eb9832 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -1152,6 +1152,24 @@ static int usb_uhci_piix4_initfn(PCIDevice *dev) return usb_uhci_common_initfn(s); } +static int usb_uhci_vt82c686b_initfn(PCIDevice *dev) +{ + UHCIState *s = DO_UPCAST(UHCIState, dev, dev); + uint8_t *pci_conf = s->dev.config; + + pci_config_set_vendor_id(pci_conf, PCI_VENDOR_ID_VIA); + pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_VIA_UHCI); + + /* USB misc control 1/2 */ + pci_set_long(pci_conf + 0x40,0x00001000); + /* PM capability */ + pci_set_long(pci_conf + 0x80,0x00020001); + /* USB legacy support */ + pci_set_long(pci_conf + 0xc0,0x00002000); + + return usb_uhci_common_initfn(s); +} + static PCIDeviceInfo uhci_info[] = { { .qdev.name = "piix3-usb-uhci", @@ -1164,6 +1182,11 @@ static PCIDeviceInfo uhci_info[] = { .qdev.vmsd = &vmstate_uhci, .init = usb_uhci_piix4_initfn, },{ + .qdev.name = "vt82c686b-usb-uhci", + .qdev.size = sizeof(UHCIState), + .qdev.vmsd = &vmstate_uhci, + .init = usb_uhci_vt82c686b_initfn, + },{ /* end of list */ } }; @@ -1183,3 +1206,8 @@ void usb_uhci_piix4_init(PCIBus *bus, int devfn) { pci_create_simple(bus, devfn, "piix4-usb-uhci"); } + +void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn) +{ + pci_create_simple(bus, devfn, "vt82c686b-usb-uhci"); +} diff --git a/hw/usb-uhci.h b/hw/usb-uhci.h index 911948e..3e4d377 100644 --- a/hw/usb-uhci.h +++ b/hw/usb-uhci.h @@ -5,5 +5,6 @@ void usb_uhci_piix3_init(PCIBus *bus, int devfn); void usb_uhci_piix4_init(PCIBus *bus, int devfn); +void usb_uhci_vt82c686b_init(PCIBus *bus, int devfn); #endif