요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
========================
Kernel driver exynos_tmu
========================
Supported chips:
* ARM Samsung Exynos4, Exynos5 series of SoC
Datasheet: Not publicly available
Authors: Donggeun Kim <[email protected]>
Authors: Amit Daniel <[email protected]>
TMU controller Description:
---------------------------
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(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.
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)
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.
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
exynos_tmu 커널 드라이버
1-15이 문서는 ARM Samsung Exynos4 및 Exynos5 SoC 계열의 `exynos_tmu` 커널 드라이버를 설명합니다.
해당 칩의 데이터시트는 공개되어 있지 않습니다. 문서 저자는 Donggeun Kim과 Amit Daniel입니다.
========================
Kernel driver exynos_tmu
========================
Supported chips:
* ARM Samsung Exynos4, Exynos5 series of SoC
Datasheet: Not publicly available
Authors: Donggeun Kim <[email protected]>
Authors: Amit Daniel <[email protected]>
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입니다.
`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-62Exynos4/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(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-77Exynos 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`와 연결합니다.
원문의 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-90TMU 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`를 제공합니다.
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.
요약·해설
exynos_thermal.rst:1-90Exynos4/5 TMU는 8-bit temperature code를 register로 노출하며 trimming 기준점으로 실제 온도와 코드를 변환합니다. 설정한 trigger level을 넘으면 `exynos_report_trigger`가 kernel thermal framework에 알리고, configuration data·TMU driver·core thermal wrapper가 이 경로를 구성합니다.