pci_sun4v.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /* pci_sun4v.h: SUN4V specific PCI controller support.
  2. *
  3. * Copyright (C) 2006 David S. Miller (davem@davemloft.net)
  4. */
  5. #ifndef _PCI_SUN4V_H
  6. #define _PCI_SUN4V_H
  7. long pci_sun4v_iommu_map(unsigned long devhandle,
  8. unsigned long tsbid,
  9. unsigned long num_ttes,
  10. unsigned long io_attributes,
  11. unsigned long io_page_list_pa);
  12. unsigned long pci_sun4v_iommu_demap(unsigned long devhandle,
  13. unsigned long tsbid,
  14. unsigned long num_ttes);
  15. unsigned long pci_sun4v_iommu_getmap(unsigned long devhandle,
  16. unsigned long tsbid,
  17. unsigned long *io_attributes,
  18. unsigned long *real_address);
  19. unsigned long pci_sun4v_config_get(unsigned long devhandle,
  20. unsigned long pci_device,
  21. unsigned long config_offset,
  22. unsigned long size);
  23. int pci_sun4v_config_put(unsigned long devhandle,
  24. unsigned long pci_device,
  25. unsigned long config_offset,
  26. unsigned long size,
  27. unsigned long data);
  28. unsigned long pci_sun4v_msiq_conf(unsigned long devhandle,
  29. unsigned long msiqid,
  30. unsigned long msiq_paddr,
  31. unsigned long num_entries);
  32. unsigned long pci_sun4v_msiq_info(unsigned long devhandle,
  33. unsigned long msiqid,
  34. unsigned long *msiq_paddr,
  35. unsigned long *num_entries);
  36. unsigned long pci_sun4v_msiq_getvalid(unsigned long devhandle,
  37. unsigned long msiqid,
  38. unsigned long *valid);
  39. unsigned long pci_sun4v_msiq_setvalid(unsigned long devhandle,
  40. unsigned long msiqid,
  41. unsigned long valid);
  42. unsigned long pci_sun4v_msiq_getstate(unsigned long devhandle,
  43. unsigned long msiqid,
  44. unsigned long *state);
  45. unsigned long pci_sun4v_msiq_setstate(unsigned long devhandle,
  46. unsigned long msiqid,
  47. unsigned long state);
  48. unsigned long pci_sun4v_msiq_gethead(unsigned long devhandle,
  49. unsigned long msiqid,
  50. unsigned long *head);
  51. unsigned long pci_sun4v_msiq_sethead(unsigned long devhandle,
  52. unsigned long msiqid,
  53. unsigned long head);
  54. unsigned long pci_sun4v_msiq_gettail(unsigned long devhandle,
  55. unsigned long msiqid,
  56. unsigned long *head);
  57. unsigned long pci_sun4v_msi_getvalid(unsigned long devhandle,
  58. unsigned long msinum,
  59. unsigned long *valid);
  60. unsigned long pci_sun4v_msi_setvalid(unsigned long devhandle,
  61. unsigned long msinum,
  62. unsigned long valid);
  63. unsigned long pci_sun4v_msi_getmsiq(unsigned long devhandle,
  64. unsigned long msinum,
  65. unsigned long *msiq);
  66. unsigned long pci_sun4v_msi_setmsiq(unsigned long devhandle,
  67. unsigned long msinum,
  68. unsigned long msiq,
  69. unsigned long msitype);
  70. unsigned long pci_sun4v_msi_getstate(unsigned long devhandle,
  71. unsigned long msinum,
  72. unsigned long *state);
  73. unsigned long pci_sun4v_msi_setstate(unsigned long devhandle,
  74. unsigned long msinum,
  75. unsigned long state);
  76. unsigned long pci_sun4v_msg_getmsiq(unsigned long devhandle,
  77. unsigned long msinum,
  78. unsigned long *msiq);
  79. unsigned long pci_sun4v_msg_setmsiq(unsigned long devhandle,
  80. unsigned long msinum,
  81. unsigned long msiq);
  82. unsigned long pci_sun4v_msg_getvalid(unsigned long devhandle,
  83. unsigned long msinum,
  84. unsigned long *valid);
  85. unsigned long pci_sun4v_msg_setvalid(unsigned long devhandle,
  86. unsigned long msinum,
  87. unsigned long valid);
  88. /* Sun4v HV IOMMU v2 APIs */
  89. unsigned long pci_sun4v_iotsb_conf(unsigned long devhandle,
  90. unsigned long ra,
  91. unsigned long table_size,
  92. unsigned long page_size,
  93. unsigned long dvma_base,
  94. u64 *iotsb_num);
  95. unsigned long pci_sun4v_iotsb_bind(unsigned long devhandle,
  96. unsigned long iotsb_num,
  97. unsigned int pci_device);
  98. unsigned long pci_sun4v_iotsb_map(unsigned long devhandle,
  99. unsigned long iotsb_num,
  100. unsigned long iotsb_index_iottes,
  101. unsigned long io_attributes,
  102. unsigned long io_page_list_pa,
  103. long *mapped);
  104. unsigned long pci_sun4v_iotsb_demap(unsigned long devhandle,
  105. unsigned long iotsb_num,
  106. unsigned long iotsb_index,
  107. unsigned long iottes,
  108. unsigned long *demapped);
  109. #endif /* !(_PCI_SUN4V_H) */