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

Linux 6.18.37 · Hardware Monitoring

Kernel driver sbrmi

AMD APML SB-RMI 메일박스로 CPU 소켓 전력과 전력 상한을 관리합니다.

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

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

1. 요약·해설

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

요약·해설

sbrmi.rst:1-79

AMD 주소의 8비트·7비트 표기를 구분해 SB-RMI를 등록하고 현재 전력, 설정 상한, SMU 최대 상한을 마이크로와트로 다룹니다.

문서 개요
항목
SourceDocumentation/hwmon/sbrmi.rst
분량79 source lines
주소Socket 0 3Ch·Socket 1 38h
단위마이크로와트

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

운영 흐름
소켓 주소 결정sbrmi 등록hwmon 디렉터리 탐색현재·최대 전력 판독상한 설정

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

2. 영어 원문 전체

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

원문 전체 펼치기
1 .. SPDX-License-Identifier: GPL-2.0-or-later
2
3 Kernel driver sbrmi
4 ===================
5
6 Supported hardware:
7
8 * Sideband Remote Management Interface (SB-RMI) compliant AMD SoC
9 device connected to the BMC via the APML.
10
11 Prefix: 'sbrmi'
12
13 Addresses scanned: This driver doesn't support address scanning.
14
15 To instantiate this driver on an AMD CPU with SB-RMI
16 support, the i2c bus number would be the bus connected from the board
17 management controller (BMC) to the CPU.
18 The SMBus address is really 7 bits. Some vendors and the SMBus
19 specification show the address as 8 bits, left justified with the R/W
20 bit as a write (0) making bit 0. Some vendors use only the 7 bits
21 to describe the address.
22 As mentioned in AMD's APML specification, The SB-RMI address is
23 normally 78h(0111 100W) or 3Ch(011 1100) for socket 0 and 70h(0111 000W)
24 or 38h(011 1000) for socket 1, but it could vary based on hardware
25 address select pins.
26
27 Datasheet: The SB-RMI interface and protocol along with the Advanced
28 Platform Management Link (APML) Specification is available
29 as part of the open source SoC register reference at:
30
31 https://www.amd.com/en/support/tech-docs?keyword=55898
32
33 Author: Akshay Gupta <akshay.gupta@amd.com>
34
35 Description
36 -----------
37
38 The APML provides a way to communicate with the SB Remote Management interface
39 (SB-RMI) module from the external SMBus master that can be used to report socket
40 power on AMD platforms using mailbox command and resembles a typical 8-pin remote
41 power sensor's I2C interface to BMC.
42
43 This driver implements current power with power cap and power cap max.
44
45 sysfs-Interface
46 ---------------
47 Power sensors can be queried and set via the standard ``hwmon`` interface
48 on ``sysfs``, under the directory ``/sys/class/hwmon/hwmonX`` for some value
49 of ``X`` (search for the ``X`` such that ``/sys/class/hwmon/hwmonX/name`` has
50 content ``sbrmi``)
51
52 ================ ===== ========================================================
53 Name Perm Description
54 ================ ===== ========================================================
55 power1_input RO Current Power consumed
56 power1_cap RW Power limit can be set between 0 and power1_cap_max
57 power1_cap_max RO Maximum powerlimit calculated and reported by the SMU FW
58 ================ ===== ========================================================
59
60 The following example show how the 'Power' attribute from the i2c-addresses
61 can be monitored using the userspace utilities like ``sensors`` binary::
62
63 # sensors
64 sbrmi-i2c-1-38
65 Adapter: bcm2835 I2C adapter
66 power1: 61.00 W (cap = 225.00 W)
67
68 sbrmi-i2c-1-3c
69 Adapter: bcm2835 I2C adapter
70 power1: 28.39 W (cap = 224.77 W)
71 #
72
73 Also, Below shows how get and set the values from sysfs entries individually::
74 # cat /sys/class/hwmon/hwmon1/power1_cap_max
75 225000000
76
77 # echo 180000000 > /sys/class/hwmon/hwmon1/power1_cap
78 # cat /sys/class/hwmon/hwmon1/power1_cap
79 180000000
80

3. 한국어 전문 번역

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

AMD SB-RMI와 APML 주소 표기

1-34

GPL-2.0-or-later `sbrmi` 드라이버는 AMD SB-RMI 규격을 구현한 SoC를 지원합니다. BMC는 APML 인터페이스의 BMC-to-CPU I2C 버스를 통해 CPU 소켓의 SB-RMI 기능에 접근합니다. 드라이버 접두사는 `sbrmi`이며 주소 검색은 수행하지 않습니다.

SMBus에서 실제로 사용하는 주소는 7비트이지만 일부 AMD 문서는 주소를 왼쪽 정렬하고 최하위 읽기·쓰기 비트를 0으로 둔 8비트 값으로 표기합니다. 따라서 같은 물리 주소가 두 형태로 나타날 수 있습니다.

일반적인 APML 구성에서 소켓 0은 8비트 표기 `78h` 또는 7비트 표기 `3Ch`, 소켓 1은 `70h` 또는 `38h`입니다. 주소 선택 핀의 배선에 따라 실제 주소는 달라질 수 있으므로 플랫폼 회로도를 확인해야 합니다.

문서는 AMD Open-Source Register Reference와 APML 자료를 참고하도록 안내하며 작성자는 Akshay Gupta입니다.

SB-RMI 주소 대응
CPU 소켓8비트 표기비트 형태7비트 Linux 주소
Socket 078h0111 100W3Ch (011 1100)
Socket 170h0111 000W38h (011 1000)

AMD 문서의 8비트 표기와 Linux I2C의 7비트 주소를 구분합니다.

SB-RMI 주소 결정
플랫폼의 CPU 소켓 번호 확인주소 선택 핀 배선 확인AMD 자료가 8비트 표기인지 판별필요하면 최하위 R/W 비트를 제거해 7비트 변환sbrmi 장치를 해당 I2C 주소에 등록

문서의 표기 방식을 확인한 뒤 Linux가 요구하는 7비트 주소를 사용합니다.

.. SPDX-License-Identifier: GPL-2.0-or-later

Kernel driver sbrmi
===================

Supported hardware:

  * Sideband Remote Management Interface (SB-RMI) compliant AMD SoC
    device connected to the BMC via the APML.

    Prefix: 'sbrmi'

    Addresses scanned: This driver doesn't support address scanning.

    To instantiate this driver on an AMD CPU with SB-RMI
    support, the i2c bus number would be the bus connected from the board
    management controller (BMC) to the CPU.
    The SMBus address is really 7 bits. Some vendors and the SMBus
    specification show the address as 8 bits, left justified with the R/W
    bit as a write (0) making bit 0. Some vendors use only the 7 bits
    to describe the address.
    As mentioned in AMD's APML specification, The SB-RMI address is
    normally 78h(0111 100W) or 3Ch(011 1100) for socket 0 and 70h(0111 000W)
    or 38h(011 1000) for socket 1, but it could vary based on hardware
    address select pins.

    Datasheet: The SB-RMI interface and protocol along with the Advanced
               Platform Management Link (APML) Specification is available
               as part of the open source SoC register reference at:

               https://www.amd.com/en/support/tech-docs?keyword=55898

Author: Akshay Gupta <akshay.gupta@amd.com>

SB-RMI 메일박스 기반 소켓 전력 감시

35-59

APML은 외부 SMBus 마스터인 BMC가 CPU의 SB-RMI 메일박스와 통신하게 하는 인터페이스입니다. 기능적으로는 BMC I2C 버스에 연결된 8핀 원격 전력 센서와 비슷하지만, 실제 측정 및 제어 정보는 AMD CPU 소켓의 관리 펌웨어에서 제공됩니다.

드라이버는 현재 소켓 전력, 설정 가능한 전력 상한, SMU 펌웨어가 허용하는 최대 전력 상한을 지원합니다.

hwmon 장치는 `/sys/class/hwmon/hwmonX` 아래에 만들어집니다. 여러 hwmon 장치 중 `name` 파일의 값이 `sbrmi`인 디렉터리를 찾아야 합니다.

SB-RMI 전력 기능
기능방향설명
현재 전력RO소켓이 소비하는 현재 전력
전력 상한RW0부터 최대 상한까지 설정
최대 상한ROSMU 펌웨어가 보고한 허용 최대값

CPU 소켓 전력 관리에서 읽거나 설정할 수 있는 값입니다.

SB-RMI 전력 조회
BMC가 APML SMBus 요청 생성SB-RMI 메일박스에 명령 전달CPU SMU 펌웨어가 전력 값 제공sbrmi 드라이버가 hwmon 단위로 변환사용자 공간에 입력·상한·최대 상한 노출

BMC 요청이 SB-RMI 메일박스를 거쳐 SMU 전력 정보로 변환됩니다.

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

The APML provides a way to communicate with the SB Remote Management interface
(SB-RMI) module from the external SMBus master that can be used to report socket
power on AMD platforms using mailbox command and resembles a typical 8-pin remote
power sensor's I2C interface to BMC.

This driver implements current power with power cap and power cap max.

sysfs-Interface
---------------
Power sensors can be queried and set via the standard ``hwmon`` interface
on ``sysfs``, under the directory ``/sys/class/hwmon/hwmonX`` for some value
of ``X`` (search for the ``X`` such that ``/sys/class/hwmon/hwmonX/name`` has
content ``sbrmi``)

================ ===== ========================================================
Name             Perm   Description
================ ===== ========================================================
power1_input     RO    Current Power consumed
power1_cap       RW    Power limit can be set between 0 and power1_cap_max
power1_cap_max   RO    Maximum powerlimit calculated and reported by the SMU FW
================ ===== ========================================================

전력 입력과 상한 설정 예

60-79

`power1_input`은 읽기 전용이며 CPU 소켓의 현재 소비 전력을 표시합니다. `power1_cap`은 읽기·쓰기가 가능하고 0부터 `power1_cap_max`까지 설정할 수 있습니다. `power1_cap_max`는 SMU 펌웨어가 보고한 최대 전력 상한이며 읽기 전용입니다.

`sensors` 출력 예에서는 현재 전력이 약 61 W이고 상한은 225 W로 표시됩니다. 다른 예에서는 현재 전력이 28.39 W이고 상한은 224.77 W입니다.

sysfs 전력 속성은 마이크로와트 단위를 사용합니다. 예를 들어 최대 상한 `225000000`은 225 W이며, `power1_cap`에 `180000000`을 쓰면 상한을 180 W로 설정합니다.

sbrmi sysfs 속성
속성접근범위·단위의미
power1_inputRO마이크로와트현재 소켓 소비 전력
power1_capRW0~power1_cap_max, 마이크로와트설정 전력 상한
power1_cap_maxRO마이크로와트SMU 펌웨어의 최대 상한
225000000예시225 W최대 상한 예
180000000설정 예180 Wpower1_cap 기록값

소켓 전력의 측정값과 설정 가능한 제한값입니다.

전력 상한 변경
name 파일에서 sbrmi hwmon 디렉터리 찾기power1_input으로 현재 소비 전력 확인power1_cap_max로 허용 최대값 확인범위 안의 마이크로와트 값을 power1_cap에 기록power1_cap과 실제 전력 재확인

최대 허용값을 확인한 뒤 마이크로와트 단위로 새 상한을 기록합니다.

The following example show how the 'Power' attribute from the i2c-addresses
can be monitored using the userspace utilities like ``sensors`` binary::

  # sensors
  sbrmi-i2c-1-38
  Adapter: bcm2835 I2C adapter
  power1:       61.00 W (cap = 225.00 W)

  sbrmi-i2c-1-3c
  Adapter: bcm2835 I2C adapter
  power1:       28.39 W (cap = 224.77 W)
  #

Also, Below shows how get and set the values from sysfs entries individually::
  # cat /sys/class/hwmon/hwmon1/power1_cap_max
  225000000

  # echo 180000000 > /sys/class/hwmon/hwmon1/power1_cap
  # cat /sys/class/hwmon/hwmon1/power1_cap
  180000000