← Documents Documentation/hwmon/bt1-pvt.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver bt1-pvt

Baikal-T1의 온도 1개·전압 4개 PVT sensor와 compile-time alarm trade-off입니다.

Source pathDocumentation/hwmon/bt1-pvt.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약·해설

bt1-pvt.rst:1-117

단일 conversion engine에서 PVT sensor를 순환하며 alarm을 선택적으로 제공하거나 on-demand 측정합니다.

문서 개요
항목
SourceDocumentation/hwmon/bt1-pvt.rst
분량117 source lines
SensorsTemperature 1 + voltage 4
AlarmCompile-time configurable

원문 분량과 핵심 지원 범위입니다.

핵심 흐름
Sensor 선택10-bit conversionScaling·offset 적용Limit와 alarm 갱신

장치를 측정하는 기본 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-only
2
3 Kernel driver bt1-pvt
4 =====================
5
6 Supported chips:
7
8 * Baikal-T1 PVT sensor (in SoC)
9
10 Prefix: 'bt1-pvt'
11
12 Addresses scanned: -
13
14 Datasheet: Provided by BAIKAL ELECTRONICS upon request and under NDA
15
16 Authors:
17 Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
18 Serge Semin <Sergey.Semin@baikalelectronics.ru>
19
20 Description
21 -----------
22
23 This driver implements support for the hardware monitoring capabilities of the
24 embedded into Baikal-T1 process, voltage and temperature sensors. PVT IP-core
25 consists of one temperature and four voltage sensors, which can be used to
26 monitor the chip internal environment like heating, supply voltage and
27 transistors performance. The driver can optionally provide the hwmon alarms
28 for each sensor the PVT controller supports. The alarms functionality is made
29 compile-time configurable due to the hardware interface implementation
30 peculiarity, which is connected with an ability to convert data from only one
31 sensor at a time. Additional limitation is that the controller performs the
32 thresholds checking synchronously with the data conversion procedure. Due to
33 these in order to have the hwmon alarms automatically detected the driver code
34 must switch from one sensor to another, read converted data and manually check
35 the threshold status bits. Depending on the measurements timeout settings
36 (update_interval sysfs node value) this design may cause additional burden on
37 the system performance. So in case if alarms are unnecessary in your system
38 design it's recommended to have them disabled to prevent the PVT IRQs being
39 periodically raised to get the data cache/alarms status up to date. By default
40 in alarm-less configuration the data conversion is performed by the driver
41 on demand when read operation is requested via corresponding _input-file.
42
43 Temperature Monitoring
44 ----------------------
45
46 Temperature is measured with 10-bit resolution and reported in millidegree
47 Celsius. The driver performs all the scaling by itself therefore reports true
48 temperatures that don't need any user-space adjustments. While the data
49 translation formulae isn't linear, which gives us non-linear discreteness,
50 it's close to one, but giving a bit better accuracy for higher temperatures.
51 The temperature input is mapped as follows (the last column indicates the input
52 ranges)::
53
54 temp1: CPU embedded diode -48.38C - +147.438C
55
56 In case if the alarms kernel config is enabled in the driver the temperature input
57 has associated min and max limits which trigger an alarm when crossed.
58
59 Voltage Monitoring
60 ------------------
61
62 The voltage inputs are also sampled with 10-bit resolution and reported in
63 millivolts. But in this case the data translation formulae is linear, which
64 provides a constant measurements discreteness. The data scaling is also
65 performed by the driver, so returning true millivolts. The voltage inputs are
66 mapped as follows (the last column indicates the input ranges)::
67
68 in0: VDD (processor core) 0.62V - 1.168V
69 in1: Low-Vt (low voltage threshold) 0.62V - 1.168V
70 in2: High-Vt (high voltage threshold) 0.62V - 1.168V
71 in3: Standard-Vt (standard voltage threshold) 0.62V - 1.168V
72
73 In case if the alarms config is enabled in the driver the voltage inputs
74 have associated min and max limits which trigger an alarm when crossed.
75
76 Sysfs Attributes
77 ----------------
78
79 Following is a list of all sysfs attributes that the driver provides, their
80 permissions and a short description:
81
82 =============================== ======= =======================================
83 Name Perm Description
84 =============================== ======= =======================================
85 update_interval RW Measurements update interval per
86 sensor.
87 temp1_type RO Sensor type (always 1 as CPU embedded
88 diode).
89 temp1_label RO CPU Core Temperature sensor.
90 temp1_input RO Measured temperature in millidegree
91 Celsius.
92 temp1_min RW Low limit for temp input.
93 temp1_max RW High limit for temp input.
94 temp1_min_alarm RO Temperature input alarm. Returns 1 if
95 temperature input went below min limit,
96 0 otherwise.
97 temp1_max_alarm RO Temperature input alarm. Returns 1 if
98 temperature input went above max limit,
99 0 otherwise.
100 temp1_offset RW Temperature offset in millidegree
101 Celsius which is added to the
102 temperature reading by the chip. It can
103 be used to manually adjust the
104 temperature measurements within 7.130
105 degrees Celsius.
106 in[0-3]_label RO CPU Voltage sensor (either core or
107 low/high/standard thresholds).
108 in[0-3]_input RO Measured voltage in millivolts.
109 in[0-3]_min RW Low limit for voltage input.
110 in[0-3]_max RW High limit for voltage input.
111 in[0-3]_min_alarm RO Voltage input alarm. Returns 1 if
112 voltage input went below min limit,
113 0 otherwise.
114 in[0-3]_max_alarm RO Voltage input alarm. Returns 1 if
115 voltage input went above max limit,
116 0 otherwise.
117 =============================== ======= =======================================
118

3. 한국어 전문 번역

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

Baikal-T1 PVT와 alarm 비용

1-42

이 GPL-2.0-only driver는 SoC에 내장된 `Baikal-T1 PVT sensor`를 prefix `bt1-pvt`로 지원합니다. 주소 검색은 없고 datasheet는 BAIKAL ELECTRONICS가 NDA 아래 요청 시 제공합니다. 저자는 Maxim Kaurkin과 Serge Semin입니다.

PVT IP core는 temperature sensor 1개와 voltage sensor 4개로 구성되며 chip 내부 heating, supply voltage, transistor performance를 monitoring합니다. 각 sensor의 hwmon alarm을 선택적으로 제공할 수 있습니다.

Alarm 기능은 compile-time configurable입니다. Hardware는 한 번에 sensor 하나의 data만 변환할 수 있고 threshold check도 conversion과 동기적으로 수행합니다. 자동 alarm 탐지를 하려면 driver가 sensor를 차례로 전환하고 converted data를 읽은 뒤 threshold status bit를 수동 검사해야 합니다.

이 방식은 `update_interval`에 따라 system performance에 추가 부담을 줄 수 있습니다. Alarm이 필요하지 않다면 disable하여 data cache와 alarm status 갱신을 위한 PVT IRQ가 주기적으로 발생하지 않게 하는 것이 좋습니다. 기본 alarm-less configuration에서는 대응 `_input` file을 읽을 때 on-demand conversion을 수행합니다.

PVT alarm 동작
구성Conversion영향
Alarm enabledSensor 순환 + threshold bit 검사Periodic IRQ와 성능 부담
Alarm disabled_input read 시 on-demand불필요한 주기 동작 없음
동시 측정불가, 한 번에 sensor 1개Driver가 순차 전환

단일 conversion engine 때문에 alarm mode에 polling 비용이 생깁니다.

Alarm-enabled polling
Sensor 하나 선택Conversion 수행값과 threshold status 읽기다음 sensor로 전환Alarm과 cache 갱신 후 반복

모든 sensor의 threshold를 software가 순차 검사합니다.

.. SPDX-License-Identifier: GPL-2.0-only

Kernel driver bt1-pvt
=====================

Supported chips:

  * Baikal-T1 PVT sensor (in SoC)

    Prefix: 'bt1-pvt'

    Addresses scanned: -

    Datasheet: Provided by BAIKAL ELECTRONICS upon request and under NDA

Authors:
    Maxim Kaurkin <maxim.kaurkin@baikalelectronics.ru>
    Serge Semin <Sergey.Semin@baikalelectronics.ru>

Description
-----------

This driver implements support for the hardware monitoring capabilities of the
embedded into Baikal-T1 process, voltage and temperature sensors. PVT IP-core
consists of one temperature and four voltage sensors, which can be used to
monitor the chip internal environment like heating, supply voltage and
transistors performance. The driver can optionally provide the hwmon alarms
for each sensor the PVT controller supports. The alarms functionality is made
compile-time configurable due to the hardware interface implementation
peculiarity, which is connected with an ability to convert data from only one
sensor at a time. Additional limitation is that the controller performs the
thresholds checking synchronously with the data conversion procedure. Due to
these in order to have the hwmon alarms automatically detected the driver code
must switch from one sensor to another, read converted data and manually check
the threshold status bits. Depending on the measurements timeout settings
(update_interval sysfs node value) this design may cause additional burden on
the system performance. So in case if alarms are unnecessary in your system
design it's recommended to have them disabled to prevent the PVT IRQs being
periodically raised to get the data cache/alarms status up to date. By default
in alarm-less configuration the data conversion is performed by the driver
on demand when read operation is requested via corresponding _input-file.

Temperature와 voltage 측정

43-75

Temperature는 10-bit resolution으로 측정하고 millidegree Celsius로 보고합니다. Driver가 scaling을 모두 수행하므로 userspace 보정이 필요 없는 실제 temperature를 반환합니다.

Data translation formula는 비선형이어서 discreteness도 비선형이지만 거의 일정하며 높은 temperature에서 조금 더 나은 accuracy를 제공합니다. `temp1`은 CPU embedded diode이고 측정 범위는 `-48.38C`부터 `+147.438C`입니다. Alarm kernel config가 enabled이면 min/max limit와 crossing alarm이 생깁니다.

Voltage input도 10-bit resolution으로 sampling하고 millivolts로 보고합니다. 이 변환식은 선형이라 measurement discreteness가 일정하며 driver가 실제 millivolt로 scaling합니다.

`in0`은 processor core `VDD`, `in1`은 `Low-Vt`, `in2`는 `High-Vt`, `in3`은 `Standard-Vt`입니다. 네 채널 모두 범위는 `0.62V`부터 `1.168V`입니다. Alarm config가 enabled이면 min/max limit와 crossing alarm을 제공합니다.

Baikal-T1 PVT 입력
채널대상범위변환
temp1CPU embedded diode-48.38C~+147.438C10-bit, 비선형
in0VDD processor core0.62V~1.168V10-bit, 선형
in1Low-Vt0.62V~1.168V10-bit, 선형
in2High-Vt0.62V~1.168V10-bit, 선형
in3Standard-Vt0.62V~1.168V10-bit, 선형

센서 identity, 범위, 변환 특성입니다.

PVT scaling
Sensor 선택 후 10-bit conversionTemperature면 비선형 formula 적용Voltage면 선형 formula 적용실제 mC 또는 mV로 변환Enabled 시 min/max와 비교

Raw 10-bit sample을 실제 온도 또는 전압으로 변환합니다.

Temperature Monitoring
----------------------

Temperature is measured with 10-bit resolution and reported in millidegree
Celsius. The driver performs all the scaling by itself therefore reports true
temperatures that don't need any user-space adjustments. While the data
translation formulae isn't linear, which gives us non-linear discreteness,
it's close to one, but giving a bit better accuracy for higher temperatures.
The temperature input is mapped as follows (the last column indicates the input
ranges)::

        temp1: CPU embedded diode        -48.38C - +147.438C

In case if the alarms kernel config is enabled in the driver the temperature input
has associated min and max limits which trigger an alarm when crossed.

Voltage Monitoring
------------------

The voltage inputs are also sampled with 10-bit resolution and reported in
millivolts. But in this case the data translation formulae is linear, which
provides a constant measurements discreteness. The data scaling is also
performed by the driver, so returning true millivolts. The voltage inputs are
mapped as follows (the last column indicates the input ranges)::

        in0: VDD                (processor core)                0.62V - 1.168V
        in1: Low-Vt                (low voltage threshold)                0.62V - 1.168V
        in2: High-Vt                (high voltage threshold)        0.62V - 1.168V
        in3: Standard-Vt        (standard voltage threshold)        0.62V - 1.168V

In case if the alarms config is enabled in the driver the voltage inputs
have associated min and max limits which trigger an alarm when crossed.

Baikal-T1 PVT sysfs

76-117

Read/write `update_interval`은 sensor당 measurement update interval입니다. Read-only `temp1_type`은 CPU embedded diode를 뜻하는 1로 고정되고 `temp1_label`은 CPU Core Temperature sensor입니다.

`temp1_input`은 millidegree Celsius measured temperature입니다. Read/write `temp1_min`, `temp1_max`는 low/high limit입니다. Read-only `temp1_min_alarm`은 input이 min 아래로 내려가면 1, `temp1_max_alarm`은 max 위로 올라가면 1을 반환합니다.

Read/write `temp1_offset`은 chip이 reading에 더하는 millidegree Celsius offset이며 최대 7.130 degree Celsius 범위 안에서 manual adjustment에 사용할 수 있습니다.

Read-only `in[0-3]_label`은 core 또는 low/high/standard threshold CPU Voltage sensor 이름이고 `in[0-3]_input`은 millivolt 측정값입니다. Read/write min/max limit와 read-only min/max alarm을 제공하며 범위를 넘으면 alarm이 1입니다.

BT1 PVT ABI
Attribute권한의미
update_intervalRWSensor별 update interval
temp1_type/label/inputROCPU diode type·label·mC
temp1_min/maxRWTemperature limit
temp1_min/max_alarmROLimit crossing indicator
temp1_offsetRW최대 7.130C manual adjustment
in[0-3]_input/min/max/alarmRO/RW/RW/ROmV와 voltage limit

권한과 alarm-enabled 조건을 정리합니다.

Sysfs read와 alarm
Alarm config 확인Disabled면 _input read에서 conversionEnabled면 update_interval마다 순환Offset과 scaling 적용Input 및 alarm attribute 반환

Configuration에 따라 on-demand 또는 periodic conversion을 사용합니다.

Sysfs Attributes
----------------

Following is a list of all sysfs attributes that the driver provides, their
permissions and a short description:

=============================== ======= =======================================
Name                                Perm        Description
=============================== ======= =======================================
update_interval                        RW        Measurements update interval per
                                        sensor.
temp1_type                        RO        Sensor type (always 1 as CPU embedded
                                        diode).
temp1_label                        RO        CPU Core Temperature sensor.
temp1_input                        RO        Measured temperature in millidegree
                                        Celsius.
temp1_min                        RW        Low limit for temp input.
temp1_max                        RW        High limit for temp input.
temp1_min_alarm                        RO        Temperature input alarm. Returns 1 if
                                        temperature input went below min limit,
                                        0 otherwise.
temp1_max_alarm                        RO        Temperature input alarm. Returns 1 if
                                        temperature input went above max limit,
                                        0 otherwise.
temp1_offset                        RW        Temperature offset in millidegree
                                        Celsius which is added to the
                                        temperature reading by the chip. It can
                                        be used to manually adjust the
                                        temperature measurements within 7.130
                                        degrees Celsius.
in[0-3]_label                        RO        CPU Voltage sensor (either core or
                                        low/high/standard thresholds).
in[0-3]_input                        RO        Measured voltage in millivolts.
in[0-3]_min                        RW        Low limit for voltage input.
in[0-3]_max                        RW        High limit for voltage input.
in[0-3]_min_alarm                RO        Voltage input alarm. Returns 1 if
                                        voltage input went below min limit,
                                        0 otherwise.
in[0-3]_max_alarm                RO        Voltage input alarm. Returns 1 if
                                        voltage input went above max limit,
                                        0 otherwise.
=============================== ======= =======================================