From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OAvvo-0002aG-LY for qemu-devel@nongnu.org; Sat, 08 May 2010 22:07:48 -0400 Received: from [140.186.70.92] (port=54515 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OAvvm-0002Yu-4H for qemu-devel@nongnu.org; Sat, 08 May 2010 22:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OAvvj-0002Ar-Ee for qemu-devel@nongnu.org; Sat, 08 May 2010 22:07:44 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:59328) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OAvvj-0002Aj-8s for qemu-devel@nongnu.org; Sat, 08 May 2010 22:07:43 -0400 Received: by vws8 with SMTP id 8so244447vws.4 for ; Sat, 08 May 2010 19:07:43 -0700 (PDT) MIME-Version: 1.0 Date: Sun, 9 May 2010 10:07:42 +0800 Message-ID: From: chen huacai Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] [RFC][MIPS][PATCH 4/6] Initial support of VIA USB controller used by fulong mini pc List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: aurelien@aurel32.net Cc: qemu-devel@nongnu.org This patch add Initial support of VIA USB controller used by fulong mini pc Signed-off-by: Huacai Chen ----- diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c index 624d55b..5fd5388 100644 --- a/hw/usb-uhci.c +++ b/hw/usb-uhci.c @@ -1152,6 +1152,26 @@ 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); + + pci_set_long(pci_conf + 0x0c,0x00001600); + pci_set_long(pci_conf + 0x20,0x00000301); + pci_set_long(pci_conf + 0x34,0x00001080); + pci_set_long(pci_conf + 0x3c,0x00000004); + pci_set_long(pci_conf + 0x40,0x00001000); + pci_set_long(pci_conf + 0x60,0x00000010); + pci_set_long(pci_conf + 0x80,0x00020001); + pci_set_long(pci_conf + 0xc0,0x00002000); + + return usb_uhci_common_initfn(s); +} + static PCIDeviceInfo uhci_info[] = { { .qdev.name = "piix3-usb-uhci", @@ -1164,6 +1184,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 +1208,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 ----- -- Huacai Chen