22
#include "qemu/osdep.h"
24
#include "qemu/module.h"
25
#include "hw/pci/pci.h"
26
#include "hw/qdev-properties.h"
28
#include "hcd-xhci-pci.h"
30
OBJECT_DECLARE_SIMPLE_TYPE(XHCINecState, NEC_XHCI)
34
XHCIPciState parent_obj;
41
static Property nec_xhci_properties[] = {
42
DEFINE_PROP_ON_OFF_AUTO("msi", XHCIPciState, msi, ON_OFF_AUTO_AUTO),
43
DEFINE_PROP_ON_OFF_AUTO("msix", XHCIPciState, msix, ON_OFF_AUTO_AUTO),
44
DEFINE_PROP_UINT32("intrs", XHCINecState, intrs, XHCI_MAXINTRS),
45
DEFINE_PROP_UINT32("slots", XHCINecState, slots, XHCI_MAXSLOTS),
46
DEFINE_PROP_END_OF_LIST(),
49
static void nec_xhci_instance_init(Object *obj)
51
XHCIPciState *pci = XHCI_PCI(obj);
52
XHCINecState *nec = NEC_XHCI(obj);
54
pci->xhci.flags = nec->flags;
55
pci->xhci.numintrs = nec->intrs;
56
pci->xhci.numslots = nec->slots;
59
static void nec_xhci_class_init(ObjectClass *klass, void *data)
61
PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
62
DeviceClass *dc = DEVICE_CLASS(klass);
64
device_class_set_props(dc, nec_xhci_properties);
65
k->vendor_id = PCI_VENDOR_ID_NEC;
66
k->device_id = PCI_DEVICE_ID_NEC_UPD720200;
70
static const TypeInfo nec_xhci_info = {
71
.name = TYPE_NEC_XHCI,
72
.parent = TYPE_XHCI_PCI,
73
.instance_size = sizeof(XHCINecState),
74
.instance_init = nec_xhci_instance_init,
75
.class_init = nec_xhci_class_init,
78
static void nec_xhci_register_types(void)
80
type_register_static(&nec_xhci_info);
83
type_init(nec_xhci_register_types)