exynos_thermal.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. ========================
  2. Kernel driver exynos_tmu
  3. ========================
  4. Supported chips:
  5. * ARM Samsung Exynos4, Exynos5 series of SoC
  6. Datasheet: Not publicly available
  7. Authors: Donggeun Kim <[email protected]>
  8. Authors: Amit Daniel <[email protected]>
  9. TMU controller Description:
  10. ---------------------------
  11. This driver allows to read temperature inside Samsung Exynos4/5 series of SoC.
  12. The chip only exposes the measured 8-bit temperature code value
  13. through a register.
  14. Temperature can be taken from the temperature code.
  15. There are three equations converting from temperature to temperature code.
  16. The three equations are:
  17. 1. Two point trimming::
  18. Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
  19. 2. One point trimming::
  20. Tc = T + TI1 - 25
  21. 3. No trimming::
  22. Tc = T + 50
  23. Tc:
  24. Temperature code, T: Temperature,
  25. TI1:
  26. Trimming info for 25 degree Celsius (stored at TRIMINFO register)
  27. Temperature code measured at 25 degree Celsius which is unchanged
  28. TI2:
  29. Trimming info for 85 degree Celsius (stored at TRIMINFO register)
  30. Temperature code measured at 85 degree Celsius which is unchanged
  31. TMU(Thermal Management Unit) in Exynos4/5 generates interrupt
  32. when temperature exceeds pre-defined levels.
  33. The maximum number of configurable threshold is five.
  34. The threshold levels are defined as follows::
  35. Level_0: current temperature > trigger_level_0 + threshold
  36. Level_1: current temperature > trigger_level_1 + threshold
  37. Level_2: current temperature > trigger_level_2 + threshold
  38. Level_3: current temperature > trigger_level_3 + threshold
  39. The threshold and each trigger_level are set
  40. through the corresponding registers.
  41. When an interrupt occurs, this driver notify kernel thermal framework
  42. with the function exynos_report_trigger.
  43. Although an interrupt condition for level_0 can be set,
  44. it can be used to synchronize the cooling action.
  45. TMU driver description:
  46. -----------------------
  47. The exynos thermal driver is structured as::
  48. Kernel Core thermal framework
  49. (thermal_core.c, step_wise.c, cpufreq_cooling.c)
  50. ^
  51. |
  52. |
  53. TMU configuration data -----> TMU Driver <----> Exynos Core thermal wrapper
  54. (exynos_tmu_data.c) (exynos_tmu.c) (exynos_thermal_common.c)
  55. (exynos_tmu_data.h) (exynos_tmu.h) (exynos_thermal_common.h)
  56. a) TMU configuration data:
  57. This consist of TMU register offsets/bitfields
  58. described through structure exynos_tmu_registers. Also several
  59. other platform data (struct exynos_tmu_platform_data) members
  60. are used to configure the TMU.
  61. b) TMU driver:
  62. This component initialises the TMU controller and sets different
  63. thresholds. It invokes core thermal implementation with the call
  64. exynos_report_trigger.
  65. c) Exynos Core thermal wrapper:
  66. This provides 3 wrapper function to use the
  67. Kernel core thermal framework. They are exynos_unregister_thermal,
  68. exynos_register_thermal and exynos_report_trigger.