hptiop.txt 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. HIGHPOINT ROCKETRAID 3xxx/4xxx ADAPTER DRIVER (hptiop)
  2. Controller Register Map
  3. -------------------------
  4. For RR44xx Intel IOP based adapters, the controller IOP is accessed via PCI BAR0 and BAR2:
  5. BAR0 offset Register
  6. 0x11C5C Link Interface IRQ Set
  7. 0x11C60 Link Interface IRQ Clear
  8. BAR2 offset Register
  9. 0x10 Inbound Message Register 0
  10. 0x14 Inbound Message Register 1
  11. 0x18 Outbound Message Register 0
  12. 0x1C Outbound Message Register 1
  13. 0x20 Inbound Doorbell Register
  14. 0x24 Inbound Interrupt Status Register
  15. 0x28 Inbound Interrupt Mask Register
  16. 0x30 Outbound Interrupt Status Register
  17. 0x34 Outbound Interrupt Mask Register
  18. 0x40 Inbound Queue Port
  19. 0x44 Outbound Queue Port
  20. For Intel IOP based adapters, the controller IOP is accessed via PCI BAR0:
  21. BAR0 offset Register
  22. 0x10 Inbound Message Register 0
  23. 0x14 Inbound Message Register 1
  24. 0x18 Outbound Message Register 0
  25. 0x1C Outbound Message Register 1
  26. 0x20 Inbound Doorbell Register
  27. 0x24 Inbound Interrupt Status Register
  28. 0x28 Inbound Interrupt Mask Register
  29. 0x30 Outbound Interrupt Status Register
  30. 0x34 Outbound Interrupt Mask Register
  31. 0x40 Inbound Queue Port
  32. 0x44 Outbound Queue Port
  33. For Marvell not Frey IOP based adapters, the IOP is accessed via PCI BAR0 and BAR1:
  34. BAR0 offset Register
  35. 0x20400 Inbound Doorbell Register
  36. 0x20404 Inbound Interrupt Mask Register
  37. 0x20408 Outbound Doorbell Register
  38. 0x2040C Outbound Interrupt Mask Register
  39. BAR1 offset Register
  40. 0x0 Inbound Queue Head Pointer
  41. 0x4 Inbound Queue Tail Pointer
  42. 0x8 Outbound Queue Head Pointer
  43. 0xC Outbound Queue Tail Pointer
  44. 0x10 Inbound Message Register
  45. 0x14 Outbound Message Register
  46. 0x40-0x1040 Inbound Queue
  47. 0x1040-0x2040 Outbound Queue
  48. For Marvell Frey IOP based adapters, the IOP is accessed via PCI BAR0 and BAR1:
  49. BAR0 offset Register
  50. 0x0 IOP configuration information.
  51. BAR1 offset Register
  52. 0x4000 Inbound List Base Address Low
  53. 0x4004 Inbound List Base Address High
  54. 0x4018 Inbound List Write Pointer
  55. 0x402C Inbound List Configuration and Control
  56. 0x4050 Outbound List Base Address Low
  57. 0x4054 Outbound List Base Address High
  58. 0x4058 Outbound List Copy Pointer Shadow Base Address Low
  59. 0x405C Outbound List Copy Pointer Shadow Base Address High
  60. 0x4088 Outbound List Interrupt Cause
  61. 0x408C Outbound List Interrupt Enable
  62. 0x1020C PCIe Function 0 Interrupt Enable
  63. 0x10400 PCIe Function 0 to CPU Message A
  64. 0x10420 CPU to PCIe Function 0 Message A
  65. 0x10480 CPU to PCIe Function 0 Doorbell
  66. 0x10484 CPU to PCIe Function 0 Doorbell Enable
  67. I/O Request Workflow of Not Marvell Frey
  68. ------------------------------------------
  69. All queued requests are handled via inbound/outbound queue port.
  70. A request packet can be allocated in either IOP or host memory.
  71. To send a request to the controller:
  72. - Get a free request packet by reading the inbound queue port or
  73. allocate a free request in host DMA coherent memory.
  74. The value returned from the inbound queue port is an offset
  75. relative to the IOP BAR0.
  76. Requests allocated in host memory must be aligned on 32-bytes boundary.
  77. - Fill the packet.
  78. - Post the packet to IOP by writing it to inbound queue. For requests
  79. allocated in IOP memory, write the offset to inbound queue port. For
  80. requests allocated in host memory, write (0x80000000|(bus_addr>>5))
  81. to the inbound queue port.
  82. - The IOP process the request. When the request is completed, it
  83. will be put into outbound queue. An outbound interrupt will be
  84. generated.
  85. For requests allocated in IOP memory, the request offset is posted to
  86. outbound queue.
  87. For requests allocated in host memory, (0x80000000|(bus_addr>>5))
  88. is posted to the outbound queue. If IOP_REQUEST_FLAG_OUTPUT_CONTEXT
  89. flag is set in the request, the low 32-bit context value will be
  90. posted instead.
  91. - The host read the outbound queue and complete the request.
  92. For requests allocated in IOP memory, the host driver free the request
  93. by writing it to the outbound queue.
  94. Non-queued requests (reset/flush etc) can be sent via inbound message
  95. register 0. An outbound message with the same value indicates the completion
  96. of an inbound message.
  97. I/O Request Workflow of Marvell Frey
  98. --------------------------------------
  99. All queued requests are handled via inbound/outbound list.
  100. To send a request to the controller:
  101. - Allocate a free request in host DMA coherent memory.
  102. Requests allocated in host memory must be aligned on 32-bytes boundary.
  103. - Fill the request with index of the request in the flag.
  104. Fill a free inbound list unit with the physical address and the size of
  105. the request.
  106. Set up the inbound list write pointer with the index of previous unit,
  107. round to 0 if the index reaches the supported count of requests.
  108. - Post the inbound list writer pointer to IOP.
  109. - The IOP process the request. When the request is completed, the flag of
  110. the request with or-ed IOPMU_QUEUE_MASK_HOST_BITS will be put into a
  111. free outbound list unit and the index of the outbound list unit will be
  112. put into the copy pointer shadow register. An outbound interrupt will be
  113. generated.
  114. - The host read the outbound list copy pointer shadow register and compare
  115. with previous saved read pointer N. If they are different, the host will
  116. read the (N+1)th outbound list unit.
  117. The host get the index of the request from the (N+1)th outbound list
  118. unit and complete the request.
  119. Non-queued requests (reset communication/reset/flush etc) can be sent via PCIe
  120. Function 0 to CPU Message A register. The CPU to PCIe Function 0 Message register
  121. with the same value indicates the completion of message.
  122. User-level Interface
  123. ---------------------
  124. The driver exposes following sysfs attributes:
  125. NAME R/W Description
  126. driver-version R driver version string
  127. firmware-version R firmware version string
  128. -----------------------------------------------------------------------------
  129. Copyright (C) 2006-2012 HighPoint Technologies, Inc. All Rights Reserved.
  130. This file is distributed in the hope that it will be useful,
  131. but WITHOUT ANY WARRANTY; without even the implied warranty of
  132. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  133. GNU General Public License for more details.
  134. linux@highpoint-tech.com
  135. http://www.highpoint-tech.com