aboutsummaryrefslogtreecommitdiff
path: root/hw/usb-uhci.c
diff options
context:
space:
mode:
authorHuacai Chen <zltjiangshi@gmail.com>2010-06-29 10:50:09 +0800
committerAurelien Jarno <aurelien@aurel32.net>2010-06-29 23:07:52 +0200
commit30235a54dcbdbff2e04779cba541695827230625 (patch)
treea109f7048bc7b31fd35953715ff371ee3e7dd61a /hw/usb-uhci.c
parent016512f3d49af277b768dd5d443b827f35e137ff (diff)
MIPS: Initial support of VIA USB controller used by fulong mini pc
Signed-off-by: Huacai Chen <zltjiangshi@gmail.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/usb-uhci.c')
-rw-r--r--hw/usb-uhci.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 624d55b3b2..3eb9832b26 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");
+}