Documentation/driver-api/thermal/exynos_thermal.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

Exynos TMU 커널 드라이버

Exynos4/5 TMU의 temperature code 변환식, interrupt threshold, driver 구성 요소와 kernel thermal framework 연결을 설명하는 한국어 전문 번역입니다.

Source pathDocumentation/driver-api/thermal/exynos_thermal.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

exynos_thermal.rst:1-90

Exynos4/5 TMU는 8-bit temperature code를 register로 노출하며 trimming 기준점으로 실제 온도와 코드를 변환합니다. 설정한 trigger level을 넘으면 `exynos_report_trigger`가 kernel thermal framework에 알리고, configuration data·TMU driver·core thermal wrapper가 이 경로를 구성합니다.

문서 구성
원문 줄핵심 내용
1-15지원 칩과 문서 정보
16-44Two point, one point, no trimming 변환식
45-62Threshold level과 interrupt 전달
63-77TMU driver ASCII 구성도
78-90세 구성 요소와 wrapper function

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

exynos_tmu 커널 드라이버

1-15

이 문서는 ARM Samsung Exynos4 및 Exynos5 SoC 계열의 `exynos_tmu` 커널 드라이버를 설명합니다.

해당 칩의 데이터시트는 공개되어 있지 않습니다. 문서 저자는 Donggeun Kim과 Amit Daniel입니다.

지원 범위와 문서 정보
항목내용
드라이버`exynos_tmu`
지원 칩ARM Samsung Exynos4, Exynos5 series of SoC
데이터시트공개되지 않음
저자Donggeun Kim, Amit Daniel

========================
Kernel driver exynos_tmu
========================

Supported chips:

* ARM Samsung Exynos4, Exynos5 series of SoC

  Datasheet: Not publicly available

Authors: Donggeun Kim <dg77.kim@samsung.com>
Authors: Amit Daniel <amit.daniel@samsung.com>

TMU controller Description:
---------------------------

온도 코드와 trimming 변환식

16-44

이 드라이버를 사용하면 Samsung Exynos4/5 SoC 내부 온도를 읽을 수 있습니다. 칩은 레지스터를 통해 측정된 8-bit temperature code 값만 노출하며, 실제 온도는 이 코드에서 계산합니다.

Temperature `T`를 temperature code `Tc`로 변환하는 식은 trimming 정보의 수에 따라 세 가지입니다. Two point trimming은 25도와 85도에서 측정한 두 기준점을 선형 보간하고, one point trimming은 25도 기준점 하나를 보정하며, trimming 정보가 없으면 고정 offset 50을 더합니다.

`TI1`은 `TRIMINFO` register에 저장된 25 degree Celsius의 trimming 정보이며, 25도에서 측정되어 변하지 않는 temperature code입니다. `TI2`는 같은 레지스터에 저장된 85 degree Celsius의 trimming 정보이며, 85도에서 측정되어 변하지 않는 temperature code입니다.

Temperature에서 temperature code로 변환
Trimming 방식변환식사용 기준점
Two point trimming`Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1``TI1`(25°C), `TI2`(85°C)
One point trimming`Tc = T + TI1 - 25``TI1`(25°C)
No trimming`Tc = T + 50`고정 offset 50

`Tc`는 temperature code이고 `T`는 temperature입니다.


This driver allows to read temperature inside Samsung Exynos4/5 series of SoC.

The chip only exposes the measured 8-bit temperature code value
through a register.
Temperature can be taken from the temperature code.
There are three equations converting from temperature to temperature code.

The three equations are:
  1. Two point trimming::

        Tc = (T - 25) * (TI2 - TI1) / (85 - 25) + TI1

  2. One point trimming::

        Tc = T + TI1 - 25

  3. No trimming::

        Tc = T + 50

  Tc:
       Temperature code, T: Temperature,
  TI1:
       Trimming info for 25 degree Celsius (stored at TRIMINFO register)
       Temperature code measured at 25 degree Celsius which is unchanged
  TI2:
       Trimming info for 85 degree Celsius (stored at TRIMINFO register)
       Temperature code measured at 85 degree Celsius which is unchanged

TMU threshold와 interrupt

45-62

Exynos4/5의 TMU(Thermal Management Unit)는 온도가 사전에 정의한 level을 넘으면 interrupt를 생성합니다. 설정할 수 있는 threshold의 최대 수는 5개입니다.

각 level의 조건은 `current temperature > trigger_level_n + threshold`입니다. `threshold`와 각 `trigger_level`은 대응하는 register를 통해 설정합니다.

Interrupt가 발생하면 드라이버는 `exynos_report_trigger` 함수를 호출해 kernel thermal framework에 알립니다. `level_0`의 interrupt 조건도 설정할 수 있으며, cooling action을 동기화하는 데 사용할 수 있습니다.

TMU trigger level 조건
LevelInterrupt 조건
`Level_0``current temperature > trigger_level_0 + threshold`
`Level_1``current temperature > trigger_level_1 + threshold`
`Level_2``current temperature > trigger_level_2 + threshold`
`Level_3``current temperature > trigger_level_3 + threshold`


TMU(Thermal Management Unit) in Exynos4/5 generates interrupt
when temperature exceeds pre-defined levels.
The maximum number of configurable threshold is five.
The threshold levels are defined as follows::

  Level_0: current temperature > trigger_level_0 + threshold
  Level_1: current temperature > trigger_level_1 + threshold
  Level_2: current temperature > trigger_level_2 + threshold
  Level_3: current temperature > trigger_level_3 + threshold

The threshold and each trigger_level are set
through the corresponding registers.

When an interrupt occurs, this driver notify kernel thermal framework
with the function exynos_report_trigger.
Although an interrupt condition for level_0 can be set,
it can be used to synchronize the cooling action.

Exynos thermal driver 구조

63-77

Exynos thermal driver는 TMU configuration data, TMU Driver, Exynos Core thermal wrapper의 세 부분으로 구성됩니다.

TMU configuration data는 `exynos_tmu_data.c`와 `exynos_tmu_data.h`에서 TMU Driver에 입력됩니다. TMU Driver는 `exynos_tmu.c`와 `exynos_tmu.h`에 있으며 Exynos Core thermal wrapper와 양방향으로 연동합니다.

Exynos Core thermal wrapper는 `exynos_thermal_common.c`와 `exynos_thermal_common.h`에 있으며, TMU Driver를 Kernel Core thermal framework의 `thermal_core.c`, `step_wise.c`, `cpufreq_cooling.c`와 연결합니다.

Exynos TMU driver 구성
TMU configuration data (`exynos_tmu_data.c`, `exynos_tmu_data.h`)TMU Driver (`exynos_tmu.c`, `exynos_tmu.h`)
TMU Driver (`exynos_tmu.c`, `exynos_tmu.h`)Exynos Core thermal wrapper (`exynos_thermal_common.c`, `exynos_thermal_common.h`)
Exynos Core thermal wrapperTMU Driver
TMU DriverKernel Core thermal framework (`thermal_core.c`, `step_wise.c`, `cpufreq_cooling.c`)

원문의 ASCII 구성도를 같은 연결 관계의 구조화 흐름도로 다시 그렸습니다.


TMU driver description:
-----------------------

The exynos thermal driver is structured as::

                                        Kernel Core thermal framework
                                (thermal_core.c, step_wise.c, cpufreq_cooling.c)
                                                                ^
                                                                |
                                                                |
  TMU configuration data -----> TMU Driver  <----> Exynos Core thermal wrapper
  (exynos_tmu_data.c)              (exynos_tmu.c)           (exynos_thermal_common.c)
  (exynos_tmu_data.h)              (exynos_tmu.h)           (exynos_thermal_common.h)

구성 요소별 역할

78-90

TMU configuration data는 `exynos_tmu_registers` 구조체로 설명되는 TMU register offset과 bitfield로 이루어집니다. 여러 `struct exynos_tmu_platform_data` member도 TMU 설정에 사용됩니다.

TMU driver는 TMU controller를 초기화하고 서로 다른 threshold를 설정합니다. 이어 `exynos_report_trigger`를 호출해 core thermal 구현을 실행합니다.

Exynos Core thermal wrapper는 Kernel core thermal framework를 사용하기 위한 세 wrapper function인 `exynos_unregister_thermal`, `exynos_register_thermal`, `exynos_report_trigger`를 제공합니다.

Exynos thermal 구성 요소
구성 요소주요 파일 또는 symbol역할
TMU configuration data`exynos_tmu_registers`, `struct exynos_tmu_platform_data`Register offset, bitfield 및 platform data 제공
TMU driver`exynos_tmu.c`, `exynos_report_trigger`Controller 초기화, threshold 설정, core thermal 호출
Exynos Core thermal wrapper`exynos_unregister_thermal`, `exynos_register_thermal`, `exynos_report_trigger`Kernel core thermal framework용 wrapper 제공

a) TMU configuration data:
                This consist of TMU register offsets/bitfields
                described through structure exynos_tmu_registers. Also several
                other platform data (struct exynos_tmu_platform_data) members
                are used to configure the TMU.
b) TMU driver:
                This component initialises the TMU controller and sets different
                thresholds. It invokes core thermal implementation with the call
                exynos_report_trigger.
c) Exynos Core thermal wrapper:
                This provides 3 wrapper function to use the
                Kernel core thermal framework. They are exynos_unregister_thermal,
                exynos_register_thermal and exynos_report_trigger.