← Documents Documentation/hwmon/sg2042-mcu.rst GitHub 원문 ↗

Linux 6.18.37 · Hardware Monitoring

Kernel driver sg2042-mcu

SG2042 보드 MCU의 온도·재설정 정보·재전원 정책과 debugfs 식별 값을 설명합니다.

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

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

1. 요약·해설

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

요약·해설

sg2042-mcu.rst:1-78

SoC와 베이스보드 온도를 감시하고 과열 종료 뒤 keep·repower 정책을 적용하며 MCU·PCB 버전을 진단합니다.

문서 개요
항목
SourceDocumentation/hwmon/sg2042-mcu.rst
분량78 source lines
온도SoC·베이스보드
정책keep·repower

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

운영 흐름
MCU 수동 등록온도·임계값 확인과열 종료히스테리시스 복귀재전원 정책 적용

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

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0
2
3 Kernel driver sg2042-mcu
4 ========================
5
6 Supported chips:
7
8 * Onboard MCU for sg2042
9
10 Addresses scanned: -
11
12 Prefix: 'sg2042-mcu'
13
14 Authors:
15
16 - Inochi Amaoto <[email protected]>
17
18 Description
19 -----------
20
21 This driver supprts hardware monitoring for onboard MCU with
22 i2c interface.
23
24 Usage Notes
25 -----------
26
27 This driver does not auto-detect devices. You will have to instantiate
28 the devices explicitly.
29 Please see Documentation/i2c/instantiating-devices.rst for details.
30
31 Sysfs Attributes
32 ----------------
33
34 The following table shows the standard entries support by the driver:
35
36 ================= =====================================================
37 Name Description
38 ================= =====================================================
39 temp1_input Measured temperature of SoC
40 temp1_crit Critical high temperature
41 temp1_crit_hyst hysteresis temperature restore from Critical
42 temp2_input Measured temperature of the base board
43 ================= =====================================================
44
45 The following table shows the extra entries support by the driver
46 (the MCU device is in i2c subsystem):
47
48 ================= ======= =============================================
49 Name Perm Description
50 ================= ======= =============================================
51 reset_count RO Reset count of the SoC
52 uptime RO Seconds after the MCU is powered
53 reset_reason RO Reset reason for the last reset
54 repower_policy RW Execution policy when triggering repower
55 ================= ======= =============================================
56
57 ``repower_policy``
58 The repower is triggered when the temperature of the SoC falls below
59 the hysteresis temperature after triggering a shutdown due to
60 reaching the critical temperature.
61 The valid values for this entry are "repower" and "keep". "keep" will
62 leave the SoC down when the triggering repower, and "repower" will
63 boot the SoC.
64
65 Debugfs Interfaces
66 ------------------
67
68 If debugfs is available, this driver exposes some hardware specific
69 data in ``/sys/kernel/debug/sg2042-mcu/*/``.
70
71 ================= ======= =============================================
72 Name Format Description
73 ================= ======= =============================================
74 firmware_version 0x%02x firmware version of the MCU
75 pcb_version 0x%02x version number of the base board
76 board_type 0x%02x identifiers for the base board
77 mcu_type %d type of the MCU: 0 is STM32, 1 is GD32
78 ================= ======= =============================================
79

3. 한국어 전문 번역

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

SG2042 온보드 MCU와 수동 등록

1-30

GPL-2.0 라이선스의 `sg2042-mcu` 드라이버는 SG2042 보드의 온보드 MCU가 I2C 인터페이스로 제공하는 하드웨어 모니터링 기능을 지원합니다. 주소 자동 검색은 하지 않으며 접두사는 `sg2042-mcu`입니다. 문서 작성자는 Inochi Amaoto입니다.

장치는 자동 감지되지 않으므로 사용자가 명시적으로 인스턴스를 만들어야 합니다. 구체적인 방법은 `Documentation/i2c/instantiating-devices.rst`를 참고합니다.

SG2042 MCU 기본 정보
항목
대상SG2042 온보드 MCU
인터페이스I2C
접두사sg2042-mcu
주소 검색없음
등록명시적 인스턴스 생성 필요

보드 관리 MCU의 연결과 등록 조건입니다.

SG2042 MCU 등록
보드의 MCU 모델과 주소 확인I2C 버스 번호 확인sg2042-mcu 인스턴스 생성hwmon 장치와 I2C 부가 속성 확인SoC·보드 온도 감시 시작

플랫폼이 알려 주는 버스와 주소로 MCU를 생성합니다.

.. SPDX-License-Identifier: GPL-2.0

Kernel driver sg2042-mcu
========================

Supported chips:

  * Onboard MCU for sg2042

    Addresses scanned: -

    Prefix: 'sg2042-mcu'

Authors:

  - Inochi Amaoto <[email protected]>

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

This driver supprts hardware monitoring for onboard MCU with
i2c interface.

Usage Notes
-----------

This driver does not auto-detect devices. You will have to instantiate
the devices explicitly.
Please see Documentation/i2c/instantiating-devices.rst for details.

온도·재부팅 상태와 재전원 정책

31-63

표준 hwmon 항목으로 `temp1_input`은 SoC 온도, `temp1_crit`은 임계 고온, `temp1_crit_hyst`는 임계 상태에서 복귀하는 히스테리시스 온도를 제공합니다. `temp2_input`은 베이스보드의 측정 온도입니다.

MCU는 I2C 서브시스템 장치 아래에 추가 속성도 제공합니다. `reset_count`는 SoC 재설정 횟수, `uptime`은 MCU에 전원이 공급된 뒤의 초 단위 시간, `reset_reason`은 마지막 재설정 이유이며 모두 읽기 전용입니다. `repower_policy`는 읽기·쓰기가 가능합니다.

SoC가 임계 온도에 도달해 종료된 뒤 온도가 히스테리시스 온도 아래로 내려가면 재전원 동작이 트리거됩니다. `repower_policy`의 유효 값은 `keep`과 `repower`입니다. `keep`은 SoC를 꺼진 상태로 유지하고 `repower`는 SoC를 다시 부팅합니다.

SG2042 MCU 속성
속성접근의미
temp1_inputROSoC 측정 온도
temp1_critROSoC 임계 고온
temp1_crit_hystRO임계 상태 복귀 히스테리시스 온도
temp2_inputRO베이스보드 측정 온도
reset_countROSoC 재설정 횟수
uptimeROMCU 전원 인가 후 경과 초
reset_reasonRO마지막 재설정 이유
repower_policyRWkeep 또는 repower

표준 온도 채널과 MCU 고유 관리 속성을 구분합니다.

과열 종료 후 정책
temp1_input이 temp1_crit에 도달MCU가 SoC 종료 트리거온도가 temp1_crit_hyst 아래로 하강repower_policy 값 확인keep은 정지 유지, repower는 SoC 부팅

임계 종료와 히스테리시스 복귀 뒤의 동작을 정책 값으로 결정합니다.

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

The following table shows the standard entries support by the driver:

================= =====================================================
Name              Description
================= =====================================================
temp1_input       Measured temperature of SoC
temp1_crit        Critical high temperature
temp1_crit_hyst   hysteresis temperature restore from Critical
temp2_input       Measured temperature of the base board
================= =====================================================

The following table shows the extra entries support by the driver
(the MCU device is in i2c subsystem):

================= ======= =============================================
Name              Perm    Description
================= ======= =============================================
reset_count       RO      Reset count of the SoC
uptime            RO      Seconds after the MCU is powered
reset_reason      RO      Reset reason for the last reset
repower_policy    RW      Execution policy when triggering repower
================= ======= =============================================

``repower_policy``
  The repower is triggered when the temperature of the SoC falls below
  the hysteresis temperature after triggering a shutdown due to
  reaching the critical temperature.
  The valid values for this entry are "repower" and "keep". "keep" will
  leave the SoC down when the triggering repower, and "repower" will
  boot the SoC.

MCU·베이스보드 식별용 debugfs

64-78

debugfs를 사용할 수 있으면 드라이버는 `/sys/kernel/debug/sg2042-mcu/*/` 아래에 하드웨어 고유 정보를 노출합니다.

`firmware_version`, `pcb_version`, `board_type`은 각각 MCU 펌웨어 버전, 베이스보드 PCB 버전, 베이스보드 식별자를 `0x%02x` 형식으로 표시합니다. `mcu_type`은 십진수이며 0은 STM32, 1은 GD32 MCU를 뜻합니다.

SG2042 debugfs 항목
항목형식의미
firmware_version0x%02xMCU 펌웨어 버전
pcb_version0x%02x베이스보드 PCB 버전
board_type0x%02x베이스보드 식별자
mcu_type%d0=STM32, 1=GD32

진단용 버전과 하드웨어 식별 값의 형식입니다.

보드 진단 정보 확인
debugfs 마운트 여부 확인sg2042-mcu 디렉터리 선택firmware_version 판독pcb_version·board_type 판독mcu_type으로 STM32·GD32 구분

debugfs 값으로 MCU 펌웨어와 보드 변형을 식별합니다.


Debugfs Interfaces
------------------

If debugfs is available, this driver exposes some hardware specific
data in ``/sys/kernel/debug/sg2042-mcu/*/``.

================= ======= =============================================
Name              Format  Description
================= ======= =============================================
firmware_version  0x%02x  firmware version of the MCU
pcb_version       0x%02x  version number of the base board
board_type        0x%02x  identifiers for the base board
mcu_type          %d      type of the MCU: 0 is STM32, 1 is GD32
================= ======= =============================================