exynos_thermal 2.8 KB

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