omap4xxx-bandgap.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * OMAP4xxx 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. */
  9. #ifndef __OMAP4XXX_BANDGAP_H
  10. #define __OMAP4XXX_BANDGAP_H
  11. /**
  12. * *** OMAP4430 ***
  13. *
  14. * Below, in sequence, are the Register definitions,
  15. * the bitfields and the temperature definitions for OMAP4430.
  16. */
  17. /**
  18. * OMAP4430 register definitions
  19. *
  20. * Registers are defined as offsets. The offsets are
  21. * relative to FUSE_OPP_BGAP on 4430.
  22. */
  23. /* OMAP4430.FUSE_OPP_BGAP */
  24. #define OMAP4430_FUSE_OPP_BGAP 0x0
  25. /* OMAP4430.TEMP_SENSOR */
  26. #define OMAP4430_TEMP_SENSOR_CTRL_OFFSET 0xCC
  27. /**
  28. * Register and bit definitions for OMAP4430
  29. *
  30. * All the macros bellow define the required bits for
  31. * controlling temperature on OMAP4430. Bit defines are
  32. * grouped by register.
  33. */
  34. /* OMAP4430.TEMP_SENSOR bits */
  35. #define OMAP4430_BGAP_TEMPSOFF_MASK BIT(12)
  36. #define OMAP4430_BGAP_TSHUT_MASK BIT(11)
  37. #define OMAP4430_CONTINUOUS_MODE_MASK BIT(10)
  38. #define OMAP4430_BGAP_TEMP_SENSOR_SOC_MASK BIT(9)
  39. #define OMAP4430_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(8)
  40. #define OMAP4430_BGAP_TEMP_SENSOR_DTEMP_MASK (0xff << 0)
  41. /**
  42. * Temperature limits and thresholds for OMAP4430
  43. *
  44. * All the macros bellow are definitions for handling the
  45. * ADC conversions and representation of temperature limits
  46. * and thresholds for OMAP4430.
  47. */
  48. /*
  49. * ADC conversion table limits. Ignore values outside the TRM listed
  50. * range to avoid bogus thermal shutdowns. See omap4430 TRM chapter
  51. * "18.4.10.2.3 ADC Codes Versus Temperature".
  52. */
  53. #define OMAP4430_ADC_START_VALUE 13
  54. #define OMAP4430_ADC_END_VALUE 107
  55. /* bandgap clock limits (no control on 4430) */
  56. #define OMAP4430_MAX_FREQ 32768
  57. #define OMAP4430_MIN_FREQ 32768
  58. /**
  59. * *** OMAP4460 *** Applicable for OMAP4470
  60. *
  61. * Below, in sequence, are the Register definitions,
  62. * the bitfields and the temperature definitions for OMAP4460.
  63. */
  64. /**
  65. * OMAP4460 register definitions
  66. *
  67. * Registers are defined as offsets. The offsets are
  68. * relative to FUSE_OPP_BGAP on 4460.
  69. */
  70. /* OMAP4460.FUSE_OPP_BGAP */
  71. #define OMAP4460_FUSE_OPP_BGAP 0x0
  72. /* OMAP4460.TEMP_SENSOR */
  73. #define OMAP4460_TEMP_SENSOR_CTRL_OFFSET 0xCC
  74. /* OMAP4460.BANDGAP_CTRL */
  75. #define OMAP4460_BGAP_CTRL_OFFSET 0x118
  76. /* OMAP4460.BANDGAP_COUNTER */
  77. #define OMAP4460_BGAP_COUNTER_OFFSET 0x11C
  78. /* OMAP4460.BANDGAP_THRESHOLD */
  79. #define OMAP4460_BGAP_THRESHOLD_OFFSET 0x120
  80. /* OMAP4460.TSHUT_THRESHOLD */
  81. #define OMAP4460_BGAP_TSHUT_OFFSET 0x124
  82. /* OMAP4460.BANDGAP_STATUS */
  83. #define OMAP4460_BGAP_STATUS_OFFSET 0x128
  84. /**
  85. * Register bitfields for OMAP4460
  86. *
  87. * All the macros bellow define the required bits for
  88. * controlling temperature on OMAP4460. Bit defines are
  89. * grouped by register.
  90. */
  91. /* OMAP4460.TEMP_SENSOR bits */
  92. #define OMAP4460_BGAP_TEMPSOFF_MASK BIT(13)
  93. #define OMAP4460_BGAP_TEMP_SENSOR_SOC_MASK BIT(11)
  94. #define OMAP4460_BGAP_TEMP_SENSOR_EOCZ_MASK BIT(10)
  95. #define OMAP4460_BGAP_TEMP_SENSOR_DTEMP_MASK (0x3ff << 0)
  96. /* OMAP4460.BANDGAP_CTRL bits */
  97. #define OMAP4460_CONTINUOUS_MODE_MASK BIT(31)
  98. #define OMAP4460_MASK_HOT_MASK BIT(1)
  99. #define OMAP4460_MASK_COLD_MASK BIT(0)
  100. /* OMAP4460.BANDGAP_COUNTER bits */
  101. #define OMAP4460_COUNTER_MASK (0xffffff << 0)
  102. /* OMAP4460.BANDGAP_THRESHOLD bits */
  103. #define OMAP4460_T_HOT_MASK (0x3ff << 16)
  104. #define OMAP4460_T_COLD_MASK (0x3ff << 0)
  105. /* OMAP4460.TSHUT_THRESHOLD bits */
  106. #define OMAP4460_TSHUT_HOT_MASK (0x3ff << 16)
  107. #define OMAP4460_TSHUT_COLD_MASK (0x3ff << 0)
  108. /* OMAP4460.BANDGAP_STATUS bits */
  109. #define OMAP4460_HOT_FLAG_MASK BIT(1)
  110. #define OMAP4460_COLD_FLAG_MASK BIT(0)
  111. /**
  112. * Temperature limits and thresholds for OMAP4460
  113. *
  114. * All the macros bellow are definitions for handling the
  115. * ADC conversions and representation of temperature limits
  116. * and thresholds for OMAP4460.
  117. */
  118. /* ADC conversion table limits */
  119. #define OMAP4460_ADC_START_VALUE 530
  120. #define OMAP4460_ADC_END_VALUE 932
  121. /* bandgap clock limits */
  122. #define OMAP4460_MAX_FREQ 1500000
  123. #define OMAP4460_MIN_FREQ 1000000
  124. /* interrupts thresholds */
  125. #define OMAP4460_TSHUT_HOT 900 /* 122 deg C */
  126. #define OMAP4460_TSHUT_COLD 895 /* 100 deg C */
  127. #define OMAP4460_T_HOT 800 /* 73 deg C */
  128. #define OMAP4460_T_COLD 795 /* 71 deg C */
  129. #endif /* __OMAP4XXX_BANDGAP_H */