hcd-xhci-nec.c 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * USB xHCI controller emulation
  3. *
  4. * Copyright (c) 2011 Securiforest
  5. * Date: 2011-05-11 ; Author: Hector Martin <hector@marcansoft.com>
  6. * Based on usb-ohci.c, emulates Renesas NEC USB 3.0
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  20. */
  21. #include "qemu/osdep.h"
  22. #include "hw/usb.h"
  23. #include "qemu/module.h"
  24. #include "hw/pci/pci.h"
  25. #include "hw/qdev-properties.h"
  26. #include "hcd-xhci.h"
  27. static Property nec_xhci_properties[] = {
  28. DEFINE_PROP_ON_OFF_AUTO("msi", XHCIState, msi, ON_OFF_AUTO_AUTO),
  29. DEFINE_PROP_ON_OFF_AUTO("msix", XHCIState, msix, ON_OFF_AUTO_AUTO),
  30. DEFINE_PROP_BIT("superspeed-ports-first",
  31. XHCIState, flags, XHCI_FLAG_SS_FIRST, true),
  32. DEFINE_PROP_BIT("force-pcie-endcap", XHCIState, flags,
  33. XHCI_FLAG_FORCE_PCIE_ENDCAP, false),
  34. DEFINE_PROP_UINT32("intrs", XHCIState, numintrs, MAXINTRS),
  35. DEFINE_PROP_UINT32("slots", XHCIState, numslots, MAXSLOTS),
  36. DEFINE_PROP_END_OF_LIST(),
  37. };
  38. static void nec_xhci_class_init(ObjectClass *klass, void *data)
  39. {
  40. PCIDeviceClass *k = PCI_DEVICE_CLASS(klass);
  41. DeviceClass *dc = DEVICE_CLASS(klass);
  42. dc->props = nec_xhci_properties;
  43. k->vendor_id = PCI_VENDOR_ID_NEC;
  44. k->device_id = PCI_DEVICE_ID_NEC_UPD720200;
  45. k->revision = 0x03;
  46. }
  47. static const TypeInfo nec_xhci_info = {
  48. .name = TYPE_NEC_XHCI,
  49. .parent = TYPE_XHCI,
  50. .class_init = nec_xhci_class_init,
  51. };
  52. static void nec_xhci_register_types(void)
  53. {
  54. type_register_static(&nec_xhci_info);
  55. }
  56. type_init(nec_xhci_register_types)