]> git.proxmox.com Git - mirror_qemu.git/blame - hw/usb/vt82c686-uhci-pci.c
Merge tag 'for_upstream' of https://git.kernel.org/pub/scm/virt/kvm/mst/qemu into...
[mirror_qemu.git] / hw / usb / vt82c686-uhci-pci.c
CommitLineData
6f2bcd5f 1#include "qemu/osdep.h"
4f3b0a4d 2#include "hw/isa/vt82c686.h"
6f2bcd5f
PMD
3#include "hcd-uhci.h"
4
5static void usb_uhci_vt82c686b_realize(PCIDevice *dev, Error **errp)
6{
7 UHCIState *s = UHCI(dev);
8 uint8_t *pci_conf = s->dev.config;
9
10 /* USB misc control 1/2 */
11 pci_set_long(pci_conf + 0x40, 0x00001000);
12 /* PM capability */
13 pci_set_long(pci_conf + 0x80, 0x00020001);
14 /* USB legacy support */
15 pci_set_long(pci_conf + 0xc0, 0x00002000);
16
17 usb_uhci_common_realize(dev, errp);
18}
19
20static UHCIInfo uhci_info[] = {
21 {
65c69e9a 22 .name = TYPE_VT82C686B_USB_UHCI,
6f2bcd5f
PMD
23 .vendor_id = PCI_VENDOR_ID_VIA,
24 .device_id = PCI_DEVICE_ID_VIA_UHCI,
25 .revision = 0x01,
26 .irq_pin = 3,
27 .realize = usb_uhci_vt82c686b_realize,
28 .unplug = true,
ece29df3
BZ
29 /* Reason: only works as USB function of VT82xx superio chips */
30 .notuser = true,
6f2bcd5f
PMD
31 }
32};
33
34static const TypeInfo vt82c686b_usb_uhci_type_info = {
35 .parent = TYPE_UHCI,
65c69e9a 36 .name = TYPE_VT82C686B_USB_UHCI,
6f2bcd5f
PMD
37 .class_init = uhci_data_class_init,
38 .class_data = uhci_info,
39};
40
41static void vt82c686b_usb_uhci_register_types(void)
42{
43 type_register_static(&vt82c686b_usb_uhci_type_info);
44}
45
46type_init(vt82c686b_usb_uhci_register_types)