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

Linux 6.18.37 · Hardware Monitoring

Kernel driver nsa320

Zyxel NSA320 계열의 Holtek 기반 온도·팬 센서를 느린 32비트 GPIO 프로토콜로 읽습니다.

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

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

1. 요약·해설

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

요약·해설

nsa320.rst:1-64

칩 선택 펄스마다 0x55 마커, 팬 속도, 온도가 담긴 32비트 워드를 받고 엄격한 지연을 지켜 초당 한 번 갱신합니다.

문서 개요
항목
SourceDocumentation/hwmon/nsa320.rst
분량64 source lines
응답32비트
갱신최대 1회/초

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

운영 흐름
장치 인식100 ms 대기32비트 수신마커 검증온도·RPM 공개

장치 인식부터 측정·제어까지의 핵심 순서입니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 Kernel driver nsa320_hwmon
2 ==========================
3
4 Supported chips:
5
6 * Holtek HT46R065 microcontroller with onboard firmware that configures
7
8 it to act as a hardware monitor.
9
10 Prefix: 'nsa320'
11
12 Addresses scanned: none
13
14 Datasheet: Not available, driver was reverse engineered based upon the
15
16 Zyxel kernel source
17
18
19
20 Author:
21
22 Adam Baker <[email protected]>
23
24 Description
25 -----------
26
27 This chip is known to be used in the Zyxel NSA320 and NSA325 NAS Units and
28 also in some variants of the NSA310 but the driver has only been tested
29 on the NSA320. In all of these devices it is connected to the same 3 GPIO
30 lines which are used to provide chip select, clock and data lines. The
31 interface behaves similarly to SPI but at much lower speeds than are normally
32 used for SPI.
33
34 Following each chip select pulse the chip will generate a single 32 bit word
35 that contains 0x55 as a marker to indicate that data is being read correctly,
36 followed by an 8 bit fan speed in 100s of RPM and a 16 bit temperature in
37 tenths of a degree.
38
39
40 sysfs-Interface
41 ---------------
42
43 ============= =================
44 temp1_input temperature input
45 fan1_input fan speed
46 ============= =================
47
48 Notes
49 -----
50
51 The access timings used in the driver are the same as used in the Zyxel
52 provided kernel. Testing has shown that if the delay between chip select and
53 the first clock pulse is reduced from 100 ms to just under 10ms then the chip
54 will not produce any output. If the duration of either phase of the clock
55 is reduced from 100 us to less than 15 us then data pulses are likely to be
56 read twice corrupting the output. The above analysis is based upon a sample
57 of one unit but suggests that the Zyxel provided delay values include a
58 reasonable tolerance.
59
60 The driver incorporates a limit that it will not check for updated values
61 faster than once a second. This is because the hardware takes a relatively long
62 time to read the data from the device and when it does it reads both temp and
63 fan speed. As the most likely case for two accesses in quick succession is
64 to read both of these values avoiding a second read delay is desirable.
65

3. 한국어 전문 번역

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

NSA320 하드웨어 모니터의 배경과 지원 장치

1-23

이 문서는 하드웨어 모니터 역할을 하는 온보드 펌웨어가 탑재된 Holtek HT46R065 마이크로컨트롤러를 설명합니다. 드라이버 접두사는 `nsa320`이며, 장치 주소 검색은 지원하지 않습니다. 공개 데이터시트가 없기 때문에 이 드라이버는 Zyxel이 공개한 커널 소스를 역공학해 작성되었습니다.

이 장치는 Zyxel NSA320과 NSA325, 그리고 일부 NSA310 모델에서 사용됩니다. 다만 작성자가 실제로 시험한 장치는 NSA320뿐이므로 다른 모델의 동작은 같은 프로토콜을 사용한다는 전제에 기반합니다.

마이크로컨트롤러는 칩 선택, 클록, 데이터의 세 GPIO 선으로 호스트와 통신합니다. 신호 형태는 SPI와 비슷하지만 일반적인 SPI보다 훨씬 느린 타이밍을 사용하므로, 표준 SPI 전송처럼 빠르게 구동해서는 안 됩니다.

NSA320 지원 범위
항목내용
마이크로컨트롤러Holtek HT46R065
드라이버 접두사nsa320
주소 검색지원하지 않음
알려진 사용 장치Zyxel NSA320, NSA325, 일부 NSA310
실측 검증 장치Zyxel NSA320
통신선chip select, clock, data GPIO

드라이버의 출처와 검증 범위를 구분합니다.

NSA320 센서 연결
Holtek 펌웨어가 온도와 팬 속도 측정호스트가 chip select 활성화느린 clock으로 32비트 데이터 수신마커와 두 센서 값을 분리hwmon 속성으로 공개

온보드 펌웨어가 측정한 값을 세 GPIO 선을 통해 읽는 흐름입니다.

Kernel driver nsa320_hwmon
==========================

Supported chips:

  * Holtek HT46R065 microcontroller with onboard firmware that configures

        it to act as a hardware monitor.

    Prefix: 'nsa320'

    Addresses scanned: none

    Datasheet: Not available, driver was reverse engineered based upon the

        Zyxel kernel source



Author:

  Adam Baker <[email protected]>

32비트 응답 형식

24-39

칩 선택 신호를 한 번 펄스 형태로 주면 마이크로컨트롤러는 32비트 워드를 하나 출력합니다. 워드의 첫 8비트는 고정 마커 `0x55`이며, 다음 8비트는 팬 속도, 마지막 16비트는 온도입니다.

팬 속도 필드는 100 RPM 단위이므로 필드 값에 100을 곱해 실제 회전 속도를 얻습니다. 온도 필드는 섭씨 0.1도 단위이므로 정수 값을 10으로 나누거나 hwmon의 밀리도 단위로 변환해 제공합니다.

고정 마커는 전송 정렬과 응답 유효성을 확인하는 기준입니다. 마커가 `0x55`가 아니면 뒤의 팬 및 온도 필드를 정상 측정값으로 해석해서는 안 됩니다.

32비트 센서 워드
비트 구간크기의미단위
31..248비트고정 마커 0x55검증용
23..168비트팬 속도100 RPM
15..016비트온도0.1°C

칩 선택 펄스 하나에 대응하는 응답 배치입니다.

응답 해석 절차
chip select 펄스 생성32비트 워드 수신상위 바이트가 0x55인지 확인팬 필드에 100 RPM 배율 적용온도 필드를 섭씨 0.1도 단위로 변환

32비트 원시 워드를 hwmon 값으로 변환합니다.

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

This chip is known to be used in the Zyxel NSA320 and NSA325 NAS Units and
also in some variants of the NSA310 but the driver has only been tested
on the NSA320. In all of these devices it is connected to the same 3 GPIO
lines which are used to provide chip select, clock and data lines. The
interface behaves similarly to SPI but at much lower speeds than are normally
used for SPI.

Following each chip select pulse the chip will generate a single 32 bit word
that contains 0x55 as a marker to indicate that data is being read correctly,
followed by an 8 bit fan speed in 100s of RPM and a 16 bit temperature in
tenths of a degree.

엄격한 타이밍과 sysfs 값

40-64

이 장치는 일반적인 SPI보다 훨씬 긴 지연을 요구합니다. 칩 선택을 활성화한 뒤 첫 클록까지 약 100밀리초를 기다려야 하며, 이 지연을 10밀리초 바로 아래로 줄이면 장치가 아무 값도 출력하지 않았습니다.

각 클록 위상의 길이는 100마이크로초입니다. 약 15마이크로초보다 짧게 만들면 데이터 펄스를 두 번 읽는 현상이 발생해 출력이 손상될 수 있습니다. 이 수치는 단 한 대의 장치에서 분석한 결과이므로 모든 제조 편차의 절대 한계로 보아서는 안 됩니다.

`temp1_input`은 밀리도 섭씨 온도, `fan1_input`은 RPM 팬 속도를 읽기 전용으로 제공합니다. 한 번의 느린 읽기에서 두 값이 함께 오므로 드라이버는 결과를 캐시하며, 갱신 빈도는 최대 초당 한 번입니다.

NSA320 타이밍과 속성
항목의미
CS→첫 clock100 ms10 ms 미만에서는 출력이 사라질 수 있음
clock 위상100 µs15 µs 미만에서는 중복 판독 위험
temp1_inputRO, 밀리°C온도
fan1_inputRO, RPM팬 속도
최대 갱신 빈도1회/초느린 통합 읽기 결과를 캐시

통신 안정성에 필요한 지연과 공개 속성을 정리합니다.

안전한 측정 주기
최근 캐시 시각 확인1초 이내이면 캐시 반환chip select 후 100 ms 대기100 µs 위상으로 워드 수신온도와 팬 속도를 함께 캐시

장치 타이밍을 지키면서 두 센서 값을 함께 갱신합니다.

sysfs-Interface
---------------

============= =================
temp1_input   temperature input
fan1_input    fan speed
============= =================

Notes
-----

The access timings used in the driver are the same as used in the Zyxel
provided kernel. Testing has shown that if the delay between chip select and
the first clock pulse is reduced from 100 ms to just under 10ms then the chip
will not produce any output. If the duration of either phase of the clock
is reduced from 100 us to less than 15 us then data pulses are likely to be
read twice corrupting the output. The above analysis is based upon a sample
of one unit but suggests that the Zyxel provided delay values include a
reasonable tolerance.

The driver incorporates a limit that it will not check for updated values
faster than once a second. This is because the hardware takes a relatively long
time to read the data from the device and when it does it reads both temp and
fan speed. As the most likely case for two accesses in quick succession is
to read both of these values avoiding a second read delay is desirable.