hw_peci.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. //*****************************************************************************
  2. //
  3. // hw_peci.h - Macros used when accessing the PECI hardware.
  4. //
  5. // Copyright (c) 2010-2011 Texas Instruments Incorporated. All rights reserved.
  6. // Software License Agreement
  7. //
  8. // Texas Instruments (TI) is supplying this software for use solely and
  9. // exclusively on TI's microcontroller products. The software is owned by
  10. // TI and/or its suppliers, and is protected under applicable copyright
  11. // laws. You may not combine this software with "viral" open-source
  12. // software in order to form a larger program.
  13. //
  14. // THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
  15. // NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
  16. // NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  17. // A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
  18. // CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
  19. // DAMAGES, FOR ANY REASON WHATSOEVER.
  20. //
  21. // This is part of revision 8264 of the Stellaris Firmware Development Package.
  22. //
  23. //*****************************************************************************
  24. #ifndef __HW_PECI_H__
  25. #define __HW_PECI_H__
  26. //*****************************************************************************
  27. //
  28. // The following are defines for the PECI register addresses.
  29. //
  30. //*****************************************************************************
  31. #define PECI_O_CTL 0x00000000 // PECI Control
  32. #define PECI_O_DIV 0x00000004 // PECI Poll-Rate Divider
  33. #define PECI_O_CMP 0x00000008 // PECI Comparator
  34. #define PECI_O_M0D0C 0x00000010 // PECI Microprocessor 0 / Domain 0
  35. // Control
  36. #define PECI_O_M0D1C 0x00000014 // PECI Microprocessor 0 / Domain 1
  37. // Control
  38. #define PECI_O_M1D0C 0x00000018 // PECI Microprocessor 1 / Domain 0
  39. // Control
  40. #define PECI_O_M1D1C 0x0000001C // PECI Microprocessor 1 / Domain 1
  41. // Control
  42. #define PECI_O_M0D0 0x00000040 // PECI Microprocessor 0 / Domain 0
  43. // Value
  44. #define PECI_O_M0D1 0x00000044 // PECI Microprocessor 0 / Domain 1
  45. // Value
  46. #define PECI_O_M1D0 0x00000048 // PECI Microprocessor 1 / Domain 0
  47. // Value
  48. #define PECI_O_M1D1 0x0000004C // PECI Microprocessor 1 / Domain 1
  49. // Value
  50. #define PECI_O_IM 0x00000080 // PECI Interrupt Mask
  51. #define PECI_O_RIS 0x00000084 // PECI Raw Interrupt Status
  52. #define PECI_O_MIS 0x00000088 // PECI Masked Interrupt Status
  53. #define PECI_O_IC 0x0000008C // PECI Interrupt Clear
  54. #define PECI_O_ACADDR 0x00000100 // PECI Advanced Command Address
  55. #define PECI_O_ACARG 0x00000104 // PECI Advanced Command Argument
  56. #define PECI_O_ACRDWR0 0x00000108 // PECI Advanced Command Data 0
  57. #define PECI_O_ACRDWR1 0x0000010C // PECI Advanced Command Data 1
  58. #define PECI_O_ACCMD 0x00000110 // PECI Advanced Command
  59. #define PECI_O_ACCODE 0x00000114 // PECI Advanced Command Completion
  60. // Code
  61. //*****************************************************************************
  62. //
  63. // The following are defines for the bit fields in the PECI_O_CTL register.
  64. //
  65. //*****************************************************************************
  66. #define PECI_CTL_OFFSET_M 0xFFFF0000 // Offset Value
  67. #define PECI_CTL_CRETRY_M 0x00007000 // Number of Controller Retries
  68. #define PECI_CTL_BYERR 0x00000800 // Number of Retries
  69. #define PECI_CTL_RXINV 0x00000400 // Invert PECI RX Input
  70. #define PECI_CTL_M1D1EN 0x00000008 // Enable Microprocessor 1 and
  71. // Domain 1
  72. #define PECI_CTL_M1D0EN 0x00000004 // Enable Microprocessor 1 and
  73. // Domain 0
  74. #define PECI_CTL_M0D1EN 0x00000002 // Enable Microprocessor 0 and
  75. // Domain 1
  76. #define PECI_CTL_M0D0EN 0x00000001 // Enable Microprocessor 0 and
  77. // Domain 0
  78. #define PECI_CTL_OFFSET_S 16
  79. #define PECI_CTL_CRETRY_S 12
  80. //*****************************************************************************
  81. //
  82. // The following are defines for the bit fields in the PECI_O_DIV register.
  83. //
  84. //*****************************************************************************
  85. #define PECI_DIV_BAUD_M 0xFFFF0000 // Initial Baud Rate
  86. #define PECI_DIV_POLL_M 0x0000FFFF // Counter for Inter-Poll Delay
  87. #define PECI_DIV_BAUD_S 16
  88. #define PECI_DIV_POLL_S 0
  89. //*****************************************************************************
  90. //
  91. // The following are defines for the bit fields in the PECI_O_CMP register.
  92. //
  93. //*****************************************************************************
  94. #define PECI_CMP_VREF_M 0x00000007 // Resistor Ladder Voltage Ref
  95. #define PECI_CMP_VREF_0_5000V 0x00000000 // 0.5000
  96. #define PECI_CMP_VREF_0_5125V 0x00000001 // 0.5125
  97. #define PECI_CMP_VREF_0_5250V 0x00000002 // 0.5250
  98. #define PECI_CMP_VREF_0_5375V 0x00000003 // 0.5375
  99. #define PECI_CMP_VREF_0_5500V 0x00000004 // 0.5500
  100. #define PECI_CMP_VREF_0_5625V 0x00000005 // 0.5625
  101. #define PECI_CMP_VREF_0_6000V 0x00000006 // 0.6000
  102. #define PECI_CMP_VREF_0_6625V 0x00000007 // 0.6625
  103. //*****************************************************************************
  104. //
  105. // The following are defines for the bit fields in the PECI_O_M0D0C register.
  106. //
  107. //*****************************************************************************
  108. #define PECI_M0D0C_HITHR_M 0xFFFF0000 // High Threshold
  109. #define PECI_M0D0C_LOTHR_M 0x0000FFFF // Low Threshold
  110. #define PECI_M0D0C_HITHR_S 16
  111. #define PECI_M0D0C_LOTHR_S 0
  112. //*****************************************************************************
  113. //
  114. // The following are defines for the bit fields in the PECI_O_M0D1C register.
  115. //
  116. //*****************************************************************************
  117. #define PECI_M0D1C_HITHR_M 0xFFFF0000 // High Threshold
  118. #define PECI_M0D1C_LOTHR_M 0x0000FFFF // Low Threshold
  119. #define PECI_M0D1C_HITHR_S 16
  120. #define PECI_M0D1C_LOTHR_S 0
  121. //*****************************************************************************
  122. //
  123. // The following are defines for the bit fields in the PECI_O_M1D0C register.
  124. //
  125. //*****************************************************************************
  126. #define PECI_M1D0C_HITHR_M 0xFFFF0000 // High Threshold
  127. #define PECI_M1D0C_LOTHR_M 0x0000FFFF // Low Threshold
  128. #define PECI_M1D0C_HITHR_S 16
  129. #define PECI_M1D0C_LOTHR_S 0
  130. //*****************************************************************************
  131. //
  132. // The following are defines for the bit fields in the PECI_O_M1D1C register.
  133. //
  134. //*****************************************************************************
  135. #define PECI_M1D1C_HITHR_M 0xFFFF0000 // High Threshold
  136. #define PECI_M1D1C_LOTHR_M 0x0000FFFF // Low Threshold
  137. #define PECI_M1D1C_HITHR_S 16
  138. #define PECI_M1D1C_LOTHR_S 0
  139. //*****************************************************************************
  140. //
  141. // The following are defines for the bit fields in the PECI_O_M0D0 register.
  142. //
  143. //*****************************************************************************
  144. #define PECI_M0D0_MAXREAD_M 0xFFFF0000 // Highest Value Read
  145. #define PECI_M0D0_VALUE_M 0x0000FFFF // Last Value Read
  146. #define PECI_M0D0_VALUE_MCRCTX 0x000081F9 // Microprocessor abort CRC error
  147. // on transmitted data
  148. #define PECI_M0D0_VALUE_CRCRX 0x000081FA // CRC error on received data
  149. #define PECI_M0D0_VALUE_CRCTX 0x000081FB // CRC error on transmitted data
  150. #define PECI_M0D0_VALUE_NEG 0x000081FC // Negotiation error
  151. #define PECI_M0D0_VALUE_TO 0x000081FD // Timeout error
  152. #define PECI_M0D0_MAXREAD_S 16
  153. //*****************************************************************************
  154. //
  155. // The following are defines for the bit fields in the PECI_O_M0D1 register.
  156. //
  157. //*****************************************************************************
  158. #define PECI_M0D1_MAXREAD_M 0xFFFF0000 // Highest Value Read
  159. #define PECI_M0D1_VALUE_M 0x0000FFFF // Last Value Read
  160. #define PECI_M0D1_VALUE_MCRCTX 0x000081F9 // Microprocessor abort CRC error
  161. // on transmitted data
  162. #define PECI_M0D1_VALUE_CRCRX 0x000081FA // CRC error on received data
  163. #define PECI_M0D1_VALUE_CRCTX 0x000081FB // CRC error on transmitted data
  164. #define PECI_M0D1_VALUE_NEG 0x000081FC // Negotiation error
  165. #define PECI_M0D1_VALUE_TO 0x000081FD // Timeout error
  166. #define PECI_M0D1_MAXREAD_S 16
  167. //*****************************************************************************
  168. //
  169. // The following are defines for the bit fields in the PECI_O_M1D0 register.
  170. //
  171. //*****************************************************************************
  172. #define PECI_M1D0_MAXREAD_M 0xFFFF0000 // Highest Value Read
  173. #define PECI_M1D0_VALUE_M 0x0000FFFF // Last Value Read
  174. #define PECI_M1D0_VALUE_MCRCTX 0x000081F9 // Microprocessor abort CRC error
  175. // on transmitted data
  176. #define PECI_M1D0_VALUE_CRCRX 0x000081FA // CRC error on received data
  177. #define PECI_M1D0_VALUE_CRCTX 0x000081FB // CRC error on transmitted data
  178. #define PECI_M1D0_VALUE_NEG 0x000081FC // Negotiation error
  179. #define PECI_M1D0_VALUE_TO 0x000081FD // Timeout error
  180. #define PECI_M1D0_MAXREAD_S 16
  181. //*****************************************************************************
  182. //
  183. // The following are defines for the bit fields in the PECI_O_M1D1 register.
  184. //
  185. //*****************************************************************************
  186. #define PECI_M1D1_MAXREAD_M 0xFFFF0000 // Highest Value Read
  187. #define PECI_M1D1_VALUE_M 0x0000FFFF // Last Value Read
  188. #define PECI_M1D1_VALUE_MCRCTX 0x000081F9 // Microprocessor abort CRC error
  189. // on transmitted data
  190. #define PECI_M1D1_VALUE_CRCRX 0x000081FA // CRC error on received data
  191. #define PECI_M1D1_VALUE_CRCTX 0x000081FB // CRC error on transmitted data
  192. #define PECI_M1D1_VALUE_NEG 0x000081FC // Negotiation error
  193. #define PECI_M1D1_VALUE_TO 0x000081FD // Timeout error
  194. #define PECI_M1D1_MAXREAD_S 16
  195. //*****************************************************************************
  196. //
  197. // The following are defines for the bit fields in the PECI_O_IM register.
  198. //
  199. //*****************************************************************************
  200. #define PECI_IM_M1D1IM_M 0x00C00000 // Microprocessor 1 and Domain 1
  201. // Interrupt Mask
  202. #define PECI_IM_M1D1IM_HIGH 0x00400000 // Interrupt when value is above
  203. // high threshold
  204. #define PECI_IM_M1D1IM_CROSSUP 0x00800000 // Interrupt when crossing above
  205. // either threshold
  206. #define PECI_IM_M1D1IM_CROSSANY 0x00C00000 // Interrupt when crossing either
  207. // threshold in either direction
  208. #define PECI_IM_M1D0IM_M 0x00300000 // Microprocessor 1 and Domain 0
  209. // Interrupt Mask
  210. #define PECI_IM_M0D1IM_M 0x000C0000 // Microprocessor 0 and Domain 1
  211. // Interrupt Mask
  212. #define PECI_IM_M0D0IM_M 0x00030000 // Microprocessor 0 and Domain 0
  213. // Interrupt Mask
  214. #define PECI_IM_ACIM 0x00000004 // Advanced Command Interrupt Mask
  215. #define PECI_IM_ERRIM 0x00000002 // Error Detected Interrupt Mask
  216. #define PECI_IM_POLLIM 0x00000001 // Poll Completed Interrupt Mask
  217. #define PECI_IM_M1D0IM_S 20
  218. #define PECI_IM_M0D1IM_S 18
  219. #define PECI_IM_M0D0IM_S 16
  220. //*****************************************************************************
  221. //
  222. // The following are defines for the bit fields in the PECI_O_RIS register.
  223. //
  224. //*****************************************************************************
  225. #define PECI_RIS_M1D1RIS_M 0x00C00000 // Microprocessor 1 and Domain 1
  226. // Raw Interrupt Status
  227. #define PECI_RIS_M1D0RIS_M 0x00300000 // Microprocessor 1 and Domain 0
  228. // Raw Interrupt Status
  229. #define PECI_RIS_M0D1RIS_M 0x000C0000 // Microprocessor 0 and Domain 1
  230. // Raw Interrupt Status
  231. #define PECI_RIS_M0D0RIS_M 0x00030000 // Microprocessor 0 and Domain 0
  232. // Raw Interrupt Status
  233. #define PECI_RIS_ACRIS 0x00000004 // Advanced Command Raw Interrupt
  234. // Status
  235. #define PECI_RIS_ERRRIS 0x00000002 // Error Detected Raw Interrupt
  236. // Status
  237. #define PECI_RIS_POLLRIS 0x00000001 // Poll Completed Raw Interrupt
  238. // Status
  239. #define PECI_RIS_M1D1RIS_S 22
  240. #define PECI_RIS_M1D0RIS_S 20
  241. #define PECI_RIS_M0D1RIS_S 18
  242. #define PECI_RIS_M0D0RIS_S 16
  243. //*****************************************************************************
  244. //
  245. // The following are defines for the bit fields in the PECI_O_MIS register.
  246. //
  247. //*****************************************************************************
  248. #define PECI_MIS_M1D1MIS_M 0x00C00000 // Microprocessor 1 and Domain 1
  249. // Masked Interrupt Status
  250. #define PECI_MIS_M1D0MIS_M 0x00300000 // Microprocessor 1 and Domain 0
  251. // Masked Interrupt Status
  252. #define PECI_MIS_M0D1MIS_M 0x000C0000 // Microprocessor 0 and Domain 1
  253. // Masked Interrupt Status
  254. #define PECI_MIS_M0D0MIS_M 0x00030000 // Microprocessor 0 and Domain 0
  255. // Masked Interrupt Status
  256. #define PECI_MIS_ACMIS 0x00000004 // Advanced Command Masked
  257. // Interrupt Status
  258. #define PECI_MIS_ERRMIS 0x00000002 // Error Detected Masked Interrupt
  259. // Status
  260. #define PECI_MIS_POLLMIS 0x00000001 // Poll Completed Masked Interrupt
  261. // Status
  262. #define PECI_MIS_M1D1MIS_S 22
  263. #define PECI_MIS_M1D0MIS_S 20
  264. #define PECI_MIS_M0D1MIS_S 18
  265. #define PECI_MIS_M0D0MIS_S 16
  266. //*****************************************************************************
  267. //
  268. // The following are defines for the bit fields in the PECI_O_IC register.
  269. //
  270. //*****************************************************************************
  271. #define PECI_IC_M1D1IC_M 0x00C00000 // Microprocessor 1 and Domain 1
  272. // Interrupt Clear
  273. #define PECI_IC_M1D0IC_M 0x00300000 // Microprocessor 1 and Domain 0
  274. // Interrupt Clear
  275. #define PECI_IC_M0D1IC_M 0x000C0000 // Microprocessor 0 and Domain 1
  276. // Interrupt Clear
  277. #define PECI_IC_M0D0IC_M 0x00030000 // Microprocessor 0 and Domain 0
  278. // Interrupt Clear
  279. #define PECI_IC_ACIC 0x00000004 // Advanced Command Interrupt Clear
  280. #define PECI_IC_ERRIC 0x00000002 // Error Detected Interrupt Clear
  281. #define PECI_IC_POLLIC 0x00000001 // Poll Completed Interrupt Clear
  282. #define PECI_IC_M1D1IC_S 22
  283. #define PECI_IC_M1D0IC_S 20
  284. #define PECI_IC_M0D1IC_S 18
  285. #define PECI_IC_M0D0IC_S 16
  286. //*****************************************************************************
  287. //
  288. // The following are defines for the bit fields in the PECI_O_ACADDR register.
  289. //
  290. //*****************************************************************************
  291. #define PECI_ACADDR_HIDRE_M 0xFF000000 // HostID and Retry
  292. #define PECI_ACADDR_SIZE_M 0x00FF0000 // Size Override
  293. #define PECI_ACADDR_DOMAIN_M 0x0000FF00 // Domain Select
  294. #define PECI_ACADDR_PROCADD_M 0x000000FF // Processor Address
  295. #define PECI_ACADDR_HIDRE_S 24
  296. #define PECI_ACADDR_SIZE_S 16
  297. #define PECI_ACADDR_DOMAIN_S 8
  298. #define PECI_ACADDR_PROCADD_S 0
  299. //*****************************************************************************
  300. //
  301. // The following are defines for the bit fields in the PECI_O_ACARG register.
  302. //
  303. //*****************************************************************************
  304. #define PECI_ACARG_ARG3_M 0xFF000000 // Argument 3
  305. #define PECI_ACARG_ARG2_M 0x00FF0000 // Argument 2
  306. #define PECI_ACARG_ARG1_M 0x0000FF00 // Argument 1
  307. #define PECI_ACARG_ARG0_M 0x000000FF // Argument 0
  308. #define PECI_ACARG_ARG3_S 24
  309. #define PECI_ACARG_ARG2_S 16
  310. #define PECI_ACARG_ARG1_S 8
  311. #define PECI_ACARG_ARG0_S 0
  312. //*****************************************************************************
  313. //
  314. // The following are defines for the bit fields in the PECI_O_ACRDWR0 register.
  315. //
  316. //*****************************************************************************
  317. #define PECI_ACRDWR0_D3_M 0xFF000000 // Data 3
  318. #define PECI_ACRDWR0_D2_M 0x00FF0000 // Data 2
  319. #define PECI_ACRDWR0_D1_M 0x0000FF00 // Data 1
  320. #define PECI_ACRDWR0_D0_M 0x000000FF // Data 0
  321. #define PECI_ACRDWR0_D3_S 24
  322. #define PECI_ACRDWR0_D2_S 16
  323. #define PECI_ACRDWR0_D1_S 8
  324. #define PECI_ACRDWR0_D0_S 0
  325. //*****************************************************************************
  326. //
  327. // The following are defines for the bit fields in the PECI_O_ACRDWR1 register.
  328. //
  329. //*****************************************************************************
  330. #define PECI_ACRDWR1_D3_M 0xFF000000 // Data 3
  331. #define PECI_ACRDWR1_D2_M 0x00FF0000 // Data 2
  332. #define PECI_ACRDWR1_D1_M 0x0000FF00 // Data 1
  333. #define PECI_ACRDWR1_D0_M 0x000000FF // Data 0
  334. #define PECI_ACRDWR1_D3_S 24
  335. #define PECI_ACRDWR1_D2_S 16
  336. #define PECI_ACRDWR1_D1_S 8
  337. #define PECI_ACRDWR1_D0_S 0
  338. //*****************************************************************************
  339. //
  340. // The following are defines for the bit fields in the PECI_O_ACCMD register.
  341. //
  342. //*****************************************************************************
  343. #define PECI_ACCMD_CMD_M 0x000000FF // Base Command
  344. #define PECI_ACCMD_CMD_S 0
  345. //*****************************************************************************
  346. //
  347. // The following are defines for the bit fields in the PECI_O_ACCODE register.
  348. //
  349. //*****************************************************************************
  350. #define PECI_ACCODE_CODE_M 0xFFFFFFFF // Signed Completion Code
  351. #endif // __HW_PECI_H__