summaryrefslogtreecommitdiffstats
path: root/Documentation/hwmon
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-04-17 05:46:15 -0400
committerGuenter Roeck <linux@roeck-us.net>2019-04-17 12:50:32 -0400
commitb413e3fa7fb05a8eea42473456b863c3b2a5511d (patch)
tree63e1556335929bf43a5fe6c3f2e965aeb9b9d5e7 /Documentation/hwmon
parenta9fc881b9bac7c4ae1e8569ba93e8600ce1a1c09 (diff)
docs: hwmon: fam15h_power: convert to ReST format
Convert fam15h_power to ReST format, in order to allow it to be parsed by Sphinx. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'Documentation/hwmon')
-rw-r--r--Documentation/hwmon/fam15h_power85
1 files changed, 57 insertions, 28 deletions
diff --git a/Documentation/hwmon/fam15h_power b/Documentation/hwmon/fam15h_power
index fb594c281c46..fdde632c93a3 100644
--- a/Documentation/hwmon/fam15h_power
+++ b/Documentation/hwmon/fam15h_power
@@ -2,15 +2,20 @@ Kernel driver fam15h_power
2========================== 2==========================
3 3
4Supported chips: 4Supported chips:
5
5* AMD Family 15h Processors 6* AMD Family 15h Processors
7
6* AMD Family 16h Processors 8* AMD Family 16h Processors
7 9
8 Prefix: 'fam15h_power' 10 Prefix: 'fam15h_power'
11
9 Addresses scanned: PCI space 12 Addresses scanned: PCI space
13
10 Datasheets: 14 Datasheets:
11 BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors 15
12 BIOS and Kernel Developer's Guide (BKDG) For AMD Family 16h Processors 16 - BIOS and Kernel Developer's Guide (BKDG) For AMD Family 15h Processors
13 AMD64 Architecture Programmer's Manual Volume 2: System Programming 17 - BIOS and Kernel Developer's Guide (BKDG) For AMD Family 16h Processors
18 - AMD64 Architecture Programmer's Manual Volume 2: System Programming
14 19
15Author: Andreas Herrmann <herrmann.der.user@googlemail.com> 20Author: Andreas Herrmann <herrmann.der.user@googlemail.com>
16 21
@@ -31,14 +36,19 @@ For AMD Family 15h and 16h processors the following power values can
31be calculated using different processor northbridge function 36be calculated using different processor northbridge function
32registers: 37registers:
33 38
34* BasePwrWatts: Specifies in watts the maximum amount of power 39* BasePwrWatts:
35 consumed by the processor for NB and logic external to the core. 40 Specifies in watts the maximum amount of power
36* ProcessorPwrWatts: Specifies in watts the maximum amount of power 41 consumed by the processor for NB and logic external to the core.
37 the processor can support. 42
38* CurrPwrWatts: Specifies in watts the current amount of power being 43* ProcessorPwrWatts:
39 consumed by the processor. 44 Specifies in watts the maximum amount of power
45 the processor can support.
46* CurrPwrWatts:
47 Specifies in watts the current amount of power being
48 consumed by the processor.
40 49
41This driver provides ProcessorPwrWatts and CurrPwrWatts: 50This driver provides ProcessorPwrWatts and CurrPwrWatts:
51
42* power1_crit (ProcessorPwrWatts) 52* power1_crit (ProcessorPwrWatts)
43* power1_input (CurrPwrWatts) 53* power1_input (CurrPwrWatts)
44 54
@@ -53,35 +63,53 @@ calculate the average power consumed by a processor during a
53measurement interval Tm. The feature of accumulated power mechanism is 63measurement interval Tm. The feature of accumulated power mechanism is
54indicated by CPUID Fn8000_0007_EDX[12]. 64indicated by CPUID Fn8000_0007_EDX[12].
55 65
56* Tsample: compute unit power accumulator sample period 66* Tsample:
57* Tref: the PTSC counter period 67 compute unit power accumulator sample period
58* PTSC: performance timestamp counter 68
59* N: the ratio of compute unit power accumulator sample period to the 69* Tref:
60 PTSC period 70 the PTSC counter period
61* Jmax: max compute unit accumulated power which is indicated by 71
62 MaxCpuSwPwrAcc MSR C001007b 72* PTSC:
63* Jx/Jy: compute unit accumulated power which is indicated by 73 performance timestamp counter
64 CpuSwPwrAcc MSR C001007a 74
65* Tx/Ty: the value of performance timestamp counter which is indicated 75* N:
66 by CU_PTSC MSR C0010280 76 the ratio of compute unit power accumulator sample period to the
67* PwrCPUave: CPU average power 77 PTSC period
78
79* Jmax:
80 max compute unit accumulated power which is indicated by
81 MaxCpuSwPwrAcc MSR C001007b
82
83* Jx/Jy:
84 compute unit accumulated power which is indicated by
85 CpuSwPwrAcc MSR C001007a
86* Tx/Ty:
87 the value of performance timestamp counter which is indicated
88 by CU_PTSC MSR C0010280
89
90* PwrCPUave:
91 CPU average power
68 92
69i. Determine the ratio of Tsample to Tref by executing CPUID Fn8000_0007. 93i. Determine the ratio of Tsample to Tref by executing CPUID Fn8000_0007.
94
70 N = value of CPUID Fn8000_0007_ECX[CpuPwrSampleTimeRatio[15:0]]. 95 N = value of CPUID Fn8000_0007_ECX[CpuPwrSampleTimeRatio[15:0]].
71 96
72ii. Read the full range of the cumulative energy value from the new 97ii. Read the full range of the cumulative energy value from the new
73MSR MaxCpuSwPwrAcc. 98 MSR MaxCpuSwPwrAcc.
99
74 Jmax = value returned. 100 Jmax = value returned.
101
75iii. At time x, SW reads CpuSwPwrAcc MSR and samples the PTSC. 102iii. At time x, SW reads CpuSwPwrAcc MSR and samples the PTSC.
76 Jx = value read from CpuSwPwrAcc and Tx = value read from 103
77PTSC. 104 Jx = value read from CpuSwPwrAcc and Tx = value read from PTSC.
78 105
79iv. At time y, SW reads CpuSwPwrAcc MSR and samples the PTSC. 106iv. At time y, SW reads CpuSwPwrAcc MSR and samples the PTSC.
80 Jy = value read from CpuSwPwrAcc and Ty = value read from 107
81PTSC. 108 Jy = value read from CpuSwPwrAcc and Ty = value read from PTSC.
82 109
83v. Calculate the average power consumption for a compute unit over 110v. Calculate the average power consumption for a compute unit over
84time period (y-x). Unit of result is uWatt. 111 time period (y-x). Unit of result is uWatt::
112
85 if (Jy < Jx) // Rollover has occurred 113 if (Jy < Jx) // Rollover has occurred
86 Jdelta = (Jy + Jmax) - Jx 114 Jdelta = (Jy + Jmax) - Jx
87 else 115 else
@@ -90,13 +118,14 @@ time period (y-x). Unit of result is uWatt.
90 118
91This driver provides PwrCPUave and interval(default is 10 millisecond 119This driver provides PwrCPUave and interval(default is 10 millisecond
92and maximum is 1 second): 120and maximum is 1 second):
121
93* power1_average (PwrCPUave) 122* power1_average (PwrCPUave)
94* power1_average_interval (Interval) 123* power1_average_interval (Interval)
95 124
96The power1_average_interval can be updated at /etc/sensors3.conf file 125The power1_average_interval can be updated at /etc/sensors3.conf file
97as below: 126as below:
98 127
99chip "fam15h_power-*" 128chip `fam15h_power-*`
100 set power1_average_interval 0.01 129 set power1_average_interval 0.01
101 130
102Then save it with "sensors -s". 131Then save it with "sensors -s".