omap4xxx-bandgap.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. /*
  2. * OMAP4xxx 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 __OMAP4XXX_BANDGAP_H
  24. #define __OMAP4XXX_BANDGAP_H
  25. /**
  26. * *** OMAP4430 ***
  27. *
  28. * Below, in sequence, are the Register definitions,
  29. * the bitfields and the temperature definitions for OMAP4430.
  30. */
  31. /**
  32. * OMAP4430 register definitions
  33. *
  34. * Registers are defined as offsets. The offsets are
  35. * relative to FUSE_OPP_BGAP on 4430.
  36. */
  37. /* OMAP4430.FUSE_OPP_BGAP */
  38. #define OMAP4430_FUSE_OPP_BGAP 0x0
  39. /* OMAP4430.TEMP_SENSOR */
  40. #define OMAP4430_TEMP_SENSOR_CTRL_OFFSET 0xCC
  41. /**
  42. * Register and bit definitions for OMAP4430
  43. *
  44. * All the macros bellow define the required bits for
  45. * controlling temperature on OMAP4430. Bit defines are
  46. * grouped by register.
  47. */
  48. /* OMAP4430.TEMP_SENSOR bits */
  49. #define OMAP4430_BGAP_TEMPSOFF_MASK BIT(12)
  50. #define OMAP4430_BGAP_TSHUT_MASK BIT(11)
  51. #define OMAP4430_SINGLE_MODE_MASK BIT(10)
  52. #define OMAP4430_BGAP_TEMP_SENSOR_SOC_MASK BIT(9)
  53. #define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(8)
  54. #define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_MASK (0xff << 0)
  55. /**
  56. * Temperature limits and thresholds for OMAP4430
  57. *
  58. * All the macros bellow are definitions for handling the
  59. * ADC conversions and representation of temperature limits
  60. * and thresholds for OMAP4430.
  61. */
  62. /* ADC conversion table limits */
  63. #define OMAP4430_ADC_START_VALUE 0
  64. #define OMAP4430_ADC_END_VALUE 127
  65. /* bandgap clock limits (no control on 4430) */
  66. #define OMAP4430_MAX_FREQ 32768
  67. #define OMAP4430_MIN_FREQ 32768
  68. /* sensor limits */
  69. #define OMAP4430_MIN_TEMP -40000
  70. #define OMAP4430_MAX_TEMP 125000
  71. #define OMAP4430_HYST_VAL 5000
  72. /**
  73. * *** OMAP4460 *** Applicable for OMAP4470
  74. *
  75. * Below, in sequence, are the Register definitions,
  76. * the bitfields and the temperature definitions for OMAP4460.
  77. */
  78. /**
  79. * OMAP4460 register definitions
  80. *
  81. * Registers are defined as offsets. The offsets are
  82. * relative to FUSE_OPP_BGAP on 4460.
  83. */
  84. /* OMAP4460.FUSE_OPP_BGAP */
  85. #define OMAP4460_FUSE_OPP_BGAP 0x0
  86. /* OMAP4460.TEMP_SENSOR */
  87. #define OMAP4460_TEMP_SENSOR_CTRL_OFFSET 0xCC
  88. /* OMAP4460.BANDGAP_CTRL */
  89. #define OMAP4460_BGAP_CTRL_OFFSET 0x118
  90. /* OMAP4460.BANDGAP_COUNTER */
  91. #define OMAP4460_BGAP_COUNTER_OFFSET 0x11C
  92. /* OMAP4460.BANDGAP_THRESHOLD */
  93. #define OMAP4460_BGAP_THRESHOLD_OFFSET 0x120
  94. /* OMAP4460.TSHUT_THRESHOLD */
  95. #define OMAP4460_BGAP_TSHUT_OFFSET 0x124
  96. /* OMAP4460.BANDGAP_STATUS */
  97. #define OMAP4460_BGAP_STATUS_OFFSET 0x128
  98. /**
  99. * Register bitfields for OMAP4460
  100. *
  101. * All the macros bellow define the required bits for
  102. * controlling temperature on OMAP4460. Bit defines are
  103. * grouped by register.
  104. */
  105. /* OMAP4460.TEMP_SENSOR bits */
  106. #define OMAP4460_BGAP_TEMPSOFF_MASK BIT(13)
  107. #define OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK BIT(11)
  108. #define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(10)
  109. #define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  110. /* OMAP4460.BANDGAP_CTRL bits */
  111. #define OMAP4460_SINGLE_MODE_MASK BIT(31)
  112. #define OMAP4460_MASK_HOT_MASK BIT(1)
  113. #define OMAP4460_MASK_COLD_MASK BIT(0)
  114. /* OMAP4460.BANDGAP_COUNTER bits */
  115. #define OMAP4460_COUNTER_MASK (0xffffff << 0)
  116. /* OMAP4460.BANDGAP_THRESHOLD bits */
  117. #define OMAP4460_T_HOT_MASK (0x3ff << 16)
  118. #define OMAP4460_T_COLD_MASK (0x3ff << 0)
  119. /* OMAP4460.TSHUT_THRESHOLD bits */
  120. #define OMAP4460_TSHUT_HOT_MASK (0x3ff << 16)
  121. #define OMAP4460_TSHUT_COLD_MASK (0x3ff << 0)
  122. /* OMAP4460.BANDGAP_STATUS bits */
  123. #define OMAP4460_CLEAN_STOP_MASK BIT(3)
  124. #define OMAP4460_BGAP_ALERT_MASK BIT(2)
  125. #define OMAP4460_HOT_FLAG_MASK BIT(1)
  126. #define OMAP4460_COLD_FLAG_MASK BIT(0)
  127. /**
  128. * Temperature limits and thresholds for OMAP4460
  129. *
  130. * All the macros bellow are definitions for handling the
  131. * ADC conversions and representation of temperature limits
  132. * and thresholds for OMAP4460.
  133. */
  134. /* ADC conversion table limits */
  135. #define OMAP4460_ADC_START_VALUE 530
  136. #define OMAP4460_ADC_END_VALUE 932
  137. /* bandgap clock limits */
  138. #define OMAP4460_MAX_FREQ 1500000
  139. #define OMAP4460_MIN_FREQ 1000000
  140. /* sensor limits */
  141. #define OMAP4460_MIN_TEMP -40000
  142. #define OMAP4460_MAX_TEMP 123000
  143. #define OMAP4460_HYST_VAL 5000
  144. /* interrupts thresholds */
  145. #define OMAP4460_TSHUT_HOT 900 /* 122 deg C */
  146. #define OMAP4460_TSHUT_COLD 895 /* 100 deg C */
  147. #define OMAP4460_T_HOT 800 /* 73 deg C */
  148. #define OMAP4460_T_COLD 795 /* 71 deg C */
  149. #endif /* __OMAP4XXX_BANDGAP_H */