dra752-bandgap.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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_DTEMP_CORE_1_OFFSET 0x20c
  53. #define DRA752_DTEMP_CORE_2_OFFSET 0x210
  54. /* DRA752.iva register offsets */
  55. #define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET 0x388
  56. #define DRA752_TEMP_SENSOR_IVA_OFFSET 0x398
  57. #define DRA752_BANDGAP_THRESHOLD_IVA_OFFSET 0x3a4
  58. #define DRA752_DTEMP_IVA_1_OFFSET 0x3d4
  59. #define DRA752_DTEMP_IVA_2_OFFSET 0x3d8
  60. /* DRA752.mpu register offsets */
  61. #define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET 0x4
  62. #define DRA752_TEMP_SENSOR_MPU_OFFSET 0x14c
  63. #define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET 0x1a4
  64. #define DRA752_DTEMP_MPU_1_OFFSET 0x1e4
  65. #define DRA752_DTEMP_MPU_2_OFFSET 0x1e8
  66. /* DRA752.dspeve register offsets */
  67. #define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET 0x384
  68. #define DRA752_TEMP_SENSOR_DSPEVE_OFFSET 0x394
  69. #define DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET 0x3a0
  70. #define DRA752_DTEMP_DSPEVE_1_OFFSET 0x3c0
  71. #define DRA752_DTEMP_DSPEVE_2_OFFSET 0x3c4
  72. /* DRA752.gpu register offsets */
  73. #define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET 0x0
  74. #define DRA752_TEMP_SENSOR_GPU_OFFSET 0x150
  75. #define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET 0x1a8
  76. #define DRA752_DTEMP_GPU_1_OFFSET 0x1f8
  77. #define DRA752_DTEMP_GPU_2_OFFSET 0x1fc
  78. /**
  79. * Register bitfields for DRA752
  80. *
  81. * All the macros bellow define the required bits for
  82. * controlling temperature on DRA752. Bit defines are
  83. * grouped by register.
  84. */
  85. /* DRA752.BANDGAP_STATUS_1 */
  86. #define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK BIT(5)
  87. #define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK BIT(4)
  88. #define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK BIT(3)
  89. #define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK BIT(2)
  90. #define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK BIT(1)
  91. #define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK BIT(0)
  92. /* DRA752.BANDGAP_CTRL_2 */
  93. #define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK BIT(22)
  94. #define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK BIT(21)
  95. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK BIT(3)
  96. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK BIT(2)
  97. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK BIT(1)
  98. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK BIT(0)
  99. /* DRA752.BANDGAP_STATUS_2 */
  100. #define DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK BIT(3)
  101. #define DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK BIT(2)
  102. #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK BIT(1)
  103. #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK BIT(0)
  104. /* DRA752.BANDGAP_CTRL_1 */
  105. #define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK (0x7 << 27)
  106. #define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK BIT(23)
  107. #define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK BIT(22)
  108. #define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK BIT(21)
  109. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK BIT(5)
  110. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK BIT(4)
  111. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK BIT(3)
  112. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK BIT(2)
  113. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK BIT(1)
  114. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK BIT(0)
  115. /* DRA752.TEMP_SENSOR */
  116. #define DRA752_TEMP_SENSOR_TMPSOFF_MASK BIT(11)
  117. #define DRA752_TEMP_SENSOR_EOCZ_MASK BIT(10)
  118. #define DRA752_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  119. /* DRA752.BANDGAP_THRESHOLD */
  120. #define DRA752_BANDGAP_THRESHOLD_HOT_MASK (0x3ff << 16)
  121. #define DRA752_BANDGAP_THRESHOLD_COLD_MASK (0x3ff << 0)
  122. /**
  123. * Temperature limits and thresholds for DRA752
  124. *
  125. * All the macros bellow are definitions for handling the
  126. * ADC conversions and representation of temperature limits
  127. * and thresholds for DRA752. Definitions are grouped
  128. * by temperature domain.
  129. */
  130. /* DRA752.common temperature definitions */
  131. /* ADC conversion table limits */
  132. #define DRA752_ADC_START_VALUE 540
  133. #define DRA752_ADC_END_VALUE 945
  134. /* DRA752.GPU temperature definitions */
  135. /* bandgap clock limits */
  136. #define DRA752_GPU_MAX_FREQ 1500000
  137. #define DRA752_GPU_MIN_FREQ 1000000
  138. /* interrupts thresholds */
  139. #define DRA752_GPU_T_HOT 800
  140. #define DRA752_GPU_T_COLD 795
  141. /* DRA752.MPU temperature definitions */
  142. /* bandgap clock limits */
  143. #define DRA752_MPU_MAX_FREQ 1500000
  144. #define DRA752_MPU_MIN_FREQ 1000000
  145. /* interrupts thresholds */
  146. #define DRA752_MPU_T_HOT 800
  147. #define DRA752_MPU_T_COLD 795
  148. /* DRA752.CORE temperature definitions */
  149. /* bandgap clock limits */
  150. #define DRA752_CORE_MAX_FREQ 1500000
  151. #define DRA752_CORE_MIN_FREQ 1000000
  152. /* interrupts thresholds */
  153. #define DRA752_CORE_T_HOT 800
  154. #define DRA752_CORE_T_COLD 795
  155. /* DRA752.DSPEVE temperature definitions */
  156. /* bandgap clock limits */
  157. #define DRA752_DSPEVE_MAX_FREQ 1500000
  158. #define DRA752_DSPEVE_MIN_FREQ 1000000
  159. /* interrupts thresholds */
  160. #define DRA752_DSPEVE_T_HOT 800
  161. #define DRA752_DSPEVE_T_COLD 795
  162. /* DRA752.IVA temperature definitions */
  163. /* bandgap clock limits */
  164. #define DRA752_IVA_MAX_FREQ 1500000
  165. #define DRA752_IVA_MIN_FREQ 1000000
  166. /* interrupts thresholds */
  167. #define DRA752_IVA_T_HOT 800
  168. #define DRA752_IVA_T_COLD 795
  169. #endif /* __DRA752_BANDGAP_H */