← Documents Documentation/devicetree/bindings/powerpc/opal/power-mgt.txt GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

IBM POWER Management

POWER8·POWER9 idle-state flag, latency, residency, PSSCR와 PMICR binding입니다.

Source pathDocumentation/devicetree/bindings/powerpc/opal/power-mgt.txt
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

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

1. 요약·해설

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

요약과 해설

power-mgt.txt:1-118

Idle-state 배열 index와 generation별 register 차이를 정리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 IBM Power-Management Bindings
2 =============================
3
4 Linux running on baremetal POWER machines has access to the processor
5 idle states. The description of these idle states is exposed via the
6 node @power-mgt in the device-tree by the firmware.
7
8 Definitions:
9 ----------------
10 Typically each idle state has the following associated properties:
11
12 - name: The name of the idle state as defined by the firmware.
13
14 - flags: indicating some aspects of this idle states such as the
15 extent of state-loss, whether timebase is stopped on this
16 idle states and so on. The flag bits are as follows:
17
18 - exit-latency: The latency involved in transitioning the state of the
19 CPU from idle to running.
20
21 - target-residency: The minimum time that the CPU needs to reside in
22 this idle state in order to accrue power-savings
23 benefit.
24
25 Properties
26 ----------------
27 The following properties provide details about the idle states. These
28 properties are exposed as arrays. Each entry in the property array
29 provides the value of that property for the idle state associated with
30 the array index of that entry.
31
32 If idle-states are defined, then the properties
33 "ibm,cpu-idle-state-names" and "ibm,cpu-idle-state-flags" are
34 required. The other properties are required unless mentioned
35 otherwise. The length of all the property arrays must be the same.
36
37 - ibm,cpu-idle-state-names:
38 Array of strings containing the names of the idle states.
39
40 - ibm,cpu-idle-state-flags:
41 Array of unsigned 32-bit values containing the values of the
42 flags associated with the aforementioned idle-states. The
43 flag bits are as follows:
44 0x00000001 /* Decrementer would stop */
45 0x00000002 /* Needs timebase restore */
46 0x00001000 /* Restore GPRs like nap */
47 0x00002000 /* Restore hypervisor resource from PACA pointer */
48 0x00004000 /* Program PORE to restore PACA pointer */
49 0x00010000 /* This is a nap state (POWER7,POWER8) */
50 0x00020000 /* This is a fast-sleep state (POWER8)*/
51 0x00040000 /* This is a winkle state (POWER8) */
52 0x00080000 /* This is a fast-sleep state which requires a */
53 /* software workaround for restoring the */
54 /* timebase (POWER8) */
55 0x00800000 /* This state uses SPR PMICR instruction */
56 /* (POWER8)*/
57 0x00100000 /* This is a fast stop state (POWER9) */
58 0x00200000 /* This is a deep-stop state (POWER9) */
59
60 - ibm,cpu-idle-state-latencies-ns:
61 Array of unsigned 32-bit values containing the values of the
62 exit-latencies (in ns) for the idle states in
63 ibm,cpu-idle-state-names.
64
65 - ibm,cpu-idle-state-residency-ns:
66 Array of unsigned 32-bit values containing the values of the
67 target-residency (in ns) for the idle states in
68 ibm,cpu-idle-state-names. On POWER8 this is an optional
69 property. If the property is absent, the target residency for
70 the "Nap", "FastSleep" are defined to 10000 and 300000000
71 respectively by the kernel. On POWER9 this property is required.
72
73 - ibm,cpu-idle-state-psscr:
74 Array of unsigned 64-bit values containing the values for the
75 PSSCR for each of the idle states in ibm,cpu-idle-state-names.
76 This property is required on POWER9 and absent on POWER8.
77
78 - ibm,cpu-idle-state-psscr-mask:
79 Array of unsigned 64-bit values containing the masks
80 indicating which psscr fields are set in the corresponding
81 entries of ibm,cpu-idle-state-psscr. This property is
82 required on POWER9 and absent on POWER8.
83
84 Whenever the firmware sets an entry in
85 ibm,cpu-idle-state-psscr-mask value to 0xf, it implies that
86 only the Requested Level (RL) field of the corresponding entry
87 in ibm,cpu-idle-state-psscr should be considered by the
88 kernel. For such idle states, the kernel would set the
89 remaining fields of the psscr to the following sane-default
90 values.
91
92 - ESL and EC bits are to 1. So wakeup from any stop
93 state will be at vector 0x100.
94
95 - MTL and PSLL are set to the maximum allowed value as
96 per the ISA, i.e. 15.
97
98 - The Transition Rate, TR is set to the Maximum value
99 3.
100
101 For all the other values of the entry in
102 ibm,cpu-idle-state-psscr-mask, the kernel expects all the
103 psscr fields of the corresponding entry in
104 ibm,cpu-idle-state-psscr to be correctly set by the firmware.
105
106 - ibm,cpu-idle-state-pmicr:
107 Array of unsigned 64-bit values containing the pmicr values
108 for the idle states in ibm,cpu-idle-state-names. This 64-bit
109 register value is to be set in pmicr for the corresponding
110 state if the flag indicates that pmicr SPR should be set. This
111 is an optional property on POWER8 and is absent on
112 POWER9.
113
114 - ibm,cpu-idle-state-pmicr-mask:
115 Array of unsigned 64-bit values containing the mask indicating
116 which of the fields of the PMICR are set in the corresponding
117 entries in ibm,cpu-idle-state-pmicr. This is an optional
118 property on POWER8 and is absent on POWER9.
119

3. 한국어 전문 번역

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

POWER idle-state 정의

1-24

Bare-metal POWER machine의 Linux는 processor idle state에 접근하며 firmware는 device tree의 `@power-mgt` node로 이를 노출합니다. 각 state에는 firmware가 정한 `name`, state-loss·timebase stop 등을 나타내는 `flags`, idle에서 running으로 전환하는 `exit-latency`, power saving을 얻기 위한 최소 체류 시간 `target-residency`가 연결됩니다.

Idle-state 배열과 flag

25-59

Property는 배열이며 같은 index의 entry들이 하나의 idle state를 설명합니다. Idle state가 있으면 `ibm,cpu-idle-state-names`와 `ibm,cpu-idle-state-flags`가 필수이고, 별도 언급이 없는 다른 property도 필수입니다. 모든 배열 길이는 같아야 합니다.

`ibm,cpu-idle-state-names`는 이름 string 배열이고 `ibm,cpu-idle-state-flags`는 u32 flag 배열입니다.

Flag의미
0x00000001Decrementer stop
0x00000002Timebase restore 필요
0x00001000Nap처럼 GPR restore
0x00002000PACA pointer에서 hypervisor resource restore
0x00004000PACA pointer restore를 위해 PORE program
0x00010000POWER7·POWER8 nap state
0x00020000POWER8 fast-sleep state
0x00040000POWER8 winkle state
0x00080000Timebase restore software workaround가 필요한 POWER8 fast-sleep
0x00800000POWER8 SPR PMICR instruction 사용
0x00100000POWER9 fast stop state
0x00200000POWER9 deep-stop state

Latency·residency·PSSCR

60-83

`ibm,cpu-idle-state-latencies-ns`는 state별 u32 exit latency를 ns로 담습니다. `ibm,cpu-idle-state-residency-ns`는 u32 target residency를 ns로 담으며 POWER8에서는 선택, POWER9에서는 필수입니다. POWER8에서 없으면 kernel은 Nap을 10000, FastSleep을 300000000으로 정합니다.

`ibm,cpu-idle-state-psscr`는 state별 u64 PSSCR 값이고 `ibm,cpu-idle-state-psscr-mask`는 대응 PSSCR에서 설정된 field를 나타내는 u64 mask입니다. 둘 다 POWER9에서는 필수이고 POWER8에는 없습니다.

PSSCR mask 기본값

84-105

Firmware가 `ibm,cpu-idle-state-psscr-mask` entry를 0xf로 설정하면 kernel은 대응 PSSCR의 Requested Level(RL)만 고려합니다. 나머지 field는 ESL·EC=1로 두어 stop-state wakeup vector를 0x100으로 하고, MTL·PSLL은 ISA 최대값 15, Transition Rate(TR)는 최대값 3으로 설정합니다.

Mask entry가 0xf가 아니면 kernel은 대응 `ibm,cpu-idle-state-psscr`의 모든 field가 firmware에 의해 올바르게 설정되어 있다고 기대합니다.

POWER8 PMICR

106-118

`ibm,cpu-idle-state-pmicr`는 flag가 PMICR SPR 설정을 요구할 때 state별로 PMICR에 쓸 u64 값을 담습니다. `ibm,cpu-idle-state-pmicr-mask`는 대응 PMICR entry에서 설정된 field를 나타내는 u64 mask입니다. 둘 다 POWER8에서는 선택 property이고 POWER9에는 없습니다.