dra752-bandgap.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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_CUMUL_DTEMP_CORE_OFFSET 0x1c4
  53. #define DRA752_DTEMP_CORE_0_OFFSET 0x208
  54. #define DRA752_DTEMP_CORE_1_OFFSET 0x20c
  55. #define DRA752_DTEMP_CORE_2_OFFSET 0x210
  56. #define DRA752_DTEMP_CORE_3_OFFSET 0x214
  57. #define DRA752_DTEMP_CORE_4_OFFSET 0x218
  58. /* DRA752.iva register offsets */
  59. #define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET 0x388
  60. #define DRA752_TEMP_SENSOR_IVA_OFFSET 0x398
  61. #define DRA752_BANDGAP_THRESHOLD_IVA_OFFSET 0x3a4
  62. #define DRA752_BANDGAP_CUMUL_DTEMP_IVA_OFFSET 0x3b4
  63. #define DRA752_DTEMP_IVA_0_OFFSET 0x3d0
  64. #define DRA752_DTEMP_IVA_1_OFFSET 0x3d4
  65. #define DRA752_DTEMP_IVA_2_OFFSET 0x3d8
  66. #define DRA752_DTEMP_IVA_3_OFFSET 0x3dc
  67. #define DRA752_DTEMP_IVA_4_OFFSET 0x3e0
  68. /* DRA752.mpu register offsets */
  69. #define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET 0x4
  70. #define DRA752_TEMP_SENSOR_MPU_OFFSET 0x14c
  71. #define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET 0x1a4
  72. #define DRA752_BANDGAP_CUMUL_DTEMP_MPU_OFFSET 0x1bc
  73. #define DRA752_DTEMP_MPU_0_OFFSET 0x1e0
  74. #define DRA752_DTEMP_MPU_1_OFFSET 0x1e4
  75. #define DRA752_DTEMP_MPU_2_OFFSET 0x1e8
  76. #define DRA752_DTEMP_MPU_3_OFFSET 0x1ec
  77. #define DRA752_DTEMP_MPU_4_OFFSET 0x1f0
  78. /* DRA752.dspeve register offsets */
  79. #define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET 0x384
  80. #define DRA752_TEMP_SENSOR_DSPEVE_OFFSET 0x394
  81. #define DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET 0x3a0
  82. #define DRA752_BANDGAP_CUMUL_DTEMP_DSPEVE_OFFSET 0x3b0
  83. #define DRA752_DTEMP_DSPEVE_0_OFFSET 0x3bc
  84. #define DRA752_DTEMP_DSPEVE_1_OFFSET 0x3c0
  85. #define DRA752_DTEMP_DSPEVE_2_OFFSET 0x3c4
  86. #define DRA752_DTEMP_DSPEVE_3_OFFSET 0x3c8
  87. #define DRA752_DTEMP_DSPEVE_4_OFFSET 0x3cc
  88. /* DRA752.gpu register offsets */
  89. #define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET 0x0
  90. #define DRA752_TEMP_SENSOR_GPU_OFFSET 0x150
  91. #define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET 0x1a8
  92. #define DRA752_BANDGAP_CUMUL_DTEMP_GPU_OFFSET 0x1c0
  93. #define DRA752_DTEMP_GPU_0_OFFSET 0x1f4
  94. #define DRA752_DTEMP_GPU_1_OFFSET 0x1f8
  95. #define DRA752_DTEMP_GPU_2_OFFSET 0x1fc
  96. #define DRA752_DTEMP_GPU_3_OFFSET 0x200
  97. #define DRA752_DTEMP_GPU_4_OFFSET 0x204
  98. /**
  99. * Register bitfields for DRA752
  100. *
  101. * All the macros bellow define the required bits for
  102. * controlling temperature on DRA752. Bit defines are
  103. * grouped by register.
  104. */
  105. /* DRA752.BANDGAP_STATUS_1 */
  106. #define DRA752_BANDGAP_STATUS_1_ALERT_MASK BIT(31)
  107. #define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK BIT(5)
  108. #define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK BIT(4)
  109. #define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK BIT(3)
  110. #define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK BIT(2)
  111. #define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK BIT(1)
  112. #define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK BIT(0)
  113. /* DRA752.BANDGAP_CTRL_2 */
  114. #define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK BIT(22)
  115. #define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK BIT(21)
  116. #define DRA752_BANDGAP_CTRL_2_CLEAR_IVA_MASK BIT(19)
  117. #define DRA752_BANDGAP_CTRL_2_CLEAR_DSPEVE_MASK BIT(18)
  118. #define DRA752_BANDGAP_CTRL_2_CLEAR_ACCUM_IVA_MASK BIT(16)
  119. #define DRA752_BANDGAP_CTRL_2_CLEAR_ACCUM_DSPEVE_MASK BIT(15)
  120. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK BIT(3)
  121. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK BIT(2)
  122. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK BIT(1)
  123. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK BIT(0)
  124. /* DRA752.BANDGAP_STATUS_2 */
  125. #define DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK BIT(3)
  126. #define DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK BIT(2)
  127. #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK BIT(1)
  128. #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK BIT(0)
  129. /* DRA752.BANDGAP_CTRL_1 */
  130. #define DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK (0x3 << 30)
  131. #define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK (0x7 << 27)
  132. #define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK BIT(23)
  133. #define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK BIT(22)
  134. #define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK BIT(21)
  135. #define DRA752_BANDGAP_CTRL_1_CLEAR_CORE_MASK BIT(20)
  136. #define DRA752_BANDGAP_CTRL_1_CLEAR_GPU_MASK BIT(19)
  137. #define DRA752_BANDGAP_CTRL_1_CLEAR_MPU_MASK BIT(18)
  138. #define DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_CORE_MASK BIT(17)
  139. #define DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_GPU_MASK BIT(16)
  140. #define DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_MPU_MASK BIT(15)
  141. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK BIT(5)
  142. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK BIT(4)
  143. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK BIT(3)
  144. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK BIT(2)
  145. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK BIT(1)
  146. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK BIT(0)
  147. /* DRA752.TEMP_SENSOR */
  148. #define DRA752_TEMP_SENSOR_TMPSOFF_MASK BIT(11)
  149. #define DRA752_TEMP_SENSOR_EOCZ_MASK BIT(10)
  150. #define DRA752_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  151. /* DRA752.BANDGAP_THRESHOLD */
  152. #define DRA752_BANDGAP_THRESHOLD_HOT_MASK (0x3ff << 16)
  153. #define DRA752_BANDGAP_THRESHOLD_COLD_MASK (0x3ff << 0)
  154. /* DRA752.BANDGAP_CUMUL_DTEMP_CORE */
  155. #define DRA752_BANDGAP_CUMUL_DTEMP_CORE_MASK (0xffffffff << 0)
  156. /* DRA752.BANDGAP_CUMUL_DTEMP_IVA */
  157. #define DRA752_BANDGAP_CUMUL_DTEMP_IVA_MASK (0xffffffff << 0)
  158. /* DRA752.BANDGAP_CUMUL_DTEMP_MPU */
  159. #define DRA752_BANDGAP_CUMUL_DTEMP_MPU_MASK (0xffffffff << 0)
  160. /* DRA752.BANDGAP_CUMUL_DTEMP_DSPEVE */
  161. #define DRA752_BANDGAP_CUMUL_DTEMP_DSPEVE_MASK (0xffffffff << 0)
  162. /* DRA752.BANDGAP_CUMUL_DTEMP_GPU */
  163. #define DRA752_BANDGAP_CUMUL_DTEMP_GPU_MASK (0xffffffff << 0)
  164. /**
  165. * Temperature limits and thresholds for DRA752
  166. *
  167. * All the macros bellow are definitions for handling the
  168. * ADC conversions and representation of temperature limits
  169. * and thresholds for DRA752. Definitions are grouped
  170. * by temperature domain.
  171. */
  172. /* DRA752.common temperature definitions */
  173. /* ADC conversion table limits */
  174. #define DRA752_ADC_START_VALUE 540
  175. #define DRA752_ADC_END_VALUE 945
  176. /* DRA752.GPU temperature definitions */
  177. /* bandgap clock limits */
  178. #define DRA752_GPU_MAX_FREQ 1500000
  179. #define DRA752_GPU_MIN_FREQ 1000000
  180. /* sensor limits */
  181. #define DRA752_GPU_MIN_TEMP -40000
  182. #define DRA752_GPU_MAX_TEMP 125000
  183. #define DRA752_GPU_HYST_VAL 5000
  184. /* interrupts thresholds */
  185. #define DRA752_GPU_T_HOT 800
  186. #define DRA752_GPU_T_COLD 795
  187. /* DRA752.MPU temperature definitions */
  188. /* bandgap clock limits */
  189. #define DRA752_MPU_MAX_FREQ 1500000
  190. #define DRA752_MPU_MIN_FREQ 1000000
  191. /* sensor limits */
  192. #define DRA752_MPU_MIN_TEMP -40000
  193. #define DRA752_MPU_MAX_TEMP 125000
  194. #define DRA752_MPU_HYST_VAL 5000
  195. /* interrupts thresholds */
  196. #define DRA752_MPU_T_HOT 800
  197. #define DRA752_MPU_T_COLD 795
  198. /* DRA752.CORE temperature definitions */
  199. /* bandgap clock limits */
  200. #define DRA752_CORE_MAX_FREQ 1500000
  201. #define DRA752_CORE_MIN_FREQ 1000000
  202. /* sensor limits */
  203. #define DRA752_CORE_MIN_TEMP -40000
  204. #define DRA752_CORE_MAX_TEMP 125000
  205. #define DRA752_CORE_HYST_VAL 5000
  206. /* interrupts thresholds */
  207. #define DRA752_CORE_T_HOT 800
  208. #define DRA752_CORE_T_COLD 795
  209. /* DRA752.DSPEVE temperature definitions */
  210. /* bandgap clock limits */
  211. #define DRA752_DSPEVE_MAX_FREQ 1500000
  212. #define DRA752_DSPEVE_MIN_FREQ 1000000
  213. /* sensor limits */
  214. #define DRA752_DSPEVE_MIN_TEMP -40000
  215. #define DRA752_DSPEVE_MAX_TEMP 125000
  216. #define DRA752_DSPEVE_HYST_VAL 5000
  217. /* interrupts thresholds */
  218. #define DRA752_DSPEVE_T_HOT 800
  219. #define DRA752_DSPEVE_T_COLD 795
  220. /* DRA752.IVA temperature definitions */
  221. /* bandgap clock limits */
  222. #define DRA752_IVA_MAX_FREQ 1500000
  223. #define DRA752_IVA_MIN_FREQ 1000000
  224. /* sensor limits */
  225. #define DRA752_IVA_MIN_TEMP -40000
  226. #define DRA752_IVA_MAX_TEMP 125000
  227. #define DRA752_IVA_HYST_VAL 5000
  228. /* interrupts thresholds */
  229. #define DRA752_IVA_T_HOT 800
  230. #define DRA752_IVA_T_COLD 795
  231. #endif /* __DRA752_BANDGAP_H */