Back to home page

OSCL-LXR

 
 

    


0001 ========================
0002 Kernel driver exynos_tmu
0003 ========================
0004 
0005 Supported chips:
0006 
0007 * ARM Samsung Exynos4, Exynos5 series of SoC
0008 
0009   Datasheet: Not publicly available
0010 
0011 Authors: Donggeun Kim <dg77.kim@samsung.com>
0012 Authors: Amit Daniel <amit.daniel@samsung.com>
0013 
0014 TMU controller Description:
0015 ---------------------------
0016 
0017 This driver allows to read temperature inside Samsung Exynos4/5 series of SoC.
0018 
0019 The chip only exposes the measured 8-bit temperature code value
0020 through a register.
0021 Temperature can be taken from the temperature code.
0022 There are three equations converting from temperature to temperature code.
0023 
0024 The three equations are:
0025   1. Two point trimming::
0026 
0027         Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1
0028 
0029   2. One point trimming::
0030 
0031         Tc = T + TI1 - 25
0032 
0033   3. No trimming::
0034 
0035         Tc = T + 50
0036 
0037   Tc:
0038        Temperature code, T: Temperature,
0039   TI1:
0040        Trimming info for 25 degree Celsius (stored at TRIMINFO register)
0041        Temperature code measured at 25 degree Celsius which is unchanged
0042   TI2:
0043        Trimming info for 85 degree Celsius (stored at TRIMINFO register)
0044        Temperature code measured at 85 degree Celsius which is unchanged
0045 
0046 TMU(Thermal Management Unit) in Exynos4/5 generates interrupt
0047 when temperature exceeds pre-defined levels.
0048 The maximum number of configurable threshold is five.
0049 The threshold levels are defined as follows::
0050 
0051   Level_0: current temperature > trigger_level_0 + threshold
0052   Level_1: current temperature > trigger_level_1 + threshold
0053   Level_2: current temperature > trigger_level_2 + threshold
0054   Level_3: current temperature > trigger_level_3 + threshold
0055 
0056 The threshold and each trigger_level are set
0057 through the corresponding registers.
0058 
0059 When an interrupt occurs, this driver notify kernel thermal framework
0060 with the function exynos_report_trigger.
0061 Although an interrupt condition for level_0 can be set,
0062 it can be used to synchronize the cooling action.
0063 
0064 TMU driver description:
0065 -----------------------
0066 
0067 The exynos thermal driver is structured as::
0068 
0069                                         Kernel Core thermal framework
0070                                 (thermal_core.c, step_wise.c, cpufreq_cooling.c)
0071                                                                 ^
0072                                                                 |
0073                                                                 |
0074   TMU configuration data -----> TMU Driver  <----> Exynos Core thermal wrapper
0075   (exynos_tmu_data.c)         (exynos_tmu.c)       (exynos_thermal_common.c)
0076   (exynos_tmu_data.h)         (exynos_tmu.h)       (exynos_thermal_common.h)
0077 
0078 a) TMU configuration data:
0079                 This consist of TMU register offsets/bitfields
0080                 described through structure exynos_tmu_registers. Also several
0081                 other platform data (struct exynos_tmu_platform_data) members
0082                 are used to configure the TMU.
0083 b) TMU driver:
0084                 This component initialises the TMU controller and sets different
0085                 thresholds. It invokes core thermal implementation with the call
0086                 exynos_report_trigger.
0087 c) Exynos Core thermal wrapper:
0088                 This provides 3 wrapper function to use the
0089                 Kernel core thermal framework. They are exynos_unregister_thermal,
0090                 exynos_register_thermal and exynos_report_trigger.