xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/w83627ehf.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunKernel driver w83627ehf
2*4882a593Smuzhiyun=======================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunSupported chips:
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun  * Winbond W83627EHF/EHG (ISA access ONLY)
7*4882a593Smuzhiyun
8*4882a593Smuzhiyun    Prefix: 'w83627ehf'
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
11*4882a593Smuzhiyun
12*4882a593Smuzhiyun    Datasheet: not available
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun  * Winbond W83627DHG
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun    Prefix: 'w83627dhg'
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
19*4882a593Smuzhiyun
20*4882a593Smuzhiyun    Datasheet: not available
21*4882a593Smuzhiyun
22*4882a593Smuzhiyun  * Winbond W83627DHG-P
23*4882a593Smuzhiyun
24*4882a593Smuzhiyun    Prefix: 'w83627dhg'
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun    Datasheet: not available
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun  * Winbond W83627UHG
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun    Prefix: 'w83627uhg'
33*4882a593Smuzhiyun
34*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun    Datasheet: available from www.nuvoton.com
37*4882a593Smuzhiyun
38*4882a593Smuzhiyun  * Winbond W83667HG
39*4882a593Smuzhiyun
40*4882a593Smuzhiyun    Prefix: 'w83667hg'
41*4882a593Smuzhiyun
42*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
43*4882a593Smuzhiyun
44*4882a593Smuzhiyun    Datasheet: not available
45*4882a593Smuzhiyun
46*4882a593Smuzhiyun  * Winbond W83667HG-B
47*4882a593Smuzhiyun
48*4882a593Smuzhiyun    Prefix: 'w83667hg'
49*4882a593Smuzhiyun
50*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
51*4882a593Smuzhiyun
52*4882a593Smuzhiyun    Datasheet: Available from Nuvoton upon request
53*4882a593Smuzhiyun
54*4882a593Smuzhiyun  * Nuvoton NCT6775F/W83667HG-I
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun    Prefix: 'nct6775'
57*4882a593Smuzhiyun
58*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
59*4882a593Smuzhiyun
60*4882a593Smuzhiyun    Datasheet: Available from Nuvoton upon request
61*4882a593Smuzhiyun
62*4882a593Smuzhiyun  * Nuvoton NCT6776F
63*4882a593Smuzhiyun
64*4882a593Smuzhiyun    Prefix: 'nct6776'
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun    Addresses scanned: ISA address retrieved from Super I/O registers
67*4882a593Smuzhiyun
68*4882a593Smuzhiyun    Datasheet: Available from Nuvoton upon request
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun
71*4882a593SmuzhiyunAuthors:
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun	- Jean Delvare <jdelvare@suse.de>
74*4882a593Smuzhiyun	- Yuan Mu (Winbond)
75*4882a593Smuzhiyun	- Rudolf Marek <r.marek@assembler.cz>
76*4882a593Smuzhiyun	- David Hubbard <david.c.hubbard@gmail.com>
77*4882a593Smuzhiyun	- Gong Jun <JGong@nuvoton.com>
78*4882a593Smuzhiyun
79*4882a593SmuzhiyunDescription
80*4882a593Smuzhiyun-----------
81*4882a593Smuzhiyun
82*4882a593SmuzhiyunThis driver implements support for the Winbond W83627EHF, W83627EHG,
83*4882a593SmuzhiyunW83627DHG, W83627DHG-P, W83627UHG, W83667HG, W83667HG-B, W83667HG-I
84*4882a593Smuzhiyun(NCT6775F), and NCT6776F super I/O chips. We will refer to them collectively
85*4882a593Smuzhiyunas Winbond chips.
86*4882a593Smuzhiyun
87*4882a593SmuzhiyunThe chips implement 3 to 4 temperature sensors (9 for NCT6775F and NCT6776F),
88*4882a593Smuzhiyun2 to 5 fan rotation speed sensors, 8 to 10 analog voltage sensors, one VID
89*4882a593Smuzhiyun(except for 627UHG), alarms with beep warnings (control unimplemented),
90*4882a593Smuzhiyunand some automatic fan regulation strategies (plus manual fan control mode).
91*4882a593Smuzhiyun
92*4882a593SmuzhiyunThe temperature sensor sources on W82677HG-B, NCT6775F, and NCT6776F are
93*4882a593Smuzhiyunconfigurable. temp4 and higher attributes are only reported if its temperature
94*4882a593Smuzhiyunsource differs from the temperature sources of the already reported temperature
95*4882a593Smuzhiyunsensors. The configured source for each of the temperature sensors is provided
96*4882a593Smuzhiyunin tempX_label.
97*4882a593Smuzhiyun
98*4882a593SmuzhiyunTemperatures are measured in degrees Celsius and measurement resolution is 1
99*4882a593SmuzhiyundegC for temp1 and 0.5 degC for temp2 and temp3. For temp4 and higher,
100*4882a593Smuzhiyunresolution is 1 degC for W83667HG-B and 0.0 degC for NCT6775F and NCT6776F.
101*4882a593SmuzhiyunAn alarm is triggered when the temperature gets higher than high limit;
102*4882a593Smuzhiyunit stays on until the temperature falls below the hysteresis value.
103*4882a593SmuzhiyunAlarms are only supported for temp1, temp2, and temp3.
104*4882a593Smuzhiyun
105*4882a593SmuzhiyunFan rotation speeds are reported in RPM (rotations per minute). An alarm is
106*4882a593Smuzhiyuntriggered if the rotation speed has dropped below a programmable limit. Fan
107*4882a593Smuzhiyunreadings can be divided by a programmable divider (1, 2, 4, 8, 16, 32, 64 or
108*4882a593Smuzhiyun128) to give the readings more range or accuracy. The driver sets the most
109*4882a593Smuzhiyunsuitable fan divisor itself. Some fans might not be present because they
110*4882a593Smuzhiyunshare pins with other functions.
111*4882a593Smuzhiyun
112*4882a593SmuzhiyunVoltage sensors (also known as IN sensors) report their values in millivolts.
113*4882a593SmuzhiyunAn alarm is triggered if the voltage has crossed a programmable minimum
114*4882a593Smuzhiyunor maximum limit.
115*4882a593Smuzhiyun
116*4882a593SmuzhiyunThe driver supports automatic fan control mode known as Thermal Cruise.
117*4882a593SmuzhiyunIn this mode, the chip attempts to keep the measured temperature in a
118*4882a593Smuzhiyunpredefined temperature range. If the temperature goes out of range, fan
119*4882a593Smuzhiyunis driven slower/faster to reach the predefined range again.
120*4882a593Smuzhiyun
121*4882a593SmuzhiyunThe mode works for fan1-fan4. Mapping of temperatures to pwm outputs is as
122*4882a593Smuzhiyunfollows::
123*4882a593Smuzhiyun
124*4882a593Smuzhiyun  temp1 -> pwm1
125*4882a593Smuzhiyun  temp2 -> pwm2
126*4882a593Smuzhiyun  temp3 -> pwm3 (not on 627UHG)
127*4882a593Smuzhiyun  prog  -> pwm4 (not on 667HG and 667HG-B; the programmable setting is not
128*4882a593Smuzhiyun		 supported by the driver)
129*4882a593Smuzhiyun
130*4882a593Smuzhiyun/sys files
131*4882a593Smuzhiyun----------
132*4882a593Smuzhiyun
133*4882a593Smuzhiyunname
134*4882a593Smuzhiyun	this is a standard hwmon device entry, it contains the name of
135*4882a593Smuzhiyun	the device (see the prefix in the list of supported devices at
136*4882a593Smuzhiyun	the top of this file)
137*4882a593Smuzhiyun
138*4882a593Smuzhiyunpwm[1-4]
139*4882a593Smuzhiyun	this file stores PWM duty cycle or DC value (fan speed) in range:
140*4882a593Smuzhiyun
141*4882a593Smuzhiyun	   0 (stop) to 255 (full)
142*4882a593Smuzhiyun
143*4882a593Smuzhiyunpwm[1-4]_enable
144*4882a593Smuzhiyun	this file controls mode of fan/temperature control:
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun	* 1 Manual mode, write to pwm file any value 0-255 (full speed)
147*4882a593Smuzhiyun	* 2 "Thermal Cruise" mode
148*4882a593Smuzhiyun	* 3 "Fan Speed Cruise" mode
149*4882a593Smuzhiyun	* 4 "Smart Fan III" mode
150*4882a593Smuzhiyun	* 5 "Smart Fan IV" mode
151*4882a593Smuzhiyun
152*4882a593Smuzhiyun	SmartFan III mode is not supported on NCT6776F.
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun	SmartFan IV mode is configurable only if it was configured at system
155*4882a593Smuzhiyun	startup, and is only supported for W83677HG-B, NCT6775F, and NCT6776F.
156*4882a593Smuzhiyun	SmartFan IV operational parameters can not be configured at this time,
157*4882a593Smuzhiyun	and the various pwm attributes are not used in SmartFan IV mode.
158*4882a593Smuzhiyun	The attributes can be written to, which is useful if you plan to
159*4882a593Smuzhiyun	configure the system for a different pwm mode. However, the information
160*4882a593Smuzhiyun	returned when reading pwm attributes is unrelated to SmartFan IV
161*4882a593Smuzhiyun	operation.
162*4882a593Smuzhiyun
163*4882a593Smuzhiyunpwm[1-4]_mode
164*4882a593Smuzhiyun	controls if output is PWM or DC level
165*4882a593Smuzhiyun
166*4882a593Smuzhiyun	* 0 DC output (0 - 12v)
167*4882a593Smuzhiyun	* 1 PWM output
168*4882a593Smuzhiyun
169*4882a593SmuzhiyunThermal Cruise mode
170*4882a593Smuzhiyun-------------------
171*4882a593Smuzhiyun
172*4882a593SmuzhiyunIf the temperature is in the range defined by:
173*4882a593Smuzhiyun
174*4882a593Smuzhiyunpwm[1-4]_target
175*4882a593Smuzhiyun		   set target temperature, unit millidegree Celsius
176*4882a593Smuzhiyun		   (range 0 - 127000)
177*4882a593Smuzhiyunpwm[1-4]_tolerance
178*4882a593Smuzhiyun		   tolerance, unit millidegree Celsius (range 0 - 15000)
179*4882a593Smuzhiyun
180*4882a593Smuzhiyunthere are no changes to fan speed. Once the temperature leaves the interval,
181*4882a593Smuzhiyunfan speed increases (temp is higher) or decreases if lower than desired.
182*4882a593SmuzhiyunThere are defined steps and times, but not exported by the driver yet.
183*4882a593Smuzhiyun
184*4882a593Smuzhiyunpwm[1-4]_min_output
185*4882a593Smuzhiyun		   minimum fan speed (range 1 - 255), when the temperature
186*4882a593Smuzhiyun		   is below defined range.
187*4882a593Smuzhiyunpwm[1-4]_stop_time
188*4882a593Smuzhiyun		   how many milliseconds [ms] must elapse to switch
189*4882a593Smuzhiyun		   corresponding fan off. (when the temperature was below
190*4882a593Smuzhiyun		   defined range).
191*4882a593Smuzhiyunpwm[1-4]_start_output
192*4882a593Smuzhiyun		   minimum fan speed (range 1 - 255) when spinning up
193*4882a593Smuzhiyunpwm[1-4]_step_output
194*4882a593Smuzhiyun		   rate of fan speed change (1 - 255)
195*4882a593Smuzhiyunpwm[1-4]_stop_output
196*4882a593Smuzhiyun		   minimum fan speed (range 1 - 255) when spinning down
197*4882a593Smuzhiyunpwm[1-4]_max_output
198*4882a593Smuzhiyun		   maximum fan speed (range 1 - 255), when the temperature
199*4882a593Smuzhiyun		   is above defined range.
200*4882a593Smuzhiyun
201*4882a593SmuzhiyunNote: last six functions are influenced by other control bits, not yet exported
202*4882a593Smuzhiyun      by the driver, so a change might not have any effect.
203*4882a593Smuzhiyun
204*4882a593SmuzhiyunImplementation Details
205*4882a593Smuzhiyun----------------------
206*4882a593Smuzhiyun
207*4882a593SmuzhiyunFuture driver development should bear in mind that the following registers have
208*4882a593Smuzhiyundifferent functions on the 627EHF and the 627DHG. Some registers also have
209*4882a593Smuzhiyundifferent power-on default values, but BIOS should already be loading
210*4882a593Smuzhiyunappropriate defaults. Note that bank selection must be performed as is currently
211*4882a593Smuzhiyundone in the driver for all register addresses.
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun========================= =====================================================
214*4882a593SmuzhiyunRegister(s)		  Meaning
215*4882a593Smuzhiyun========================= =====================================================
216*4882a593Smuzhiyun0x49                      only on DHG, selects temperature source for AUX fan,
217*4882a593Smuzhiyun			  CPU fan0
218*4882a593Smuzhiyun0x4a                      not completely documented for the EHF and the DHG
219*4882a593Smuzhiyun			  documentation assigns different behavior to bits 7
220*4882a593Smuzhiyun			  and 6, including extending the temperature input
221*4882a593Smuzhiyun			  selection to SmartFan I, not just SmartFan III.
222*4882a593Smuzhiyun			  Testing on the EHF will reveal whether they are
223*4882a593Smuzhiyun			  compatible or not.
224*4882a593Smuzhiyun0x58                      Chip ID: 0xa1=EHF 0xc1=DHG
225*4882a593Smuzhiyun0x5e                      only on DHG, has bits to enable "current mode"
226*4882a593Smuzhiyun			  temperature detection and critical temperature
227*4882a593Smuzhiyun			  protection
228*4882a593Smuzhiyun0x45b                     only on EHF, bit 3, vin4 alarm (EHF supports 10
229*4882a593Smuzhiyun			  inputs, only 9 on DHG)
230*4882a593Smuzhiyun0x552                     only on EHF, vin4
231*4882a593Smuzhiyun0x558                     only on EHF, vin4 high limit
232*4882a593Smuzhiyun0x559                     only on EHF, vin4 low limit
233*4882a593Smuzhiyun0x6b                      only on DHG, SYS fan critical temperature
234*4882a593Smuzhiyun0x6c                      only on DHG, CPU fan0 critical temperature
235*4882a593Smuzhiyun0x6d                      only on DHG, AUX fan critical temperature
236*4882a593Smuzhiyun0x6e                      only on DHG, CPU fan1 critical temperature
237*4882a593Smuzhiyun0x50-0x55 and 0x650-0x657 marked as:
238*4882a593Smuzhiyun
239*4882a593Smuzhiyun			    - "Test Register" for the EHF
240*4882a593Smuzhiyun			    - "Reserved Register" for the DHG
241*4882a593Smuzhiyun========================= =====================================================
242*4882a593Smuzhiyun
243*4882a593SmuzhiyunThe DHG also supports PECI, where the DHG queries Intel CPU temperatures, and
244*4882a593Smuzhiyunthe ICH8 southbridge gets that data via PECI from the DHG, so that the
245*4882a593Smuzhiyunsouthbridge drives the fans. And the DHG supports SST, a one-wire serial bus.
246*4882a593Smuzhiyun
247*4882a593SmuzhiyunThe DHG-P has an additional automatic fan speed control mode named Smart Fan
248*4882a593Smuzhiyun(TM) III+. This mode is not yet supported by the driver.
249