diff mbox

[v3,4/7] MIPS: Initial support of VIA USB controller used by fulong mini pc

Message ID 1275640773-15354-1-git-send-email-zltjiangshi@gmail.com
State New
Headers show

Commit Message

chen huacai June 4, 2010, 8:39 a.m. UTC
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
---
 hw/usb-uhci.c |   20 ++++++++++++++++++++
 hw/usb-uhci.h |    1 +
 2 files changed, 21 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 624d55b..feb44e6 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -1152,6 +1152,16 @@  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);
+    return usb_uhci_common_initfn(s);
+}
+
 static PCIDeviceInfo uhci_info[] = {
     {
         .qdev.name    = "piix3-usb-uhci",
@@ -1164,6 +1174,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 +1198,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