omap5xxx-bandgap.h 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /*
  2. * OMAP5xxx 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. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * version 2 as published by the Free Software Foundation.
  11. *
  12. * This program is distributed in the hope that it will be useful, but
  13. * WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * 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., 51 Franklin St, Fifth Floor, Boston, MA
  20. * 02110-1301 USA
  21. *
  22. */
  23. #ifndef __OMAP5XXX_BANDGAP_H
  24. #define __OMAP5XXX_BANDGAP_H
  25. /**
  26. * *** OMAP5430 ***
  27. *
  28. * Below, in sequence, are the Register definitions,
  29. * the bitfields and the temperature definitions for OMAP5430.
  30. */
  31. /**
  32. * OMAP5430 register definitions
  33. *
  34. * Registers are defined as offsets. The offsets are
  35. * relative to FUSE_OPP_BGAP_GPU on 5430.
  36. *
  37. * Register below are grouped by domain (not necessarily in offset order)
  38. */
  39. /* OMAP5430.GPU register offsets */
  40. #define OMAP5430_FUSE_OPP_BGAP_GPU 0x0
  41. #define OMAP5430_TEMP_SENSOR_GPU_OFFSET 0x150
  42. #define OMAP5430_BGAP_THRESHOLD_GPU_OFFSET 0x1A8
  43. #define OMAP5430_BGAP_TSHUT_GPU_OFFSET 0x1B4
  44. #define OMAP5430_BGAP_DTEMP_GPU_1_OFFSET 0x1F8
  45. #define OMAP5430_BGAP_DTEMP_GPU_2_OFFSET 0x1FC
  46. /* OMAP5430.MPU register offsets */
  47. #define OMAP5430_FUSE_OPP_BGAP_MPU 0x4
  48. #define OMAP5430_TEMP_SENSOR_MPU_OFFSET 0x14C
  49. #define OMAP5430_BGAP_THRESHOLD_MPU_OFFSET 0x1A4
  50. #define OMAP5430_BGAP_TSHUT_MPU_OFFSET 0x1B0
  51. #define OMAP5430_BGAP_DTEMP_MPU_1_OFFSET 0x1E4
  52. #define OMAP5430_BGAP_DTEMP_MPU_2_OFFSET 0x1E8
  53. /* OMAP5430.MPU register offsets */
  54. #define OMAP5430_FUSE_OPP_BGAP_CORE 0x8
  55. #define OMAP5430_TEMP_SENSOR_CORE_OFFSET 0x154
  56. #define OMAP5430_BGAP_THRESHOLD_CORE_OFFSET 0x1AC
  57. #define OMAP5430_BGAP_TSHUT_CORE_OFFSET 0x1B8
  58. #define OMAP5430_BGAP_DTEMP_CORE_1_OFFSET 0x20C
  59. #define OMAP5430_BGAP_DTEMP_CORE_2_OFFSET 0x210
  60. /* OMAP5430.common register offsets */
  61. #define OMAP5430_BGAP_CTRL_OFFSET 0x1A0
  62. #define OMAP5430_BGAP_STATUS_OFFSET 0x1C8
  63. /**
  64. * Register bitfields for OMAP5430
  65. *
  66. * All the macros bellow define the required bits for
  67. * controlling temperature on OMAP5430. Bit defines are
  68. * grouped by register.
  69. */
  70. /* OMAP5430.TEMP_SENSOR */
  71. #define OMAP5430_BGAP_TEMP_SENSOR_SOC_MASK BIT(12)
  72. #define OMAP5430_BGAP_TEMPSOFF_MASK BIT(11)
  73. #define OMAP5430_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(10)
  74. #define OMAP5430_BGAP_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  75. /* OMAP5430.BANDGAP_CTRL */
  76. #define OMAP5430_MASK_COUNTER_DELAY_MASK (0x7 << 27)
  77. #define OMAP5430_MASK_FREEZE_CORE_MASK BIT(23)
  78. #define OMAP5430_MASK_FREEZE_GPU_MASK BIT(22)
  79. #define OMAP5430_MASK_FREEZE_MPU_MASK BIT(21)
  80. #define OMAP5430_MASK_HOT_CORE_MASK BIT(5)
  81. #define OMAP5430_MASK_COLD_CORE_MASK BIT(4)
  82. #define OMAP5430_MASK_HOT_GPU_MASK BIT(3)
  83. #define OMAP5430_MASK_COLD_GPU_MASK BIT(2)
  84. #define OMAP5430_MASK_HOT_MPU_MASK BIT(1)
  85. #define OMAP5430_MASK_COLD_MPU_MASK BIT(0)
  86. /* OMAP5430.BANDGAP_COUNTER */
  87. #define OMAP5430_COUNTER_MASK (0xffffff << 0)
  88. /* OMAP5430.BANDGAP_THRESHOLD */
  89. #define OMAP5430_T_HOT_MASK (0x3ff << 16)
  90. #define OMAP5430_T_COLD_MASK (0x3ff << 0)
  91. /* OMAP5430.TSHUT_THRESHOLD */
  92. #define OMAP5430_TSHUT_HOT_MASK (0x3ff << 16)
  93. #define OMAP5430_TSHUT_COLD_MASK (0x3ff << 0)
  94. /* OMAP5430.BANDGAP_STATUS */
  95. #define OMAP5430_HOT_CORE_FLAG_MASK BIT(5)
  96. #define OMAP5430_COLD_CORE_FLAG_MASK BIT(4)
  97. #define OMAP5430_HOT_GPU_FLAG_MASK BIT(3)
  98. #define OMAP5430_COLD_GPU_FLAG_MASK BIT(2)
  99. #define OMAP5430_HOT_MPU_FLAG_MASK BIT(1)
  100. #define OMAP5430_COLD_MPU_FLAG_MASK BIT(0)
  101. /**
  102. * Temperature limits and thresholds for OMAP5430
  103. *
  104. * All the macros bellow are definitions for handling the
  105. * ADC conversions and representation of temperature limits
  106. * and thresholds for OMAP5430. Definitions are grouped
  107. * by temperature domain.
  108. */
  109. /* OMAP5430.common temperature definitions */
  110. /* ADC conversion table limits */
  111. #define OMAP5430_ADC_START_VALUE 540
  112. #define OMAP5430_ADC_END_VALUE 945
  113. /* OMAP5430.GPU temperature definitions */
  114. /* bandgap clock limits */
  115. #define OMAP5430_GPU_MAX_FREQ 1500000
  116. #define OMAP5430_GPU_MIN_FREQ 1000000
  117. /* interrupts thresholds */
  118. #define OMAP5430_GPU_TSHUT_HOT 915
  119. #define OMAP5430_GPU_TSHUT_COLD 900
  120. #define OMAP5430_GPU_T_HOT 800
  121. #define OMAP5430_GPU_T_COLD 795
  122. /* OMAP5430.MPU temperature definitions */
  123. /* bandgap clock limits */
  124. #define OMAP5430_MPU_MAX_FREQ 1500000
  125. #define OMAP5430_MPU_MIN_FREQ 1000000
  126. /* interrupts thresholds */
  127. #define OMAP5430_MPU_TSHUT_HOT 915
  128. #define OMAP5430_MPU_TSHUT_COLD 900
  129. #define OMAP5430_MPU_T_HOT 800
  130. #define OMAP5430_MPU_T_COLD 795
  131. /* OMAP5430.CORE temperature definitions */
  132. /* bandgap clock limits */
  133. #define OMAP5430_CORE_MAX_FREQ 1500000
  134. #define OMAP5430_CORE_MIN_FREQ 1000000
  135. /* interrupts thresholds */
  136. #define OMAP5430_CORE_TSHUT_HOT 915
  137. #define OMAP5430_CORE_TSHUT_COLD 900
  138. #define OMAP5430_CORE_T_HOT 800
  139. #define OMAP5430_CORE_T_COLD 795
  140. #endif /* __OMAP5XXX_BANDGAP_H */