dra752-thermal-data.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483
  1. /*
  2. * DRA752 thermal data.
  3. *
  4. * Copyright (C) 2013 Texas Instruments Inc.
  5. * Contact:
  6. * Eduardo Valentin <eduardo.valentin@ti.com>
  7. * Tero Kristo <t-kristo@ti.com>
  8. *
  9. * This file is partially autogenerated.
  10. *
  11. * This software is licensed under the terms of the GNU General Public
  12. * License version 2, as published by the Free Software Foundation, and
  13. * may be copied, distributed, and modified under those terms.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. */
  21. #include "ti-thermal.h"
  22. #include "ti-bandgap.h"
  23. #include "dra752-bandgap.h"
  24. /*
  25. * DRA752 has five instances of thermal sensor: MPU, GPU, CORE,
  26. * IVA and DSPEVE need to describe the individual registers and
  27. * bit fields.
  28. */
  29. /*
  30. * DRA752 CORE thermal sensor register offsets and bit-fields
  31. */
  32. static struct temp_sensor_registers
  33. dra752_core_temp_sensor_registers = {
  34. .temp_sensor_ctrl = DRA752_TEMP_SENSOR_CORE_OFFSET,
  35. .bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
  36. .bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
  37. .bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
  38. .bgap_mask_ctrl = DRA752_BANDGAP_CTRL_1_OFFSET,
  39. .mask_hot_mask = DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK,
  40. .mask_cold_mask = DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK,
  41. .mask_sidlemode_mask = DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK,
  42. .mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
  43. .mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK,
  44. .mask_clear_mask = DRA752_BANDGAP_CTRL_1_CLEAR_CORE_MASK,
  45. .mask_clear_accum_mask = DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_CORE_MASK,
  46. .bgap_threshold = DRA752_BANDGAP_THRESHOLD_CORE_OFFSET,
  47. .threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
  48. .threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
  49. .tshut_threshold = DRA752_BANDGAP_TSHUT_CORE_OFFSET,
  50. .tshut_hot_mask = DRA752_TSHUT_THRESHOLD_HOT_MASK,
  51. .tshut_cold_mask = DRA752_TSHUT_THRESHOLD_COLD_MASK,
  52. .bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
  53. .status_bgap_alert_mask = DRA752_BANDGAP_STATUS_1_ALERT_MASK,
  54. .status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK,
  55. .status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK,
  56. .bgap_cumul_dtemp = DRA752_BANDGAP_CUMUL_DTEMP_CORE_OFFSET,
  57. .ctrl_dtemp_0 = DRA752_DTEMP_CORE_0_OFFSET,
  58. .ctrl_dtemp_1 = DRA752_DTEMP_CORE_1_OFFSET,
  59. .ctrl_dtemp_2 = DRA752_DTEMP_CORE_2_OFFSET,
  60. .ctrl_dtemp_3 = DRA752_DTEMP_CORE_3_OFFSET,
  61. .ctrl_dtemp_4 = DRA752_DTEMP_CORE_4_OFFSET,
  62. .bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET,
  63. };
  64. /*
  65. * DRA752 IVA thermal sensor register offsets and bit-fields
  66. */
  67. static struct temp_sensor_registers
  68. dra752_iva_temp_sensor_registers = {
  69. .temp_sensor_ctrl = DRA752_TEMP_SENSOR_IVA_OFFSET,
  70. .bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
  71. .bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
  72. .bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
  73. .bgap_mask_ctrl = DRA752_BANDGAP_CTRL_2_OFFSET,
  74. .mask_hot_mask = DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK,
  75. .mask_cold_mask = DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK,
  76. .mask_sidlemode_mask = DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK,
  77. .mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
  78. .mask_freeze_mask = DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK,
  79. .mask_clear_mask = DRA752_BANDGAP_CTRL_2_CLEAR_IVA_MASK,
  80. .mask_clear_accum_mask = DRA752_BANDGAP_CTRL_2_CLEAR_ACCUM_IVA_MASK,
  81. .bgap_threshold = DRA752_BANDGAP_THRESHOLD_IVA_OFFSET,
  82. .threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
  83. .threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
  84. .tshut_threshold = DRA752_BANDGAP_TSHUT_IVA_OFFSET,
  85. .tshut_hot_mask = DRA752_TSHUT_THRESHOLD_HOT_MASK,
  86. .tshut_cold_mask = DRA752_TSHUT_THRESHOLD_COLD_MASK,
  87. .bgap_status = DRA752_BANDGAP_STATUS_2_OFFSET,
  88. .status_bgap_alert_mask = DRA752_BANDGAP_STATUS_1_ALERT_MASK,
  89. .status_hot_mask = DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK,
  90. .status_cold_mask = DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK,
  91. .bgap_cumul_dtemp = DRA752_BANDGAP_CUMUL_DTEMP_IVA_OFFSET,
  92. .ctrl_dtemp_0 = DRA752_DTEMP_IVA_0_OFFSET,
  93. .ctrl_dtemp_1 = DRA752_DTEMP_IVA_1_OFFSET,
  94. .ctrl_dtemp_2 = DRA752_DTEMP_IVA_2_OFFSET,
  95. .ctrl_dtemp_3 = DRA752_DTEMP_IVA_3_OFFSET,
  96. .ctrl_dtemp_4 = DRA752_DTEMP_IVA_4_OFFSET,
  97. .bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET,
  98. };
  99. /*
  100. * DRA752 MPU thermal sensor register offsets and bit-fields
  101. */
  102. static struct temp_sensor_registers
  103. dra752_mpu_temp_sensor_registers = {
  104. .temp_sensor_ctrl = DRA752_TEMP_SENSOR_MPU_OFFSET,
  105. .bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
  106. .bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
  107. .bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
  108. .bgap_mask_ctrl = DRA752_BANDGAP_CTRL_1_OFFSET,
  109. .mask_hot_mask = DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK,
  110. .mask_cold_mask = DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK,
  111. .mask_sidlemode_mask = DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK,
  112. .mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
  113. .mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK,
  114. .mask_clear_mask = DRA752_BANDGAP_CTRL_1_CLEAR_MPU_MASK,
  115. .mask_clear_accum_mask = DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_MPU_MASK,
  116. .bgap_threshold = DRA752_BANDGAP_THRESHOLD_MPU_OFFSET,
  117. .threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
  118. .threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
  119. .tshut_threshold = DRA752_BANDGAP_TSHUT_MPU_OFFSET,
  120. .tshut_hot_mask = DRA752_TSHUT_THRESHOLD_HOT_MASK,
  121. .tshut_cold_mask = DRA752_TSHUT_THRESHOLD_COLD_MASK,
  122. .bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
  123. .status_bgap_alert_mask = DRA752_BANDGAP_STATUS_1_ALERT_MASK,
  124. .status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK,
  125. .status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK,
  126. .bgap_cumul_dtemp = DRA752_BANDGAP_CUMUL_DTEMP_MPU_OFFSET,
  127. .ctrl_dtemp_0 = DRA752_DTEMP_MPU_0_OFFSET,
  128. .ctrl_dtemp_1 = DRA752_DTEMP_MPU_1_OFFSET,
  129. .ctrl_dtemp_2 = DRA752_DTEMP_MPU_2_OFFSET,
  130. .ctrl_dtemp_3 = DRA752_DTEMP_MPU_3_OFFSET,
  131. .ctrl_dtemp_4 = DRA752_DTEMP_MPU_4_OFFSET,
  132. .bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET,
  133. };
  134. /*
  135. * DRA752 DSPEVE thermal sensor register offsets and bit-fields
  136. */
  137. static struct temp_sensor_registers
  138. dra752_dspeve_temp_sensor_registers = {
  139. .temp_sensor_ctrl = DRA752_TEMP_SENSOR_DSPEVE_OFFSET,
  140. .bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
  141. .bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
  142. .bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
  143. .bgap_mask_ctrl = DRA752_BANDGAP_CTRL_2_OFFSET,
  144. .mask_hot_mask = DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK,
  145. .mask_cold_mask = DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK,
  146. .mask_sidlemode_mask = DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK,
  147. .mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
  148. .mask_freeze_mask = DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK,
  149. .mask_clear_mask = DRA752_BANDGAP_CTRL_2_CLEAR_DSPEVE_MASK,
  150. .mask_clear_accum_mask = DRA752_BANDGAP_CTRL_2_CLEAR_ACCUM_DSPEVE_MASK,
  151. .bgap_threshold = DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET,
  152. .threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
  153. .threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
  154. .tshut_threshold = DRA752_BANDGAP_TSHUT_DSPEVE_OFFSET,
  155. .tshut_hot_mask = DRA752_TSHUT_THRESHOLD_HOT_MASK,
  156. .tshut_cold_mask = DRA752_TSHUT_THRESHOLD_COLD_MASK,
  157. .bgap_status = DRA752_BANDGAP_STATUS_2_OFFSET,
  158. .status_bgap_alert_mask = DRA752_BANDGAP_STATUS_1_ALERT_MASK,
  159. .status_hot_mask = DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK,
  160. .status_cold_mask = DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK,
  161. .bgap_cumul_dtemp = DRA752_BANDGAP_CUMUL_DTEMP_DSPEVE_OFFSET,
  162. .ctrl_dtemp_0 = DRA752_DTEMP_DSPEVE_0_OFFSET,
  163. .ctrl_dtemp_1 = DRA752_DTEMP_DSPEVE_1_OFFSET,
  164. .ctrl_dtemp_2 = DRA752_DTEMP_DSPEVE_2_OFFSET,
  165. .ctrl_dtemp_3 = DRA752_DTEMP_DSPEVE_3_OFFSET,
  166. .ctrl_dtemp_4 = DRA752_DTEMP_DSPEVE_4_OFFSET,
  167. .bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET,
  168. };
  169. /*
  170. * DRA752 GPU thermal sensor register offsets and bit-fields
  171. */
  172. static struct temp_sensor_registers
  173. dra752_gpu_temp_sensor_registers = {
  174. .temp_sensor_ctrl = DRA752_TEMP_SENSOR_GPU_OFFSET,
  175. .bgap_tempsoff_mask = DRA752_TEMP_SENSOR_TMPSOFF_MASK,
  176. .bgap_eocz_mask = DRA752_TEMP_SENSOR_EOCZ_MASK,
  177. .bgap_dtemp_mask = DRA752_TEMP_SENSOR_DTEMP_MASK,
  178. .bgap_mask_ctrl = DRA752_BANDGAP_CTRL_1_OFFSET,
  179. .mask_hot_mask = DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK,
  180. .mask_cold_mask = DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK,
  181. .mask_sidlemode_mask = DRA752_BANDGAP_CTRL_1_SIDLEMODE_MASK,
  182. .mask_counter_delay_mask = DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK,
  183. .mask_freeze_mask = DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK,
  184. .mask_clear_mask = DRA752_BANDGAP_CTRL_1_CLEAR_GPU_MASK,
  185. .mask_clear_accum_mask = DRA752_BANDGAP_CTRL_1_CLEAR_ACCUM_GPU_MASK,
  186. .bgap_threshold = DRA752_BANDGAP_THRESHOLD_GPU_OFFSET,
  187. .threshold_thot_mask = DRA752_BANDGAP_THRESHOLD_HOT_MASK,
  188. .threshold_tcold_mask = DRA752_BANDGAP_THRESHOLD_COLD_MASK,
  189. .tshut_threshold = DRA752_BANDGAP_TSHUT_GPU_OFFSET,
  190. .tshut_hot_mask = DRA752_TSHUT_THRESHOLD_HOT_MASK,
  191. .tshut_cold_mask = DRA752_TSHUT_THRESHOLD_COLD_MASK,
  192. .bgap_status = DRA752_BANDGAP_STATUS_1_OFFSET,
  193. .status_bgap_alert_mask = DRA752_BANDGAP_STATUS_1_ALERT_MASK,
  194. .status_hot_mask = DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK,
  195. .status_cold_mask = DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK,
  196. .bgap_cumul_dtemp = DRA752_BANDGAP_CUMUL_DTEMP_GPU_OFFSET,
  197. .ctrl_dtemp_0 = DRA752_DTEMP_GPU_0_OFFSET,
  198. .ctrl_dtemp_1 = DRA752_DTEMP_GPU_1_OFFSET,
  199. .ctrl_dtemp_2 = DRA752_DTEMP_GPU_2_OFFSET,
  200. .ctrl_dtemp_3 = DRA752_DTEMP_GPU_3_OFFSET,
  201. .ctrl_dtemp_4 = DRA752_DTEMP_GPU_4_OFFSET,
  202. .bgap_efuse = DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET,
  203. };
  204. /* Thresholds and limits for DRA752 MPU temperature sensor */
  205. static struct temp_sensor_data dra752_mpu_temp_sensor_data = {
  206. .tshut_hot = DRA752_MPU_TSHUT_HOT,
  207. .tshut_cold = DRA752_MPU_TSHUT_COLD,
  208. .t_hot = DRA752_MPU_T_HOT,
  209. .t_cold = DRA752_MPU_T_COLD,
  210. .min_freq = DRA752_MPU_MIN_FREQ,
  211. .max_freq = DRA752_MPU_MAX_FREQ,
  212. .max_temp = DRA752_MPU_MAX_TEMP,
  213. .min_temp = DRA752_MPU_MIN_TEMP,
  214. .hyst_val = DRA752_MPU_HYST_VAL,
  215. .update_int1 = 1000,
  216. .update_int2 = 2000,
  217. };
  218. /* Thresholds and limits for DRA752 GPU temperature sensor */
  219. static struct temp_sensor_data dra752_gpu_temp_sensor_data = {
  220. .tshut_hot = DRA752_GPU_TSHUT_HOT,
  221. .tshut_cold = DRA752_GPU_TSHUT_COLD,
  222. .t_hot = DRA752_GPU_T_HOT,
  223. .t_cold = DRA752_GPU_T_COLD,
  224. .min_freq = DRA752_GPU_MIN_FREQ,
  225. .max_freq = DRA752_GPU_MAX_FREQ,
  226. .max_temp = DRA752_GPU_MAX_TEMP,
  227. .min_temp = DRA752_GPU_MIN_TEMP,
  228. .hyst_val = DRA752_GPU_HYST_VAL,
  229. .update_int1 = 1000,
  230. .update_int2 = 2000,
  231. };
  232. /* Thresholds and limits for DRA752 CORE temperature sensor */
  233. static struct temp_sensor_data dra752_core_temp_sensor_data = {
  234. .tshut_hot = DRA752_CORE_TSHUT_HOT,
  235. .tshut_cold = DRA752_CORE_TSHUT_COLD,
  236. .t_hot = DRA752_CORE_T_HOT,
  237. .t_cold = DRA752_CORE_T_COLD,
  238. .min_freq = DRA752_CORE_MIN_FREQ,
  239. .max_freq = DRA752_CORE_MAX_FREQ,
  240. .max_temp = DRA752_CORE_MAX_TEMP,
  241. .min_temp = DRA752_CORE_MIN_TEMP,
  242. .hyst_val = DRA752_CORE_HYST_VAL,
  243. .update_int1 = 1000,
  244. .update_int2 = 2000,
  245. };
  246. /* Thresholds and limits for DRA752 DSPEVE temperature sensor */
  247. static struct temp_sensor_data dra752_dspeve_temp_sensor_data = {
  248. .tshut_hot = DRA752_DSPEVE_TSHUT_HOT,
  249. .tshut_cold = DRA752_DSPEVE_TSHUT_COLD,
  250. .t_hot = DRA752_DSPEVE_T_HOT,
  251. .t_cold = DRA752_DSPEVE_T_COLD,
  252. .min_freq = DRA752_DSPEVE_MIN_FREQ,
  253. .max_freq = DRA752_DSPEVE_MAX_FREQ,
  254. .max_temp = DRA752_DSPEVE_MAX_TEMP,
  255. .min_temp = DRA752_DSPEVE_MIN_TEMP,
  256. .hyst_val = DRA752_DSPEVE_HYST_VAL,
  257. .update_int1 = 1000,
  258. .update_int2 = 2000,
  259. };
  260. /* Thresholds and limits for DRA752 IVA temperature sensor */
  261. static struct temp_sensor_data dra752_iva_temp_sensor_data = {
  262. .tshut_hot = DRA752_IVA_TSHUT_HOT,
  263. .tshut_cold = DRA752_IVA_TSHUT_COLD,
  264. .t_hot = DRA752_IVA_T_HOT,
  265. .t_cold = DRA752_IVA_T_COLD,
  266. .min_freq = DRA752_IVA_MIN_FREQ,
  267. .max_freq = DRA752_IVA_MAX_FREQ,
  268. .max_temp = DRA752_IVA_MAX_TEMP,
  269. .min_temp = DRA752_IVA_MIN_TEMP,
  270. .hyst_val = DRA752_IVA_HYST_VAL,
  271. .update_int1 = 1000,
  272. .update_int2 = 2000,
  273. };
  274. /*
  275. * DRA752 : Temperature values in milli degree celsius
  276. * ADC code values from 540 to 945
  277. */
  278. static
  279. int dra752_adc_to_temp[DRA752_ADC_END_VALUE - DRA752_ADC_START_VALUE + 1] = {
  280. /* Index 540 - 549 */
  281. -40000, -40000, -40000, -40000, -39800, -39400, -39000, -38600, -38200,
  282. -37800,
  283. /* Index 550 - 559 */
  284. -37400, -37000, -36600, -36200, -35800, -35300, -34700, -34200, -33800,
  285. -33400,
  286. /* Index 560 - 569 */
  287. -33000, -32600, -32200, -31800, -31400, -31000, -30600, -30200, -29800,
  288. -29400,
  289. /* Index 570 - 579 */
  290. -29000, -28600, -28200, -27700, -27100, -26600, -26200, -25800, -25400,
  291. -25000,
  292. /* Index 580 - 589 */
  293. -24600, -24200, -23800, -23400, -23000, -22600, -22200, -21800, -21400,
  294. -21000,
  295. /* Index 590 - 599 */
  296. -20500, -19900, -19400, -19000, -18600, -18200, -17800, -17400, -17000,
  297. -16600,
  298. /* Index 600 - 609 */
  299. -16200, -15800, -15400, -15000, -14600, -14200, -13800, -13400, -13000,
  300. -12500,
  301. /* Index 610 - 619 */
  302. -11900, -11400, -11000, -10600, -10200, -9800, -9400, -9000, -8600,
  303. -8200,
  304. /* Index 620 - 629 */
  305. -7800, -7400, -7000, -6600, -6200, -5800, -5400, -5000, -4500,
  306. -3900,
  307. /* Index 630 - 639 */
  308. -3400, -3000, -2600, -2200, -1800, -1400, -1000, -600, -200,
  309. 200,
  310. /* Index 640 - 649 */
  311. 600, 1000, 1400, 1800, 2200, 2600, 3000, 3400, 3900,
  312. 4500,
  313. /* Index 650 - 659 */
  314. 5000, 5400, 5800, 6200, 6600, 7000, 7400, 7800, 8200,
  315. 8600,
  316. /* Index 660 - 669 */
  317. 9000, 9400, 9800, 10200, 10600, 11000, 11400, 11800, 12200,
  318. 12700,
  319. /* Index 670 - 679 */
  320. 13300, 13800, 14200, 14600, 15000, 15400, 15800, 16200, 16600,
  321. 17000,
  322. /* Index 680 - 689 */
  323. 17400, 17800, 18200, 18600, 19000, 19400, 19800, 20200, 20600,
  324. 21000,
  325. /* Index 690 - 699 */
  326. 21400, 21900, 22500, 23000, 23400, 23800, 24200, 24600, 25000,
  327. 25400,
  328. /* Index 700 - 709 */
  329. 25800, 26200, 26600, 27000, 27400, 27800, 28200, 28600, 29000,
  330. 29400,
  331. /* Index 710 - 719 */
  332. 29800, 30200, 30600, 31000, 31400, 31900, 32500, 33000, 33400,
  333. 33800,
  334. /* Index 720 - 729 */
  335. 34200, 34600, 35000, 35400, 35800, 36200, 36600, 37000, 37400,
  336. 37800,
  337. /* Index 730 - 739 */
  338. 38200, 38600, 39000, 39400, 39800, 40200, 40600, 41000, 41400,
  339. 41800,
  340. /* Index 740 - 749 */
  341. 42200, 42600, 43100, 43700, 44200, 44600, 45000, 45400, 45800,
  342. 46200,
  343. /* Index 750 - 759 */
  344. 46600, 47000, 47400, 47800, 48200, 48600, 49000, 49400, 49800,
  345. 50200,
  346. /* Index 760 - 769 */
  347. 50600, 51000, 51400, 51800, 52200, 52600, 53000, 53400, 53800,
  348. 54200,
  349. /* Index 770 - 779 */
  350. 54600, 55000, 55400, 55900, 56500, 57000, 57400, 57800, 58200,
  351. 58600,
  352. /* Index 780 - 789 */
  353. 59000, 59400, 59800, 60200, 60600, 61000, 61400, 61800, 62200,
  354. 62600,
  355. /* Index 790 - 799 */
  356. 63000, 63400, 63800, 64200, 64600, 65000, 65400, 65800, 66200,
  357. 66600,
  358. /* Index 800 - 809 */
  359. 67000, 67400, 67800, 68200, 68600, 69000, 69400, 69800, 70200,
  360. 70600,
  361. /* Index 810 - 819 */
  362. 71000, 71500, 72100, 72600, 73000, 73400, 73800, 74200, 74600,
  363. 75000,
  364. /* Index 820 - 829 */
  365. 75400, 75800, 76200, 76600, 77000, 77400, 77800, 78200, 78600,
  366. 79000,
  367. /* Index 830 - 839 */
  368. 79400, 79800, 80200, 80600, 81000, 81400, 81800, 82200, 82600,
  369. 83000,
  370. /* Index 840 - 849 */
  371. 83400, 83800, 84200, 84600, 85000, 85400, 85800, 86200, 86600,
  372. 87000,
  373. /* Index 850 - 859 */
  374. 87400, 87800, 88200, 88600, 89000, 89400, 89800, 90200, 90600,
  375. 91000,
  376. /* Index 860 - 869 */
  377. 91400, 91800, 92200, 92600, 93000, 93400, 93800, 94200, 94600,
  378. 95000,
  379. /* Index 870 - 879 */
  380. 95400, 95800, 96200, 96600, 97000, 97500, 98100, 98600, 99000,
  381. 99400,
  382. /* Index 880 - 889 */
  383. 99800, 100200, 100600, 101000, 101400, 101800, 102200, 102600, 103000,
  384. 103400,
  385. /* Index 890 - 899 */
  386. 103800, 104200, 104600, 105000, 105400, 105800, 106200, 106600, 107000,
  387. 107400,
  388. /* Index 900 - 909 */
  389. 107800, 108200, 108600, 109000, 109400, 109800, 110200, 110600, 111000,
  390. 111400,
  391. /* Index 910 - 919 */
  392. 111800, 112200, 112600, 113000, 113400, 113800, 114200, 114600, 115000,
  393. 115400,
  394. /* Index 920 - 929 */
  395. 115800, 116200, 116600, 117000, 117400, 117800, 118200, 118600, 119000,
  396. 119400,
  397. /* Index 930 - 939 */
  398. 119800, 120200, 120600, 121000, 121400, 121800, 122200, 122600, 123000,
  399. 123400,
  400. /* Index 940 - 945 */
  401. 123800, 124200, 124600, 124900, 125000, 125000,
  402. };
  403. /* DRA752 data */
  404. const struct ti_bandgap_data dra752_data = {
  405. .features = TI_BANDGAP_FEATURE_TSHUT_CONFIG |
  406. TI_BANDGAP_FEATURE_FREEZE_BIT |
  407. TI_BANDGAP_FEATURE_TALERT |
  408. TI_BANDGAP_FEATURE_COUNTER_DELAY |
  409. TI_BANDGAP_FEATURE_HISTORY_BUFFER |
  410. TI_BANDGAP_FEATURE_ERRATA_814,
  411. .fclock_name = "l3instr_ts_gclk_div",
  412. .div_ck_name = "l3instr_ts_gclk_div",
  413. .conv_table = dra752_adc_to_temp,
  414. .adc_start_val = DRA752_ADC_START_VALUE,
  415. .adc_end_val = DRA752_ADC_END_VALUE,
  416. .expose_sensor = ti_thermal_expose_sensor,
  417. .remove_sensor = ti_thermal_remove_sensor,
  418. .sensors = {
  419. {
  420. .registers = &dra752_mpu_temp_sensor_registers,
  421. .ts_data = &dra752_mpu_temp_sensor_data,
  422. .domain = "cpu",
  423. .register_cooling = ti_thermal_register_cpu_cooling,
  424. .unregister_cooling = ti_thermal_unregister_cpu_cooling,
  425. .slope = DRA752_GRADIENT_SLOPE,
  426. .constant = DRA752_GRADIENT_CONST,
  427. .slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
  428. .constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
  429. },
  430. {
  431. .registers = &dra752_gpu_temp_sensor_registers,
  432. .ts_data = &dra752_gpu_temp_sensor_data,
  433. .domain = "gpu",
  434. .slope = DRA752_GRADIENT_SLOPE,
  435. .constant = DRA752_GRADIENT_CONST,
  436. .slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
  437. .constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
  438. },
  439. {
  440. .registers = &dra752_core_temp_sensor_registers,
  441. .ts_data = &dra752_core_temp_sensor_data,
  442. .domain = "core",
  443. .slope = DRA752_GRADIENT_SLOPE,
  444. .constant = DRA752_GRADIENT_CONST,
  445. .slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
  446. .constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
  447. },
  448. {
  449. .registers = &dra752_dspeve_temp_sensor_registers,
  450. .ts_data = &dra752_dspeve_temp_sensor_data,
  451. .domain = "dspeve",
  452. .slope = DRA752_GRADIENT_SLOPE,
  453. .constant = DRA752_GRADIENT_CONST,
  454. .slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
  455. .constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
  456. },
  457. {
  458. .registers = &dra752_iva_temp_sensor_registers,
  459. .ts_data = &dra752_iva_temp_sensor_data,
  460. .domain = "iva",
  461. .slope = DRA752_GRADIENT_SLOPE,
  462. .constant = DRA752_GRADIENT_CONST,
  463. .slope_pcb = DRA752_GRADIENT_SLOPE_W_PCB,
  464. .constant_pcb = DRA752_GRADIENT_CONST_W_PCB,
  465. },
  466. },
  467. .sensor_count = 5,
  468. };