dra752-bandgap.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /*
  2. * DRA752 bandgap registers, bitfields and temperature definitions
  3. *
  4. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  5. * Contact:
  6. * Eduardo Valentin <eduardo.valentin@ti.com>
  7. * Tero Kristo <t-kristo@ti.com>
  8. *
  9. * This is an auto generated file.
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * version 2 as published by the Free Software Foundation.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  23. * 02110-1301 USA
  24. *
  25. */
  26. #ifndef __DRA752_BANDGAP_H
  27. #define __DRA752_BANDGAP_H
  28. /**
  29. * *** DRA752 ***
  30. *
  31. * Below, in sequence, are the Register definitions,
  32. * the bitfields and the temperature definitions for DRA752.
  33. */
  34. /**
  35. * DRA752 register definitions
  36. *
  37. * Registers are defined as offsets. The offsets are
  38. * relative to FUSE_OPP_BGAP_GPU on DRA752.
  39. * DRA752_BANDGAP_BASE 0x4a0021e0
  40. *
  41. * Register below are grouped by domain (not necessarily in offset order)
  42. */
  43. /* DRA752.common register offsets */
  44. #define DRA752_BANDGAP_CTRL_1_OFFSET 0x1a0
  45. #define DRA752_BANDGAP_STATUS_1_OFFSET 0x1c8
  46. #define DRA752_BANDGAP_CTRL_2_OFFSET 0x39c
  47. #define DRA752_BANDGAP_STATUS_2_OFFSET 0x3b8
  48. /* DRA752.core register offsets */
  49. #define DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET 0x8
  50. #define DRA752_TEMP_SENSOR_CORE_OFFSET 0x154
  51. #define DRA752_BANDGAP_THRESHOLD_CORE_OFFSET 0x1ac
  52. #define DRA752_BANDGAP_TSHUT_CORE_OFFSET 0x1b8
  53. #define DRA752_BANDGAP_CUMUL_DTEMP_CORE_OFFSET 0x1c4
  54. #define DRA752_DTEMP_CORE_0_OFFSET 0x208
  55. #define DRA752_DTEMP_CORE_1_OFFSET 0x20c
  56. #define DRA752_DTEMP_CORE_2_OFFSET 0x210
  57. #define DRA752_DTEMP_CORE_3_OFFSET 0x214
  58. #define DRA752_DTEMP_CORE_4_OFFSET 0x218
  59. /* DRA752.iva register offsets */
  60. #define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET 0x388
  61. #define DRA752_TEMP_SENSOR_IVA_OFFSET 0x398
  62. #define DRA752_BANDGAP_THRESHOLD_IVA_OFFSET 0x3a4
  63. #define DRA752_BANDGAP_TSHUT_IVA_OFFSET 0x3ac
  64. #define DRA752_BANDGAP_CUMUL_DTEMP_IVA_OFFSET 0x3b4
  65. #define DRA752_DTEMP_IVA_0_OFFSET 0x3d0
  66. #define DRA752_DTEMP_IVA_1_OFFSET 0x3d4
  67. #define DRA752_DTEMP_IVA_2_OFFSET 0x3d8
  68. #define DRA752_DTEMP_IVA_3_OFFSET 0x3dc
  69. #define DRA752_DTEMP_IVA_4_OFFSET 0x3e0
  70. /* DRA752.mpu register offsets */
  71. #define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET 0x4
  72. #define DRA752_TEMP_SENSOR_MPU_OFFSET 0x14c
  73. #define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET 0x1a4
  74. #define DRA752_BANDGAP_TSHUT_MPU_OFFSET 0x1b0
  75. #define DRA752_BANDGAP_CUMUL_DTEMP_MPU_OFFSET 0x1bc
  76. #define DRA752_DTEMP_MPU_0_OFFSET 0x1e0
  77. #define DRA752_DTEMP_MPU_1_OFFSET 0x1e4
  78. #define DRA752_DTEMP_MPU_2_OFFSET 0x1e8
  79. #define DRA752_DTEMP_MPU_3_OFFSET 0x1ec
  80. #define DRA752_DTEMP_MPU_4_OFFSET 0x1f0
  81. /* DRA752.dspeve register offsets */
  82. #define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET 0x384
  83. #define DRA752_TEMP_SENSOR_DSPEVE_OFFSET 0x394
  84. #define DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET 0x3a0
  85. #define DRA752_BANDGAP_TSHUT_DSPEVE_OFFSET 0x3a8
  86. #define DRA752_BANDGAP_CUMUL_DTEMP_DSPEVE_OFFSET 0x3b0
  87. #define DRA752_DTEMP_DSPEVE_0_OFFSET 0x3bc
  88. #define DRA752_DTEMP_DSPEVE_1_OFFSET 0x3c0
  89. #define DRA752_DTEMP_DSPEVE_2_OFFSET 0x3c4
  90. #define DRA752_DTEMP_DSPEVE_3_OFFSET 0x3c8
  91. #define DRA752_DTEMP_DSPEVE_4_OFFSET 0x3cc
  92. /* DRA752.gpu register offsets */
  93. #define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET 0x0
  94. #define DRA752_TEMP_SENSOR_GPU_OFFSET 0x150
  95. #define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET 0x1a8
  96. #define DRA752_BANDGAP_TSHUT_GPU_OFFSET 0x1b4
  97. #define DRA752_BANDGAP_CUMUL_DTEMP_GPU_OFFSET 0x1c0
  98. #define DRA752_DTEMP_GPU_0_OFFSET 0x1f4
  99. #define DRA752_DTEMP_GPU_1_OFFSET 0x1f8
  100. #define DRA752_DTEMP_GPU_2_OFFSET 0x1fc
  101. #define DRA752_DTEMP_GPU_3_OFFSET 0x200
  102. #define DRA752_DTEMP_GPU_4_OFFSET 0x204
  103. /**
  104. * Register bitfields for DRA752
  105. *
  106. * All the macros bellow define the required bits for
  107. * controlling temperature on DRA752. Bit defines are
  108. * grouped by register.
  109. */
  110. /* DRA752.BANDGAP_STATUS_1 */
  111. #define DRA752_BANDGAP_STATUS_1_ALERT_MASK BIT(31)
  112. #define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK BIT(5)
  113. #define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK BIT(4)
  114. #define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK BIT(3)
  115. #define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK BIT(2)
  116. #define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK BIT(1)
  117. #define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK BIT(0)
  118. /* DRA752.BANDGAP_CTRL_2 */
  119. #define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK BIT(22)
  120. #define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK BIT(21)
  121. #define DRA752_BANDGAP_CTRL_2_CLEAR_IVA_MASK BIT(19)
  122. #define DRA752_BANDGAP_CTRL_2_CLEAR_DSPEVE_MASK BIT(18)
  123. #define DRA752_BANDGAP_CTRL_2_CLEAR_ACCUM_IVA_MASK BIT(16)
  124. #define DRA752_BANDGAP_CTRL_2_CLEAR_ACCUM_DSPEVE_MASK BIT(15)
  125. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK BIT(3)
  126. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK BIT(2)
  127. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK BIT(1)
  128. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK BIT(0)
  129. /* DRA752.BANDGAP_STATUS_2 */
  130. #define DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK BIT(3)
  131. #define DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK BIT(2)
  132. #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK BIT(1)
  133. #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK BIT(0)
  134. /* DRA752.BANDGAP_CTRL_1 */
  135. #define DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK (0x3 << 30)
  136. #define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK (0x7 << 27)
  137. #define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK BIT(23)
  138. #define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK BIT(22)
  139. #define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK BIT(21)
  140. #define DRA752_BANDGAP_CTRL_1_CLEAR_CORE_MASK BIT(20)
  141. #define DRA752_BANDGAP_CTRL_1_CLEAR_GPU_MASK BIT(19)
  142. #define DRA752_BANDGAP_CTRL_1_CLEAR_MPU_MASK BIT(18)
  143. #define DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_CORE_MASK BIT(17)
  144. #define DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_GPU_MASK BIT(16)
  145. #define DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_MPU_MASK BIT(15)
  146. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK BIT(5)
  147. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK BIT(4)
  148. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK BIT(3)
  149. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK BIT(2)
  150. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK BIT(1)
  151. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK BIT(0)
  152. /* DRA752.TEMP_SENSOR */
  153. #define DRA752_TEMP_SENSOR_TMPSOFF_MASK BIT(11)
  154. #define DRA752_TEMP_SENSOR_EOCZ_MASK BIT(10)
  155. #define DRA752_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  156. /* DRA752.BANDGAP_THRESHOLD */
  157. #define DRA752_BANDGAP_THRESHOLD_HOT_MASK (0x3ff << 16)
  158. #define DRA752_BANDGAP_THRESHOLD_COLD_MASK (0x3ff << 0)
  159. /* DRA752.TSHUT_THRESHOLD */
  160. #define DRA752_TSHUT_THRESHOLD_MUXCTRL_MASK BIT(31)
  161. #define DRA752_TSHUT_THRESHOLD_HOT_MASK (0x3ff << 16)
  162. #define DRA752_TSHUT_THRESHOLD_COLD_MASK (0x3ff << 0)
  163. /* DRA752.BANDGAP_CUMUL_DTEMP_CORE */
  164. #define DRA752_BANDGAP_CUMUL_DTEMP_CORE_MASK (0xffffffff << 0)
  165. /* DRA752.BANDGAP_CUMUL_DTEMP_IVA */
  166. #define DRA752_BANDGAP_CUMUL_DTEMP_IVA_MASK (0xffffffff << 0)
  167. /* DRA752.BANDGAP_CUMUL_DTEMP_MPU */
  168. #define DRA752_BANDGAP_CUMUL_DTEMP_MPU_MASK (0xffffffff << 0)
  169. /* DRA752.BANDGAP_CUMUL_DTEMP_DSPEVE */
  170. #define DRA752_BANDGAP_CUMUL_DTEMP_DSPEVE_MASK (0xffffffff << 0)
  171. /* DRA752.BANDGAP_CUMUL_DTEMP_GPU */
  172. #define DRA752_BANDGAP_CUMUL_DTEMP_GPU_MASK (0xffffffff << 0)
  173. /**
  174. * Temperature limits and thresholds for DRA752
  175. *
  176. * All the macros bellow are definitions for handling the
  177. * ADC conversions and representation of temperature limits
  178. * and thresholds for DRA752. Definitions are grouped
  179. * by temperature domain.
  180. */
  181. /* DRA752.common temperature definitions */
  182. /* ADC conversion table limits */
  183. #define DRA752_ADC_START_VALUE 540
  184. #define DRA752_ADC_END_VALUE 945
  185. /* DRA752.GPU temperature definitions */
  186. /* bandgap clock limits */
  187. #define DRA752_GPU_MAX_FREQ 1500000
  188. #define DRA752_GPU_MIN_FREQ 1000000
  189. /* sensor limits */
  190. #define DRA752_GPU_MIN_TEMP -40000
  191. #define DRA752_GPU_MAX_TEMP 125000
  192. #define DRA752_GPU_HYST_VAL 5000
  193. /* interrupts thresholds */
  194. #define DRA752_GPU_TSHUT_HOT 915
  195. #define DRA752_GPU_TSHUT_COLD 900
  196. #define DRA752_GPU_T_HOT 800
  197. #define DRA752_GPU_T_COLD 795
  198. /* DRA752.MPU temperature definitions */
  199. /* bandgap clock limits */
  200. #define DRA752_MPU_MAX_FREQ 1500000
  201. #define DRA752_MPU_MIN_FREQ 1000000
  202. /* sensor limits */
  203. #define DRA752_MPU_MIN_TEMP -40000
  204. #define DRA752_MPU_MAX_TEMP 125000
  205. #define DRA752_MPU_HYST_VAL 5000
  206. /* interrupts thresholds */
  207. #define DRA752_MPU_TSHUT_HOT 915
  208. #define DRA752_MPU_TSHUT_COLD 900
  209. #define DRA752_MPU_T_HOT 800
  210. #define DRA752_MPU_T_COLD 795
  211. /* DRA752.CORE temperature definitions */
  212. /* bandgap clock limits */
  213. #define DRA752_CORE_MAX_FREQ 1500000
  214. #define DRA752_CORE_MIN_FREQ 1000000
  215. /* sensor limits */
  216. #define DRA752_CORE_MIN_TEMP -40000
  217. #define DRA752_CORE_MAX_TEMP 125000
  218. #define DRA752_CORE_HYST_VAL 5000
  219. /* interrupts thresholds */
  220. #define DRA752_CORE_TSHUT_HOT 915
  221. #define DRA752_CORE_TSHUT_COLD 900
  222. #define DRA752_CORE_T_HOT 800
  223. #define DRA752_CORE_T_COLD 795
  224. /* DRA752.DSPEVE temperature definitions */
  225. /* bandgap clock limits */
  226. #define DRA752_DSPEVE_MAX_FREQ 1500000
  227. #define DRA752_DSPEVE_MIN_FREQ 1000000
  228. /* sensor limits */
  229. #define DRA752_DSPEVE_MIN_TEMP -40000
  230. #define DRA752_DSPEVE_MAX_TEMP 125000
  231. #define DRA752_DSPEVE_HYST_VAL 5000
  232. /* interrupts thresholds */
  233. #define DRA752_DSPEVE_TSHUT_HOT 915
  234. #define DRA752_DSPEVE_TSHUT_COLD 900
  235. #define DRA752_DSPEVE_T_HOT 800
  236. #define DRA752_DSPEVE_T_COLD 795
  237. /* DRA752.IVA temperature definitions */
  238. /* bandgap clock limits */
  239. #define DRA752_IVA_MAX_FREQ 1500000
  240. #define DRA752_IVA_MIN_FREQ 1000000
  241. /* sensor limits */
  242. #define DRA752_IVA_MIN_TEMP -40000
  243. #define DRA752_IVA_MAX_TEMP 125000
  244. #define DRA752_IVA_HYST_VAL 5000
  245. /* interrupts thresholds */
  246. #define DRA752_IVA_TSHUT_HOT 915
  247. #define DRA752_IVA_TSHUT_COLD 900
  248. #define DRA752_IVA_T_HOT 800
  249. #define DRA752_IVA_T_COLD 795
  250. #endif /* __DRA752_BANDGAP_H */