exynos_tmu_data.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. /*
  2. * exynos_tmu_data.c - Samsung EXYNOS tmu data file
  3. *
  4. * Copyright (C) 2013 Samsung Electronics
  5. * Amit Daniel Kachhap <amit.daniel@samsung.com>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. */
  22. #include "exynos_thermal_common.h"
  23. #include "exynos_tmu.h"
  24. #include "exynos_tmu_data.h"
  25. #if defined(CONFIG_CPU_EXYNOS4210)
  26. static const struct exynos_tmu_registers exynos4210_tmu_registers = {
  27. .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
  28. .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
  29. .tmu_status = EXYNOS_TMU_REG_STATUS,
  30. .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
  31. .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP,
  32. .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0,
  33. .tmu_inten = EXYNOS_TMU_REG_INTEN,
  34. .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
  35. .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
  36. .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
  37. .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
  38. .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
  39. .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
  40. };
  41. struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
  42. .tmu_data = {
  43. {
  44. .threshold = 80,
  45. .trigger_levels[0] = 5,
  46. .trigger_levels[1] = 20,
  47. .trigger_levels[2] = 30,
  48. .trigger_enable[0] = true,
  49. .trigger_enable[1] = true,
  50. .trigger_enable[2] = true,
  51. .trigger_enable[3] = false,
  52. .trigger_type[0] = THROTTLE_ACTIVE,
  53. .trigger_type[1] = THROTTLE_ACTIVE,
  54. .trigger_type[2] = SW_TRIP,
  55. .max_trigger_level = 4,
  56. .non_hw_trigger_levels = 3,
  57. .gain = 15,
  58. .reference_voltage = 7,
  59. .cal_type = TYPE_ONE_POINT_TRIMMING,
  60. .min_efuse_value = 40,
  61. .max_efuse_value = 100,
  62. .first_point_trim = 25,
  63. .second_point_trim = 85,
  64. .default_temp_offset = 50,
  65. .freq_tab[0] = {
  66. .freq_clip_max = 800 * 1000,
  67. .temp_level = 85,
  68. },
  69. .freq_tab[1] = {
  70. .freq_clip_max = 200 * 1000,
  71. .temp_level = 100,
  72. },
  73. .freq_tab_count = 2,
  74. .type = SOC_ARCH_EXYNOS4210,
  75. .registers = &exynos4210_tmu_registers,
  76. .features = TMU_SUPPORT_READY_STATUS,
  77. },
  78. },
  79. .tmu_count = 1,
  80. };
  81. #endif
  82. #if defined(CONFIG_SOC_EXYNOS3250)
  83. static const struct exynos_tmu_registers exynos3250_tmu_registers = {
  84. .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
  85. .triminfo_ctrl[0] = EXYNOS_TMU_TRIMINFO_CON1,
  86. .triminfo_ctrl[1] = EXYNOS_TMU_TRIMINFO_CON2,
  87. .triminfo_ctrl_count = 2,
  88. .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
  89. .test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
  90. .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
  91. .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
  92. .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
  93. .tmu_status = EXYNOS_TMU_REG_STATUS,
  94. .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
  95. .threshold_th0 = EXYNOS_THD_TEMP_RISE,
  96. .threshold_th1 = EXYNOS_THD_TEMP_FALL,
  97. .tmu_inten = EXYNOS_TMU_REG_INTEN,
  98. .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
  99. .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
  100. .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
  101. .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
  102. .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
  103. .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
  104. .emul_con = EXYNOS_EMUL_CON,
  105. .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
  106. .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
  107. };
  108. #define EXYNOS3250_TMU_DATA \
  109. .threshold_falling = 10, \
  110. .trigger_levels[0] = 70, \
  111. .trigger_levels[1] = 95, \
  112. .trigger_levels[2] = 110, \
  113. .trigger_levels[3] = 120, \
  114. .trigger_enable[0] = true, \
  115. .trigger_enable[1] = true, \
  116. .trigger_enable[2] = true, \
  117. .trigger_enable[3] = false, \
  118. .trigger_type[0] = THROTTLE_ACTIVE, \
  119. .trigger_type[1] = THROTTLE_ACTIVE, \
  120. .trigger_type[2] = SW_TRIP, \
  121. .trigger_type[3] = HW_TRIP, \
  122. .max_trigger_level = 4, \
  123. .non_hw_trigger_levels = 3, \
  124. .gain = 8, \
  125. .reference_voltage = 16, \
  126. .noise_cancel_mode = 4, \
  127. .cal_type = TYPE_TWO_POINT_TRIMMING, \
  128. .efuse_value = 55, \
  129. .min_efuse_value = 40, \
  130. .max_efuse_value = 100, \
  131. .first_point_trim = 25, \
  132. .second_point_trim = 85, \
  133. .default_temp_offset = 50, \
  134. .freq_tab[0] = { \
  135. .freq_clip_max = 800 * 1000, \
  136. .temp_level = 70, \
  137. }, \
  138. .freq_tab[1] = { \
  139. .freq_clip_max = 400 * 1000, \
  140. .temp_level = 95, \
  141. }, \
  142. .freq_tab_count = 2, \
  143. .triminfo_reload[0] = EXYNOS_TRIMINFO_RELOAD_ENABLE, \
  144. .triminfo_reload[1] = EXYNOS_TRIMINFO_RELOAD_ENABLE, \
  145. .registers = &exynos3250_tmu_registers, \
  146. .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
  147. TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
  148. TMU_SUPPORT_EMUL_TIME)
  149. #endif
  150. #if defined(CONFIG_SOC_EXYNOS3250)
  151. struct exynos_tmu_init_data const exynos3250_default_tmu_data = {
  152. .tmu_data = {
  153. {
  154. EXYNOS3250_TMU_DATA,
  155. .type = SOC_ARCH_EXYNOS3250,
  156. .test_mux = EXYNOS4412_MUX_ADDR_VALUE,
  157. },
  158. },
  159. .tmu_count = 1,
  160. };
  161. #endif
  162. #if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
  163. static const struct exynos_tmu_registers exynos4412_tmu_registers = {
  164. .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
  165. .triminfo_ctrl[0] = EXYNOS_TMU_TRIMINFO_CON2,
  166. .triminfo_ctrl_count = 1,
  167. .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
  168. .test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
  169. .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
  170. .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
  171. .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
  172. .tmu_status = EXYNOS_TMU_REG_STATUS,
  173. .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
  174. .threshold_th0 = EXYNOS_THD_TEMP_RISE,
  175. .threshold_th1 = EXYNOS_THD_TEMP_FALL,
  176. .tmu_inten = EXYNOS_TMU_REG_INTEN,
  177. .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
  178. .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
  179. .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
  180. .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
  181. .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
  182. .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
  183. .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
  184. .emul_con = EXYNOS_EMUL_CON,
  185. .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
  186. .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
  187. };
  188. #define EXYNOS4412_TMU_DATA \
  189. .threshold_falling = 10, \
  190. .trigger_levels[0] = 70, \
  191. .trigger_levels[1] = 95, \
  192. .trigger_levels[2] = 110, \
  193. .trigger_levels[3] = 120, \
  194. .trigger_enable[0] = true, \
  195. .trigger_enable[1] = true, \
  196. .trigger_enable[2] = true, \
  197. .trigger_enable[3] = false, \
  198. .trigger_type[0] = THROTTLE_ACTIVE, \
  199. .trigger_type[1] = THROTTLE_ACTIVE, \
  200. .trigger_type[2] = SW_TRIP, \
  201. .trigger_type[3] = HW_TRIP, \
  202. .max_trigger_level = 4, \
  203. .non_hw_trigger_levels = 3, \
  204. .gain = 8, \
  205. .reference_voltage = 16, \
  206. .noise_cancel_mode = 4, \
  207. .cal_type = TYPE_ONE_POINT_TRIMMING, \
  208. .efuse_value = 55, \
  209. .min_efuse_value = 40, \
  210. .max_efuse_value = 100, \
  211. .first_point_trim = 25, \
  212. .second_point_trim = 85, \
  213. .default_temp_offset = 50, \
  214. .freq_tab[0] = { \
  215. .freq_clip_max = 1400 * 1000, \
  216. .temp_level = 70, \
  217. }, \
  218. .freq_tab[1] = { \
  219. .freq_clip_max = 400 * 1000, \
  220. .temp_level = 95, \
  221. }, \
  222. .freq_tab_count = 2, \
  223. .triminfo_reload[0] = EXYNOS_TRIMINFO_RELOAD_ENABLE, \
  224. .registers = &exynos4412_tmu_registers, \
  225. .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
  226. TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
  227. TMU_SUPPORT_EMUL_TIME)
  228. #endif
  229. #if defined(CONFIG_SOC_EXYNOS4412)
  230. struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
  231. .tmu_data = {
  232. {
  233. EXYNOS4412_TMU_DATA,
  234. .type = SOC_ARCH_EXYNOS4412,
  235. .test_mux = EXYNOS4412_MUX_ADDR_VALUE,
  236. },
  237. },
  238. .tmu_count = 1,
  239. };
  240. #endif
  241. #if defined(CONFIG_SOC_EXYNOS5250)
  242. struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
  243. .tmu_data = {
  244. {
  245. EXYNOS4412_TMU_DATA,
  246. .type = SOC_ARCH_EXYNOS5250,
  247. },
  248. },
  249. .tmu_count = 1,
  250. };
  251. #endif
  252. #if defined(CONFIG_SOC_EXYNOS5260)
  253. static const struct exynos_tmu_registers exynos5260_tmu_registers = {
  254. .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
  255. .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
  256. .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
  257. .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
  258. .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
  259. .tmu_status = EXYNOS_TMU_REG_STATUS,
  260. .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
  261. .threshold_th0 = EXYNOS_THD_TEMP_RISE,
  262. .threshold_th1 = EXYNOS_THD_TEMP_FALL,
  263. .tmu_inten = EXYNOS5260_TMU_REG_INTEN,
  264. .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
  265. .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
  266. .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
  267. .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
  268. .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
  269. .tmu_intstat = EXYNOS5260_TMU_REG_INTSTAT,
  270. .tmu_intclear = EXYNOS5260_TMU_REG_INTCLEAR,
  271. .emul_con = EXYNOS5260_EMUL_CON,
  272. .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
  273. .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
  274. };
  275. #define __EXYNOS5260_TMU_DATA \
  276. .threshold_falling = 10, \
  277. .trigger_levels[0] = 85, \
  278. .trigger_levels[1] = 103, \
  279. .trigger_levels[2] = 110, \
  280. .trigger_levels[3] = 120, \
  281. .trigger_enable[0] = true, \
  282. .trigger_enable[1] = true, \
  283. .trigger_enable[2] = true, \
  284. .trigger_enable[3] = false, \
  285. .trigger_type[0] = THROTTLE_ACTIVE, \
  286. .trigger_type[1] = THROTTLE_ACTIVE, \
  287. .trigger_type[2] = SW_TRIP, \
  288. .trigger_type[3] = HW_TRIP, \
  289. .max_trigger_level = 4, \
  290. .non_hw_trigger_levels = 3, \
  291. .gain = 8, \
  292. .reference_voltage = 16, \
  293. .noise_cancel_mode = 4, \
  294. .cal_type = TYPE_ONE_POINT_TRIMMING, \
  295. .efuse_value = 55, \
  296. .min_efuse_value = 40, \
  297. .max_efuse_value = 100, \
  298. .first_point_trim = 25, \
  299. .second_point_trim = 85, \
  300. .default_temp_offset = 50, \
  301. .freq_tab[0] = { \
  302. .freq_clip_max = 800 * 1000, \
  303. .temp_level = 85, \
  304. }, \
  305. .freq_tab[1] = { \
  306. .freq_clip_max = 200 * 1000, \
  307. .temp_level = 103, \
  308. }, \
  309. .freq_tab_count = 2, \
  310. .registers = &exynos5260_tmu_registers, \
  311. #define EXYNOS5260_TMU_DATA \
  312. __EXYNOS5260_TMU_DATA \
  313. .type = SOC_ARCH_EXYNOS5260, \
  314. .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
  315. TMU_SUPPORT_READY_STATUS | TMU_SUPPORT_EMUL_TIME)
  316. struct exynos_tmu_init_data const exynos5260_default_tmu_data = {
  317. .tmu_data = {
  318. { EXYNOS5260_TMU_DATA },
  319. { EXYNOS5260_TMU_DATA },
  320. { EXYNOS5260_TMU_DATA },
  321. { EXYNOS5260_TMU_DATA },
  322. { EXYNOS5260_TMU_DATA },
  323. },
  324. .tmu_count = 5,
  325. };
  326. #endif
  327. #if defined(CONFIG_SOC_EXYNOS5420)
  328. static const struct exynos_tmu_registers exynos5420_tmu_registers = {
  329. .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
  330. .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
  331. .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
  332. .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
  333. .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
  334. .tmu_status = EXYNOS_TMU_REG_STATUS,
  335. .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
  336. .threshold_th0 = EXYNOS_THD_TEMP_RISE,
  337. .threshold_th1 = EXYNOS_THD_TEMP_FALL,
  338. .tmu_inten = EXYNOS_TMU_REG_INTEN,
  339. .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
  340. .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
  341. .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
  342. /* INTEN_RISE3 Not availble in exynos5420 */
  343. .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
  344. .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
  345. .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
  346. .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
  347. .emul_con = EXYNOS_EMUL_CON,
  348. .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
  349. .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
  350. };
  351. #define __EXYNOS5420_TMU_DATA \
  352. .threshold_falling = 10, \
  353. .trigger_levels[0] = 85, \
  354. .trigger_levels[1] = 103, \
  355. .trigger_levels[2] = 110, \
  356. .trigger_levels[3] = 120, \
  357. .trigger_enable[0] = true, \
  358. .trigger_enable[1] = true, \
  359. .trigger_enable[2] = true, \
  360. .trigger_enable[3] = false, \
  361. .trigger_type[0] = THROTTLE_ACTIVE, \
  362. .trigger_type[1] = THROTTLE_ACTIVE, \
  363. .trigger_type[2] = SW_TRIP, \
  364. .trigger_type[3] = HW_TRIP, \
  365. .max_trigger_level = 4, \
  366. .non_hw_trigger_levels = 3, \
  367. .gain = 8, \
  368. .reference_voltage = 16, \
  369. .noise_cancel_mode = 4, \
  370. .cal_type = TYPE_ONE_POINT_TRIMMING, \
  371. .efuse_value = 55, \
  372. .min_efuse_value = 40, \
  373. .max_efuse_value = 100, \
  374. .first_point_trim = 25, \
  375. .second_point_trim = 85, \
  376. .default_temp_offset = 50, \
  377. .freq_tab[0] = { \
  378. .freq_clip_max = 800 * 1000, \
  379. .temp_level = 85, \
  380. }, \
  381. .freq_tab[1] = { \
  382. .freq_clip_max = 200 * 1000, \
  383. .temp_level = 103, \
  384. }, \
  385. .freq_tab_count = 2, \
  386. .registers = &exynos5420_tmu_registers, \
  387. #define EXYNOS5420_TMU_DATA \
  388. __EXYNOS5420_TMU_DATA \
  389. .type = SOC_ARCH_EXYNOS5250, \
  390. .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
  391. TMU_SUPPORT_READY_STATUS | TMU_SUPPORT_EMUL_TIME)
  392. #define EXYNOS5420_TMU_DATA_SHARED \
  393. __EXYNOS5420_TMU_DATA \
  394. .type = SOC_ARCH_EXYNOS5420_TRIMINFO, \
  395. .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
  396. TMU_SUPPORT_READY_STATUS | TMU_SUPPORT_EMUL_TIME | \
  397. TMU_SUPPORT_ADDRESS_MULTIPLE)
  398. struct exynos_tmu_init_data const exynos5420_default_tmu_data = {
  399. .tmu_data = {
  400. { EXYNOS5420_TMU_DATA },
  401. { EXYNOS5420_TMU_DATA },
  402. { EXYNOS5420_TMU_DATA_SHARED },
  403. { EXYNOS5420_TMU_DATA_SHARED },
  404. { EXYNOS5420_TMU_DATA_SHARED },
  405. },
  406. .tmu_count = 5,
  407. };
  408. #endif
  409. #if defined(CONFIG_SOC_EXYNOS5440)
  410. static const struct exynos_tmu_registers exynos5440_tmu_registers = {
  411. .triminfo_data = EXYNOS5440_TMU_S0_7_TRIM,
  412. .tmu_ctrl = EXYNOS5440_TMU_S0_7_CTRL,
  413. .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
  414. .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
  415. .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
  416. .tmu_status = EXYNOS5440_TMU_S0_7_STATUS,
  417. .tmu_cur_temp = EXYNOS5440_TMU_S0_7_TEMP,
  418. .threshold_th0 = EXYNOS5440_TMU_S0_7_TH0,
  419. .threshold_th1 = EXYNOS5440_TMU_S0_7_TH1,
  420. .threshold_th2 = EXYNOS5440_TMU_S0_7_TH2,
  421. .threshold_th3_l0_shift = EXYNOS5440_TMU_TH_RISE4_SHIFT,
  422. .tmu_inten = EXYNOS5440_TMU_S0_7_IRQEN,
  423. .inten_rise0_shift = EXYNOS5440_TMU_INTEN_RISE0_SHIFT,
  424. .inten_rise1_shift = EXYNOS5440_TMU_INTEN_RISE1_SHIFT,
  425. .inten_rise2_shift = EXYNOS5440_TMU_INTEN_RISE2_SHIFT,
  426. .inten_rise3_shift = EXYNOS5440_TMU_INTEN_RISE3_SHIFT,
  427. .inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT,
  428. .tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ,
  429. .tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ,
  430. .tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS,
  431. .emul_con = EXYNOS5440_TMU_S0_7_DEBUG,
  432. .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
  433. .tmu_pmin = EXYNOS5440_TMU_PMIN,
  434. };
  435. #define EXYNOS5440_TMU_DATA \
  436. .trigger_levels[0] = 100, \
  437. .trigger_levels[4] = 105, \
  438. .trigger_enable[0] = 1, \
  439. .trigger_type[0] = SW_TRIP, \
  440. .trigger_type[4] = HW_TRIP, \
  441. .max_trigger_level = 5, \
  442. .non_hw_trigger_levels = 1, \
  443. .gain = 5, \
  444. .reference_voltage = 16, \
  445. .noise_cancel_mode = 4, \
  446. .cal_type = TYPE_ONE_POINT_TRIMMING, \
  447. .efuse_value = 0x5b2d, \
  448. .min_efuse_value = 16, \
  449. .max_efuse_value = 76, \
  450. .first_point_trim = 25, \
  451. .second_point_trim = 70, \
  452. .default_temp_offset = 25, \
  453. .type = SOC_ARCH_EXYNOS5440, \
  454. .registers = &exynos5440_tmu_registers, \
  455. .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
  456. TMU_SUPPORT_MULTI_INST | TMU_SUPPORT_ADDRESS_MULTIPLE),
  457. struct exynos_tmu_init_data const exynos5440_default_tmu_data = {
  458. .tmu_data = {
  459. { EXYNOS5440_TMU_DATA } ,
  460. { EXYNOS5440_TMU_DATA } ,
  461. { EXYNOS5440_TMU_DATA } ,
  462. },
  463. .tmu_count = 3,
  464. };
  465. #endif