dra752-bandgap.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * DRA752 bandgap registers, bitfields and temperature definitions
  4. *
  5. * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
  6. * Contact:
  7. * Eduardo Valentin <[email protected]>
  8. * Tero Kristo <[email protected]>
  9. *
  10. * This is an auto generated file.
  11. */
  12. #ifndef __DRA752_BANDGAP_H
  13. #define __DRA752_BANDGAP_H
  14. /**
  15. * *** DRA752 ***
  16. *
  17. * Below, in sequence, are the Register definitions,
  18. * the bitfields and the temperature definitions for DRA752.
  19. */
  20. /**
  21. * DRA752 register definitions
  22. *
  23. * Registers are defined as offsets. The offsets are
  24. * relative to FUSE_OPP_BGAP_GPU on DRA752.
  25. * DRA752_BANDGAP_BASE 0x4a0021e0
  26. *
  27. * Register below are grouped by domain (not necessarily in offset order)
  28. */
  29. /* DRA752.common register offsets */
  30. #define DRA752_BANDGAP_CTRL_1_OFFSET 0x1a0
  31. #define DRA752_BANDGAP_STATUS_1_OFFSET 0x1c8
  32. #define DRA752_BANDGAP_CTRL_2_OFFSET 0x39c
  33. #define DRA752_BANDGAP_STATUS_2_OFFSET 0x3b8
  34. /* DRA752.core register offsets */
  35. #define DRA752_STD_FUSE_OPP_BGAP_CORE_OFFSET 0x8
  36. #define DRA752_TEMP_SENSOR_CORE_OFFSET 0x154
  37. #define DRA752_BANDGAP_THRESHOLD_CORE_OFFSET 0x1ac
  38. #define DRA752_DTEMP_CORE_1_OFFSET 0x20c
  39. #define DRA752_DTEMP_CORE_2_OFFSET 0x210
  40. /* DRA752.iva register offsets */
  41. #define DRA752_STD_FUSE_OPP_BGAP_IVA_OFFSET 0x388
  42. #define DRA752_TEMP_SENSOR_IVA_OFFSET 0x398
  43. #define DRA752_BANDGAP_THRESHOLD_IVA_OFFSET 0x3a4
  44. #define DRA752_DTEMP_IVA_1_OFFSET 0x3d4
  45. #define DRA752_DTEMP_IVA_2_OFFSET 0x3d8
  46. /* DRA752.mpu register offsets */
  47. #define DRA752_STD_FUSE_OPP_BGAP_MPU_OFFSET 0x4
  48. #define DRA752_TEMP_SENSOR_MPU_OFFSET 0x14c
  49. #define DRA752_BANDGAP_THRESHOLD_MPU_OFFSET 0x1a4
  50. #define DRA752_DTEMP_MPU_1_OFFSET 0x1e4
  51. #define DRA752_DTEMP_MPU_2_OFFSET 0x1e8
  52. /* DRA752.dspeve register offsets */
  53. #define DRA752_STD_FUSE_OPP_BGAP_DSPEVE_OFFSET 0x384
  54. #define DRA752_TEMP_SENSOR_DSPEVE_OFFSET 0x394
  55. #define DRA752_BANDGAP_THRESHOLD_DSPEVE_OFFSET 0x3a0
  56. #define DRA752_DTEMP_DSPEVE_1_OFFSET 0x3c0
  57. #define DRA752_DTEMP_DSPEVE_2_OFFSET 0x3c4
  58. /* DRA752.gpu register offsets */
  59. #define DRA752_STD_FUSE_OPP_BGAP_GPU_OFFSET 0x0
  60. #define DRA752_TEMP_SENSOR_GPU_OFFSET 0x150
  61. #define DRA752_BANDGAP_THRESHOLD_GPU_OFFSET 0x1a8
  62. #define DRA752_DTEMP_GPU_1_OFFSET 0x1f8
  63. #define DRA752_DTEMP_GPU_2_OFFSET 0x1fc
  64. /**
  65. * Register bitfields for DRA752
  66. *
  67. * All the macros bellow define the required bits for
  68. * controlling temperature on DRA752. Bit defines are
  69. * grouped by register.
  70. */
  71. /* DRA752.BANDGAP_STATUS_1 */
  72. #define DRA752_BANDGAP_STATUS_1_HOT_CORE_MASK BIT(5)
  73. #define DRA752_BANDGAP_STATUS_1_COLD_CORE_MASK BIT(4)
  74. #define DRA752_BANDGAP_STATUS_1_HOT_GPU_MASK BIT(3)
  75. #define DRA752_BANDGAP_STATUS_1_COLD_GPU_MASK BIT(2)
  76. #define DRA752_BANDGAP_STATUS_1_HOT_MPU_MASK BIT(1)
  77. #define DRA752_BANDGAP_STATUS_1_COLD_MPU_MASK BIT(0)
  78. /* DRA752.BANDGAP_CTRL_2 */
  79. #define DRA752_BANDGAP_CTRL_2_FREEZE_IVA_MASK BIT(22)
  80. #define DRA752_BANDGAP_CTRL_2_FREEZE_DSPEVE_MASK BIT(21)
  81. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_IVA_MASK BIT(3)
  82. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_IVA_MASK BIT(2)
  83. #define DRA752_BANDGAP_CTRL_2_MASK_HOT_DSPEVE_MASK BIT(1)
  84. #define DRA752_BANDGAP_CTRL_2_MASK_COLD_DSPEVE_MASK BIT(0)
  85. /* DRA752.BANDGAP_STATUS_2 */
  86. #define DRA752_BANDGAP_STATUS_2_HOT_IVA_MASK BIT(3)
  87. #define DRA752_BANDGAP_STATUS_2_COLD_IVA_MASK BIT(2)
  88. #define DRA752_BANDGAP_STATUS_2_HOT_DSPEVE_MASK BIT(1)
  89. #define DRA752_BANDGAP_STATUS_2_COLD_DSPEVE_MASK BIT(0)
  90. /* DRA752.BANDGAP_CTRL_1 */
  91. #define DRA752_BANDGAP_CTRL_1_COUNTER_DELAY_MASK (0x7 << 27)
  92. #define DRA752_BANDGAP_CTRL_1_FREEZE_CORE_MASK BIT(23)
  93. #define DRA752_BANDGAP_CTRL_1_FREEZE_GPU_MASK BIT(22)
  94. #define DRA752_BANDGAP_CTRL_1_FREEZE_MPU_MASK BIT(21)
  95. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_CORE_MASK BIT(5)
  96. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_CORE_MASK BIT(4)
  97. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_GPU_MASK BIT(3)
  98. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_GPU_MASK BIT(2)
  99. #define DRA752_BANDGAP_CTRL_1_MASK_HOT_MPU_MASK BIT(1)
  100. #define DRA752_BANDGAP_CTRL_1_MASK_COLD_MPU_MASK BIT(0)
  101. /* DRA752.TEMP_SENSOR */
  102. #define DRA752_TEMP_SENSOR_TMPSOFF_MASK BIT(11)
  103. #define DRA752_TEMP_SENSOR_EOCZ_MASK BIT(10)
  104. #define DRA752_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  105. /* DRA752.BANDGAP_THRESHOLD */
  106. #define DRA752_BANDGAP_THRESHOLD_HOT_MASK (0x3ff << 16)
  107. #define DRA752_BANDGAP_THRESHOLD_COLD_MASK (0x3ff << 0)
  108. /**
  109. * Temperature limits and thresholds for DRA752
  110. *
  111. * All the macros bellow are definitions for handling the
  112. * ADC conversions and representation of temperature limits
  113. * and thresholds for DRA752. Definitions are grouped
  114. * by temperature domain.
  115. */
  116. /* DRA752.common temperature definitions */
  117. /* ADC conversion table limits */
  118. #define DRA752_ADC_START_VALUE 540
  119. #define DRA752_ADC_END_VALUE 945
  120. /* DRA752.GPU temperature definitions */
  121. /* bandgap clock limits */
  122. #define DRA752_GPU_MAX_FREQ 1500000
  123. #define DRA752_GPU_MIN_FREQ 1000000
  124. /* interrupts thresholds */
  125. #define DRA752_GPU_T_HOT 800
  126. #define DRA752_GPU_T_COLD 795
  127. /* DRA752.MPU temperature definitions */
  128. /* bandgap clock limits */
  129. #define DRA752_MPU_MAX_FREQ 1500000
  130. #define DRA752_MPU_MIN_FREQ 1000000
  131. /* interrupts thresholds */
  132. #define DRA752_MPU_T_HOT 800
  133. #define DRA752_MPU_T_COLD 795
  134. /* DRA752.CORE temperature definitions */
  135. /* bandgap clock limits */
  136. #define DRA752_CORE_MAX_FREQ 1500000
  137. #define DRA752_CORE_MIN_FREQ 1000000
  138. /* interrupts thresholds */
  139. #define DRA752_CORE_T_HOT 800
  140. #define DRA752_CORE_T_COLD 795
  141. /* DRA752.DSPEVE temperature definitions */
  142. /* bandgap clock limits */
  143. #define DRA752_DSPEVE_MAX_FREQ 1500000
  144. #define DRA752_DSPEVE_MIN_FREQ 1000000
  145. /* interrupts thresholds */
  146. #define DRA752_DSPEVE_T_HOT 800
  147. #define DRA752_DSPEVE_T_COLD 795
  148. /* DRA752.IVA temperature definitions */
  149. /* bandgap clock limits */
  150. #define DRA752_IVA_MAX_FREQ 1500000
  151. #define DRA752_IVA_MIN_FREQ 1000000
  152. /* interrupts thresholds */
  153. #define DRA752_IVA_T_HOT 800
  154. #define DRA752_IVA_T_COLD 795
  155. #endif /* __DRA752_BANDGAP_H */