scu_event_codes.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. /*
  2. * This file is provided under a dual BSD/GPLv2 license. When using or
  3. * redistributing this file, you may do so under either license.
  4. *
  5. * GPL LICENSE SUMMARY
  6. *
  7. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of version 2 of the GNU General Public License as
  11. * published by the Free Software Foundation.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  21. * The full GNU General Public License is included in this distribution
  22. * in the file called LICENSE.GPL.
  23. *
  24. * BSD LICENSE
  25. *
  26. * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
  27. * All rights reserved.
  28. *
  29. * Redistribution and use in source and binary forms, with or without
  30. * modification, are permitted provided that the following conditions
  31. * are met:
  32. *
  33. * * Redistributions of source code must retain the above copyright
  34. * notice, this list of conditions and the following disclaimer.
  35. * * Redistributions in binary form must reproduce the above copyright
  36. * notice, this list of conditions and the following disclaimer in
  37. * the documentation and/or other materials provided with the
  38. * distribution.
  39. * * Neither the name of Intel Corporation nor the names of its
  40. * contributors may be used to endorse or promote products derived
  41. * from this software without specific prior written permission.
  42. *
  43. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  44. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  45. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  46. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  47. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  48. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  49. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  50. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  51. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  52. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  53. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  54. */
  55. #ifndef __SCU_EVENT_CODES_HEADER__
  56. #define __SCU_EVENT_CODES_HEADER__
  57. /**
  58. * This file contains the constants and macros for the SCU event codes.
  59. *
  60. *
  61. */
  62. #define SCU_EVENT_TYPE_CODE_SHIFT 24
  63. #define SCU_EVENT_TYPE_CODE_MASK 0x0F000000
  64. #define SCU_EVENT_SPECIFIC_CODE_SHIFT 18
  65. #define SCU_EVENT_SPECIFIC_CODE_MASK 0x00FC0000
  66. #define SCU_EVENT_CODE_MASK \
  67. (SCU_EVENT_TYPE_CODE_MASK | SCU_EVENT_SPECIFIC_CODE_MASK)
  68. /**
  69. * SCU_EVENT_TYPE() -
  70. *
  71. * This macro constructs an SCU event type from the type value.
  72. */
  73. #define SCU_EVENT_TYPE(type) \
  74. ((u32)(type) << SCU_EVENT_TYPE_CODE_SHIFT)
  75. /**
  76. * SCU_EVENT_SPECIFIC() -
  77. *
  78. * This macro constructs an SCU event specifier from the code value.
  79. */
  80. #define SCU_EVENT_SPECIFIC(code) \
  81. ((u32)(code) << SCU_EVENT_SPECIFIC_CODE_SHIFT)
  82. /**
  83. * SCU_EVENT_MESSAGE() -
  84. *
  85. * This macro constructs a combines an SCU event type and SCU event specifier
  86. * from the type and code values.
  87. */
  88. #define SCU_EVENT_MESSAGE(type, code) \
  89. ((type) | SCU_EVENT_SPECIFIC(code))
  90. /**
  91. * SCU_EVENT_TYPE() -
  92. *
  93. * SCU_EVENT_TYPES
  94. */
  95. #define SCU_EVENT_TYPE_SMU_COMMAND_ERROR SCU_EVENT_TYPE(0x08)
  96. #define SCU_EVENT_TYPE_SMU_PCQ_ERROR SCU_EVENT_TYPE(0x09)
  97. #define SCU_EVENT_TYPE_SMU_ERROR SCU_EVENT_TYPE(0x00)
  98. #define SCU_EVENT_TYPE_TRANSPORT_ERROR SCU_EVENT_TYPE(0x01)
  99. #define SCU_EVENT_TYPE_BROADCAST_CHANGE SCU_EVENT_TYPE(0x02)
  100. #define SCU_EVENT_TYPE_OSSP_EVENT SCU_EVENT_TYPE(0x03)
  101. #define SCU_EVENT_TYPE_FATAL_MEMORY_ERROR SCU_EVENT_TYPE(0x0F)
  102. #define SCU_EVENT_TYPE_RNC_SUSPEND_TX SCU_EVENT_TYPE(0x04)
  103. #define SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX SCU_EVENT_TYPE(0x05)
  104. #define SCU_EVENT_TYPE_RNC_OPS_MISC SCU_EVENT_TYPE(0x06)
  105. #define SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT SCU_EVENT_TYPE(0x07)
  106. #define SCU_EVENT_TYPE_ERR_CNT_EVENT SCU_EVENT_TYPE(0x0A)
  107. /**
  108. *
  109. *
  110. * SCU_EVENT_SPECIFIERS
  111. */
  112. #define SCU_EVENT_SPECIFIER_DRIVER_SUSPEND 0x20
  113. #define SCU_EVENT_SPECIFIER_RNC_RELEASE 0x00
  114. /**
  115. *
  116. *
  117. * SMU_COMMAND_EVENTS
  118. */
  119. #define SCU_EVENT_INVALID_CONTEXT_COMMAND \
  120. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_SMU_COMMAND_ERROR, 0x00)
  121. /**
  122. *
  123. *
  124. * SMU_PCQ_EVENTS
  125. */
  126. #define SCU_EVENT_UNCORRECTABLE_PCQ_ERROR \
  127. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_SMU_PCQ_ERROR, 0x00)
  128. /**
  129. *
  130. *
  131. * SMU_EVENTS
  132. */
  133. #define SCU_EVENT_UNCORRECTABLE_REGISTER_WRITE \
  134. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_SMU_ERROR, 0x02)
  135. #define SCU_EVENT_UNCORRECTABLE_REGISTER_READ \
  136. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_SMU_ERROR, 0x03)
  137. #define SCU_EVENT_PCIE_INTERFACE_ERROR \
  138. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_SMU_ERROR, 0x04)
  139. #define SCU_EVENT_FUNCTION_LEVEL_RESET \
  140. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_SMU_ERROR, 0x05)
  141. /**
  142. *
  143. *
  144. * TRANSPORT_LEVEL_ERRORS
  145. */
  146. #define SCU_EVENT_ACK_NAK_TIMEOUT_ERROR \
  147. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_TRANSPORT_ERROR, 0x00)
  148. /**
  149. *
  150. *
  151. * BROADCAST_CHANGE_EVENTS
  152. */
  153. #define SCU_EVENT_BROADCAST_CHANGE \
  154. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x01)
  155. #define SCU_EVENT_BROADCAST_RESERVED0 \
  156. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x02)
  157. #define SCU_EVENT_BROADCAST_RESERVED1 \
  158. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x03)
  159. #define SCU_EVENT_BROADCAST_SES \
  160. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x04)
  161. #define SCU_EVENT_BROADCAST_EXPANDER \
  162. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x05)
  163. #define SCU_EVENT_BROADCAST_AEN \
  164. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x06)
  165. #define SCU_EVENT_BROADCAST_RESERVED3 \
  166. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x07)
  167. #define SCU_EVENT_BROADCAST_RESERVED4 \
  168. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x08)
  169. #define SCU_EVENT_PE_SUSPENDED \
  170. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_BROADCAST_CHANGE, 0x09)
  171. /**
  172. *
  173. *
  174. * OSSP_EVENTS
  175. */
  176. #define SCU_EVENT_PORT_SELECTOR_DETECTED \
  177. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x10)
  178. #define SCU_EVENT_SENT_PORT_SELECTION \
  179. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x11)
  180. #define SCU_EVENT_HARD_RESET_TRANSMITTED \
  181. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x12)
  182. #define SCU_EVENT_HARD_RESET_RECEIVED \
  183. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x13)
  184. #define SCU_EVENT_RECEIVED_IDENTIFY_TIMEOUT \
  185. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x15)
  186. #define SCU_EVENT_LINK_FAILURE \
  187. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x16)
  188. #define SCU_EVENT_SATA_SPINUP_HOLD \
  189. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x17)
  190. #define SCU_EVENT_SAS_15_SSC \
  191. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x18)
  192. #define SCU_EVENT_SAS_15 \
  193. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x19)
  194. #define SCU_EVENT_SAS_30_SSC \
  195. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x1A)
  196. #define SCU_EVENT_SAS_30 \
  197. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x1B)
  198. #define SCU_EVENT_SAS_60_SSC \
  199. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x1C)
  200. #define SCU_EVENT_SAS_60 \
  201. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x1D)
  202. #define SCU_EVENT_SATA_15_SSC \
  203. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x1E)
  204. #define SCU_EVENT_SATA_15 \
  205. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x1F)
  206. #define SCU_EVENT_SATA_30_SSC \
  207. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x20)
  208. #define SCU_EVENT_SATA_30 \
  209. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x21)
  210. #define SCU_EVENT_SATA_60_SSC \
  211. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x22)
  212. #define SCU_EVENT_SATA_60 \
  213. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x23)
  214. #define SCU_EVENT_SAS_PHY_DETECTED \
  215. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x24)
  216. #define SCU_EVENT_SATA_PHY_DETECTED \
  217. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_OSSP_EVENT, 0x25)
  218. /**
  219. *
  220. *
  221. * FATAL_INTERNAL_MEMORY_ERROR_EVENTS
  222. */
  223. #define SCU_EVENT_TSC_RNSC_UNCORRECTABLE_ERROR \
  224. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_FATAL_MEMORY_ERROR, 0x00)
  225. #define SCU_EVENT_TC_RNC_UNCORRECTABLE_ERROR \
  226. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_FATAL_MEMORY_ERROR, 0x01)
  227. #define SCU_EVENT_ZPT_UNCORRECTABLE_ERROR \
  228. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_FATAL_MEMORY_ERROR, 0x02)
  229. /**
  230. *
  231. *
  232. * REMOTE_NODE_SUSPEND_EVENTS
  233. */
  234. #define SCU_EVENT_TL_RNC_SUSPEND_TX \
  235. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_SUSPEND_TX, 0x00)
  236. #define SCU_EVENT_TL_RNC_SUSPEND_TX_RX \
  237. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX, 0x00)
  238. #define SCU_EVENT_DRIVER_POST_RNC_SUSPEND_TX \
  239. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_SUSPEND_TX, 0x20)
  240. #define SCU_EVENT_DRIVER_POST_RNC_SUSPEND_TX_RX \
  241. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_SUSPEND_TX_RX, 0x20)
  242. /**
  243. *
  244. *
  245. * REMOTE_NODE_MISC_EVENTS
  246. */
  247. #define SCU_EVENT_POST_RCN_RELEASE \
  248. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_OPS_MISC, SCU_EVENT_SPECIFIER_RNC_RELEASE)
  249. #define SCU_EVENT_POST_IT_NEXUS_LOSS_TIMER_ENABLE \
  250. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_OPS_MISC, 0x01)
  251. #define SCU_EVENT_POST_IT_NEXUS_LOSS_TIMER_DISABLE \
  252. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_OPS_MISC, 0x02)
  253. #define SCU_EVENT_POST_RNC_COMPLETE \
  254. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_OPS_MISC, 0x03)
  255. #define SCU_EVENT_POST_RNC_INVALIDATE_COMPLETE \
  256. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_RNC_OPS_MISC, 0x04)
  257. /**
  258. *
  259. *
  260. * ERROR_COUNT_EVENT
  261. */
  262. #define SCU_EVENT_RX_CREDIT_BLOCKED_RECEIVED \
  263. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_ERR_CNT_EVENT, 0x00)
  264. #define SCU_EVENT_TX_DONE_CREDIT_TIMEOUT \
  265. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_ERR_CNT_EVENT, 0x01)
  266. #define SCU_EVENT_RX_DONE_CREDIT_TIMEOUT \
  267. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_ERR_CNT_EVENT, 0x02)
  268. /**
  269. * scu_get_event_type() -
  270. *
  271. * This macro returns the SCU event type from the event code.
  272. */
  273. #define scu_get_event_type(event_code) \
  274. ((event_code) & SCU_EVENT_TYPE_CODE_MASK)
  275. /**
  276. * scu_get_event_specifier() -
  277. *
  278. * This macro returns the SCU event specifier from the event code.
  279. */
  280. #define scu_get_event_specifier(event_code) \
  281. ((event_code) & SCU_EVENT_SPECIFIC_CODE_MASK)
  282. /**
  283. * scu_get_event_code() -
  284. *
  285. * This macro returns the combined SCU event type and SCU event specifier from
  286. * the event code.
  287. */
  288. #define scu_get_event_code(event_code) \
  289. ((event_code) & SCU_EVENT_CODE_MASK)
  290. /**
  291. *
  292. *
  293. * PTS_SCHEDULE_EVENT
  294. */
  295. #define SCU_EVENT_SMP_RESPONSE_NO_PE \
  296. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT, 0x00)
  297. #define SCU_EVENT_SPECIFIC_SMP_RESPONSE_NO_PE \
  298. scu_get_event_specifier(SCU_EVENT_SMP_RESPONSE_NO_PE)
  299. #define SCU_EVENT_TASK_TIMEOUT \
  300. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT, 0x01)
  301. #define SCU_EVENT_SPECIFIC_TASK_TIMEOUT \
  302. scu_get_event_specifier(SCU_EVENT_TASK_TIMEOUT)
  303. #define SCU_EVENT_IT_NEXUS_TIMEOUT \
  304. SCU_EVENT_MESSAGE(SCU_EVENT_TYPE_PTX_SCHEDULE_EVENT, 0x02)
  305. #define SCU_EVENT_SPECIFIC_IT_NEXUS_TIMEOUT \
  306. scu_get_event_specifier(SCU_EVENT_IT_NEXUS_TIMEOUT)
  307. #endif /* __SCU_EVENT_CODES_HEADER__ */