← Documents Documentation/hwmon/smsc47b397.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver smsc47b397

SMSC LPC47B397 계열의 HWM 포트, 온도·팬 레지스터, 구성 모드 사양을 보존합니다.

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

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

1. 요약·해설

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

요약·해설

smsc47b397.rst:1-197

공개 데이터시트가 없는 칩의 인덱스·데이터 포트, 온도·Tach 레지스터, RPM 식, Device ID와 HWM 기준 주소 판독 절차를 설명합니다.

문서 개요
항목
SourceDocumentation/hwmon/smsc47b397.rst
분량197 source lines
HWM 예시0x480·0x481
구성 포트0x2E·0x2F

원문 분량과 핵심 장치 구성을 정리합니다.

운영 흐름
구성 모드 진입Device ID 확인HWM 주소 획득온도 레지스터 판독Tach·RPM 계산

장치 식별부터 센서 확인까지의 핵심 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Kernel driver smsc47b397
2 ========================
3
4 Supported chips:
5
6 * SMSC LPC47B397-NC
7
8 * SMSC SCH5307-NS
9
10 * SMSC SCH5317
11
12 Prefix: 'smsc47b397'
13
14 Addresses scanned: none, address read from Super I/O config space
15
16 Datasheet: In this file
17
18 Authors:
19
20 - Mark M. Hoffman <mhoffman@lightlink.com>
21 - Utilitek Systems, Inc.
22
23 November 23, 2004
24
25 The following specification describes the SMSC LPC47B397-NC [1]_ sensor chip
26 (for which there is no public datasheet available). This document was
27 provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
28 by Mark M. Hoffman <mhoffman@lightlink.com>.
29
30 .. [1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are
31 otherwise compatible.
32
33 -------------------------------------------------------------------------
34
35 Methods for detecting the HP SIO and reading the thermal data on a dc7100
36 -------------------------------------------------------------------------
37
38 The thermal information on the dc7100 is contained in the SIO Hardware Monitor
39 (HWM). The information is accessed through an index/data pair. The index/data
40 pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The
41 HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
42 and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
43 0x480 and 0x481 for the index/data pair.
44
45 Reading temperature information.
46 The temperature information is located in the following registers:
47
48 =============== ======= =======================================================
49 Temp1 0x25 (Currently, this reflects the CPU temp on all systems).
50 Temp2 0x26
51 Temp3 0x27
52 Temp4 0x80
53 =============== ======= =======================================================
54
55 Programming Example
56 The following is an example of how to read the HWM temperature registers::
57
58 MOV DX,480H
59 MOV AX,25H
60 OUT DX,AL
61 MOV DX,481H
62 IN AL,DX
63
64 AL contains the data in hex, the temperature in Celsius is the decimal
65 equivalent.
66
67 Ex: If AL contains 0x2A, the temperature is 42 degrees C.
68
69 Reading tach information.
70 The fan speed information is located in the following registers:
71
72 =============== ======= ======= =================================
73 LSB MSB
74 Tach1 0x28 0x29 (Currently, this reflects the CPU
75 fan speed on all systems).
76 Tach2 0x2A 0x2B
77 Tach3 0x2C 0x2D
78 Tach4 0x2E 0x2F
79 =============== ======= ======= =================================
80
81 .. Important::
82
83 Reading the tach LSB locks the tach MSB.
84 The LSB Must be read first.
85
86 How to convert the tach reading to RPM
87 --------------------------------------
88
89 The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
90 The SIO counts the number of 90kHz (11.111us) pulses per revolution.
91 RPM = 60/(TCount * 11.111us)
92
93 Example::
94
95 Reg 0x28 = 0x9B
96 Reg 0x29 = 0x08
97
98 TCount = 0x89B = 2203
99
100 RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM
101
102 Obtaining the SIO version.
103
104 Configuration Sequence
105 ----------------------
106
107 To program the configuration registers, the following sequence must be followed:
108 1. Enter Configuration Mode
109 2. Configure the Configuration Registers
110 3. Exit Configuration Mode.
111
112 Enter Configuration Mode
113 ^^^^^^^^^^^^^^^^^^^^^^^^
114
115 To place the chip into the Configuration State The config key (0x55) is written
116 to the CONFIG PORT (0x2E).
117
118 Configuration Mode
119 ^^^^^^^^^^^^^^^^^^
120
121 In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
122 the DATA PORT is at INDEX PORT address + 1.
123
124 The desired configuration registers are accessed in two steps:
125
126 a. Write the index of the Logical Device Number Configuration Register
127 (i.e., 0x07) to the INDEX PORT and then write the number of the
128 desired logical device to the DATA PORT.
129
130 b. Write the address of the desired configuration register within the
131 logical device to the INDEX PORT and then write or read the config-
132 uration register through the DATA PORT.
133
134 Note:
135 If accessing the Global Configuration Registers, step (a) is not required.
136
137 Exit Configuration Mode
138 ^^^^^^^^^^^^^^^^^^^^^^^
139
140 To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
141 The chip returns to the RUN State. (This is important).
142
143 Programming Example
144 ^^^^^^^^^^^^^^^^^^^
145
146 The following is an example of how to read the SIO Device ID located at 0x20:
147
148 ; ENTER CONFIGURATION MODE
149 MOV DX,02EH
150 MOV AX,055H
151 OUT DX,AL
152 ; GLOBAL CONFIGURATION REGISTER
153 MOV DX,02EH
154 MOV AL,20H
155 OUT DX,AL
156 ; READ THE DATA
157 MOV DX,02FH
158 IN AL,DX
159 ; EXIT CONFIGURATION MODE
160 MOV DX,02EH
161 MOV AX,0AAH
162 OUT DX,AL
163
164 The registers of interest for identifying the SIO on the dc7100 are Device ID
165 (0x20) and Device Rev (0x21).
166
167 The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)
168 The Device Rev currently reads 0x01
169
170 Obtaining the HWM Base Address
171 ------------------------------
172
173 The following is an example of how to read the HWM Base Address located in
174 Logical Device 8::
175
176 ; ENTER CONFIGURATION MODE
177 MOV DX,02EH
178 MOV AX,055H
179 OUT DX,AL
180 ; CONFIGURE REGISTER CRE0,
181 ; LOGICAL DEVICE 8
182 MOV DX,02EH
183 MOV AL,07H
184 OUT DX,AL ;Point to LD# Config Reg
185 MOV DX,02FH
186 MOV AL, 08H
187 OUT DX,AL;Point to Logical Device 8
188 ;
189 MOV DX,02EH
190 MOV AL,60H
191 OUT DX,AL ; Point to HWM Base Addr MSB
192 MOV DX,02FH
193 IN AL,DX ; Get MSB of HWM Base Addr
194 ; EXIT CONFIGURATION MODE
195 MOV DX,02EH
196 MOV AX,0AAH
197 OUT DX,AL
198

3. 한국어 전문 번역

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

LPC47B397·SCH5307·SCH5317 호환 사양

1-32

`smsc47b397` 드라이버는 SMSC LPC47B397-NC, SCH5307-NS, SCH5317을 지원합니다. 접두사는 `smsc47b397`이고 주소는 자동 검색하지 않으며 Super I/O 구성 공간에서 읽습니다.

공개 데이터시트가 없어 이 문서 자체가 LPC47B397-NC 센서 칩의 사양을 제공합니다. Craig Kelly가 제공한 자료를 Mark M. Hoffman이 편집·수정했으며 Utilitek Systems가 함께 작성했습니다. 문서 날짜는 2004년 11월 23일입니다.

SCH5307-NS와 SCH5317은 장치 ID는 다르지만 나머지 동작은 호환됩니다.

smsc47b397 지원 칩
장치접두사주소호환성
LPC47B397-NCsmsc47b397Super I/O 구성 공간기준 장치
SCH5307-NSsmsc47b397Super I/O 구성 공간다른 ID, 그 외 호환
SCH5317smsc47b397Super I/O 구성 공간다른 ID, 그 외 호환

같은 센서 사양을 사용하는 세 Super I/O 장치입니다.

SMSC 장치 식별 준비
Super I/O 구성 포트 확인구성 모드 진입Device ID·Revision 판독지원 칩 ID와 비교Logical Device 8의 HWM 주소 획득

구성 공간의 장치 ID와 HWM 기준 주소를 이용합니다.

Kernel driver smsc47b397
========================

Supported chips:

  * SMSC LPC47B397-NC

  * SMSC SCH5307-NS

  * SMSC SCH5317

    Prefix: 'smsc47b397'

    Addresses scanned: none, address read from Super I/O config space

    Datasheet: In this file

Authors:

       - Mark M. Hoffman <mhoffman@lightlink.com>
       - Utilitek Systems, Inc.

November 23, 2004

The following specification describes the SMSC LPC47B397-NC [1]_ sensor chip
(for which there is no public datasheet available). This document was
provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
by Mark M. Hoffman <mhoffman@lightlink.com>.

.. [1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are
       otherwise compatible.

dc7100 HWM 기준 주소와 온도 레지스터

33-68

HP dc7100의 열 정보는 Super I/O 하드웨어 모니터(HWM)에 있으며 인덱스·데이터 포트 쌍으로 접근합니다. 인덱스는 HWM 기준 주소+0, 데이터는 기준 주소+1입니다.

HWM 기준 주소는 Logical Device 8의 `0x60`(MSB)과 `0x61`(LSB)에서 얻습니다. 예시 시스템은 기준 주소 `0x480`, 인덱스 포트 `0x480`, 데이터 포트 `0x481`을 사용합니다.

온도 레지스터는 Temp1 `0x25`, Temp2 `0x26`, Temp3 `0x27`, Temp4 `0x80`입니다. 현재 모든 시스템에서 Temp1은 CPU 온도를 반영합니다.

예제는 `0x480`에 인덱스 `0x25`를 쓰고 `0x481`에서 데이터를 읽습니다. AL의 16진수 값을 십진수로 해석한 것이 섭씨 온도이며 `0x2A`는 42°C입니다.

LPC47B397 온도 접근
항목주소의미
HWM 기준 주소 MSBLogical Device 8, 0x60기준 주소 상위 바이트
HWM 기준 주소 LSBLogical Device 8, 0x61기준 주소 하위 바이트
Temp10x25현재 모든 시스템의 CPU 온도
Temp20x26온도 2
Temp30x27온도 3
Temp40x80온도 4
예시 포트0x480 / 0x481인덱스 / 데이터

HWM 포트와 온도 레지스터를 대응시킵니다.

온도 레지스터 읽기
HWM 기준 주소 0x480 확인인덱스 포트 0x480에 0x25 기록데이터 포트 0x481에서 AL 판독16진수 AL을 십진수로 변환예: 0x2A를 42°C로 보고

인덱스 포트로 레지스터를 고른 뒤 데이터 포트에서 섭씨 값을 읽습니다.

-------------------------------------------------------------------------

Methods for detecting the HP SIO and reading the thermal data on a dc7100
-------------------------------------------------------------------------

The thermal information on the dc7100 is contained in the SIO Hardware Monitor
(HWM). The information is accessed through an index/data pair. The index/data
pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The
HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
0x480 and 0x481 for the index/data pair.

Reading temperature information.
The temperature information is located in the following registers:

=============== ======= =======================================================
Temp1                0x25        (Currently, this reflects the CPU temp on all systems).
Temp2                0x26
Temp3                0x27
Temp4                0x80
=============== ======= =======================================================

Programming Example
The following is an example of how to read the HWM temperature registers::

        MOV        DX,480H
        MOV        AX,25H
        OUT        DX,AL
        MOV        DX,481H
        IN        AL,DX

AL contains the data in hex, the temperature in Celsius is the decimal
equivalent.

Ex: If AL contains 0x2A, the temperature is 42 degrees C.

팬 카운터 원자 판독과 RPM 계산

69-101

팬 속도 카운터는 Tach1 LSB/MSB `0x28/0x29`, Tach2 `0x2A/0x2B`, Tach3 `0x2C/0x2D`, Tach4 `0x2E/0x2F`에 있습니다. 현재 모든 시스템에서 Tach1은 CPU 팬 속도입니다.

Tach LSB를 읽으면 대응하는 MSB가 잠기므로 반드시 LSB를 먼저 읽어야 일관된 16비트 카운터를 얻습니다.

카운터 `TCount`는 `(Tach MSB × 256) + Tach LSB`입니다. SIO는 회전당 90 kHz, 즉 11.111 µs 펄스 수를 세므로 `RPM = 60 / (TCount × 11.111 µs)`입니다.

예제에서 `0x28=0x9B`, `0x29=0x08`이므로 `TCount=0x089B=2203`이고 계산된 속도는 2451 RPM입니다.

LPC47B397 Tach 레지스터
LSBMSB비고
Tach10x280x29CPU 팬, LSB 먼저
Tach20x2A0x2BLSB 먼저
Tach30x2C0x2DLSB 먼저
Tach40x2E0x2FLSB 먼저

각 팬 카운터의 LSB·MSB와 판독 순서입니다.

Tach에서 RPM 계산
Tach LSB 먼저 판독잠긴 Tach MSB 판독TCount = MSB×256 + LSB 계산RPM = 60/(TCount×11.111µs) 계산예: TCount 2203 → 2451 RPM

하위 바이트 판독으로 상위 바이트를 잠근 뒤 90 kHz 주기를 적용합니다.

Reading tach information.
The fan speed information is located in the following registers:

=============== ======= ======= =================================
                LSB        MSB
Tach1                0x28        0x29        (Currently, this reflects the CPU
                                fan speed on all systems).
Tach2                0x2A        0x2B
Tach3                0x2C        0x2D
Tach4                0x2E        0x2F
=============== ======= ======= =================================

.. Important::

        Reading the tach LSB locks the tach MSB.
        The LSB Must be read first.

How to convert the tach reading to RPM
--------------------------------------

The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
The SIO counts the number of 90kHz (11.111us) pulses per revolution.
RPM = 60/(TCount * 11.111us)

Example::

        Reg 0x28 = 0x9B
        Reg 0x29 = 0x08

TCount = 0x89B = 2203

RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM

Super I/O 구성 모드 진입·접근·종료

102-142

구성 레지스터를 프로그래밍하려면 1) 구성 모드 진입, 2) 구성 레지스터 설정, 3) 구성 모드 종료 순서를 따라야 합니다.

구성 모드에 들어가려면 구성 키 `0x55`를 CONFIG PORT `0x2E`에 씁니다. 구성 모드에서는 INDEX PORT가 CONFIG PORT와 같은 `0x2E`, DATA PORT는 그다음 주소 `0x2F`입니다.

논리 장치 레지스터 접근은 두 단계입니다. 먼저 논리 장치 번호 구성 레지스터의 인덱스 `0x07`을 INDEX PORT에 쓰고 원하는 논리 장치 번호를 DATA PORT에 씁니다. 이어서 대상 구성 레지스터 주소를 INDEX PORT에 쓰고 DATA PORT를 통해 값을 읽거나 씁니다.

전역 구성 레지스터에 접근할 때는 논리 장치 선택 단계가 필요 없습니다. 구성 상태를 끝내려면 `0xAA`를 CONFIG PORT `0x2E`에 써서 칩을 RUN 상태로 되돌려야 하며, 이 종료 단계는 중요합니다.

Super I/O 구성 포트
단계포트·값동작
진입0x2E ← 0x55구성 모드 진입
논리 장치 선택INDEX 0x2E ← 0x07LDN 레지스터 선택
논리 장치 번호DATA 0x2F ← LDN대상 논리 장치 선택
레지스터 선택INDEX 0x2E ← 주소대상 구성 레지스터 선택
데이터 접근DATA 0x2F읽기 또는 쓰기
종료0x2E ← 0xAARUN 상태 복귀

구성 모드의 키·포트·논리 장치 선택 절차입니다.

구성 레지스터 접근
0x2E에 0x55를 써 구성 모드 진입필요하면 0x07로 논리 장치 선택대상 레지스터 인덱스 기록0x2F에서 데이터 읽기·쓰기0x2E에 0xAA를 써 반드시 종료

진입 키부터 RUN 상태 복귀까지 순서를 보장합니다.

Obtaining the SIO version.

Configuration Sequence
----------------------

To program the configuration registers, the following sequence must be followed:
1. Enter Configuration Mode
2. Configure the Configuration Registers
3. Exit Configuration Mode.

Enter Configuration Mode
^^^^^^^^^^^^^^^^^^^^^^^^

To place the chip into the Configuration State The config key (0x55) is written
to the CONFIG PORT (0x2E).

Configuration Mode
^^^^^^^^^^^^^^^^^^

In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
the DATA PORT is at INDEX PORT address + 1.

The desired configuration registers are accessed in two steps:

a.        Write the index of the Logical Device Number Configuration Register
        (i.e., 0x07) to the INDEX PORT and then write the number of the
        desired logical device to the DATA PORT.

b.        Write the address of the desired configuration register within the
        logical device to the INDEX PORT and then write or read the config-
        uration register through the DATA PORT.

Note:
        If accessing the Global Configuration Registers, step (a) is not required.

Exit Configuration Mode
^^^^^^^^^^^^^^^^^^^^^^^

To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
The chip returns to the RUN State.  (This is important).

Device ID와 Revision 판독 예

143-169

SIO Device ID는 전역 구성 레지스터 `0x20`에 있습니다. 예제는 `0x2E`에 `0x55`를 써 진입하고, `0x20`을 인덱스로 선택한 뒤 `0x2F`에서 데이터를 읽고, 마지막으로 `0x2E`에 `0xAA`를 써 종료합니다.

dc7100에서 식별에 필요한 레지스터는 Device ID `0x20`과 Device Revision `0x21`입니다.

Device ID는 LPC47B397-NC에서 `0x6F`, SCH5307-NS에서 `0x81`, SCH5317에서 `0x85`입니다. 현재 Device Revision 값은 `0x01`입니다.

SMSC 장치 식별 값
항목·칩레지스터
Device ID0x20칩별 값
Device Revision0x21현재 0x01
LPC47B397-NCDevice ID0x6F
SCH5307-NSDevice ID0x81
SCH5317Device ID0x85

전역 구성 레지스터와 지원 칩별 Device ID입니다.

Device ID 읽기
0x2E에 0x55 기록0x2E에 인덱스 0x20 기록0x2F에서 Device ID 판독0x6F·0x81·0x85와 비교0x2E에 0xAA 기록 후 종료

전역 레지스터는 논리 장치 선택 없이 읽습니다.

Programming Example
^^^^^^^^^^^^^^^^^^^

The following is an example of how to read the SIO Device ID located at 0x20:

        ; ENTER CONFIGURATION MODE
        MOV        DX,02EH
        MOV        AX,055H
        OUT        DX,AL
        ; GLOBAL CONFIGURATION  REGISTER
        MOV        DX,02EH
        MOV        AL,20H
        OUT        DX,AL
        ; READ THE DATA
        MOV        DX,02FH
        IN        AL,DX
        ; EXIT CONFIGURATION MODE
        MOV        DX,02EH
        MOV        AX,0AAH
        OUT        DX,AL

The registers of interest for identifying the SIO on the dc7100 are Device ID
(0x20) and Device Rev  (0x21).

The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)
The Device Rev currently reads 0x01

Logical Device 8의 HWM 기준 주소

170-197

HWM 기준 주소는 Logical Device 8에 있습니다. 예제는 구성 모드에 들어간 뒤 인덱스 `0x07`을 선택하고 데이터 포트에 `0x08`을 써 Logical Device 8을 지정합니다.

그다음 인덱스 포트에 `0x60`을 써 HWM 기준 주소의 MSB 레지스터를 선택하고 데이터 포트에서 상위 바이트를 읽습니다. 전체 기준 주소를 얻으려면 이어서 `0x61`의 LSB도 같은 방식으로 읽어 결합합니다.

작업을 마치면 `0x2E`에 `0xAA`를 써 구성 모드를 종료해야 합니다.

HWM 기준 주소 레지스터
항목
Logical Device Number 레지스터0x07
HWM 논리 장치8 (0x08)
HWM Base MSB0x60
HWM Base LSB0x61
구성 종료 키0xAA

논리 장치 선택과 주소 바이트 위치입니다.

HWM 기준 주소 획득
0x55로 구성 모드 진입0x07 레지스터에 LDN 0x08 선택0x60에서 기준 주소 MSB 판독0x61에서 기준 주소 LSB 판독주소 결합 후 0xAA로 RUN 상태 복귀

Logical Device 8을 선택해 상·하위 주소 바이트를 결합합니다.

Obtaining the HWM Base Address
------------------------------

The following is an example of how to read the HWM Base Address located in
Logical Device 8::

        ; ENTER CONFIGURATION MODE
        MOV        DX,02EH
        MOV        AX,055H
        OUT        DX,AL
        ; CONFIGURE REGISTER CRE0,
        ; LOGICAL DEVICE 8
        MOV        DX,02EH
        MOV        AL,07H
        OUT        DX,AL ;Point to LD# Config Reg
        MOV        DX,02FH
        MOV        AL, 08H
        OUT        DX,AL;Point to Logical Device 8
        ;
        MOV        DX,02EH
        MOV        AL,60H
        OUT        DX,AL        ; Point to HWM Base Addr MSB
        MOV        DX,02FH
        IN        AL,DX        ; Get MSB of HWM Base Addr
        ; EXIT CONFIGURATION MODE
        MOV        DX,02EH
        MOV        AX,0AAH
        OUT        DX,AL