MIPS: Initial support of VIA USB controller used by fulong mini pc
authorHuacai Chen <zltjiangshi@gmail.com>
Tue, 29 Jun 2010 02:50:09 +0000 (10:50 +0800)
committerAurelien Jarno <aurelien@aurel32.net>
Tue, 29 Jun 2010 21:07:52 +0000 (23:07 +0200)
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/usb-uhci.c
hw/usb-uhci.h

index 624d55b3b265b318b050c3a40c09d55fe0c8546e..3eb9832b2625cd171417be21588e57bb7d2df699 100644 (file)
@@ -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",
@@ -1163,6 +1181,11 @@ static PCIDeviceInfo uhci_info[] = {
         .qdev.size    = sizeof(UHCIState),
         .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");
+}
index 911948edb45b353b61036c5c0e85a92a11a1fdbc..3e4d3777d434099c989da382cb17233608bc8f2e 100644 (file)
@@ -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
This page took 0.031613 seconds and 4 git commands to generate.