xref: /OK3568_Linux_fs/kernel/Documentation/hwmon/asc7621.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=====================
2*4882a593SmuzhiyunKernel driver asc7621
3*4882a593Smuzhiyun=====================
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunSupported chips:
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun    Andigilog aSC7621 and aSC7621a
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun    Prefix: 'asc7621'
10*4882a593Smuzhiyun
11*4882a593Smuzhiyun    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun    Datasheet: http://www.fairview5.com/linux/asc7621/asc7621.pdf
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunAuthor:
16*4882a593Smuzhiyun		George Joseph
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunDescription provided by Dave Pivin @ Andigilog:
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunAndigilog has both the PECI and pre-PECI versions of the Heceta-6, as
21*4882a593SmuzhiyunIntel calls them. Heceta-6e has high frequency PWM and Heceta-6p has
22*4882a593Smuzhiyunadded PECI and a 4th thermal zone. The Andigilog aSC7611 is the
23*4882a593SmuzhiyunHeceta-6e part and aSC7621 is the Heceta-6p part. They are both in
24*4882a593Smuzhiyunvolume production, shipping to Intel and their subs.
25*4882a593Smuzhiyun
26*4882a593SmuzhiyunWe have enhanced both parts relative to the governing Intel
27*4882a593Smuzhiyunspecification. First enhancement is temperature reading resolution. We
28*4882a593Smuzhiyunhave used registers below 20h for vendor-specific functions in addition
29*4882a593Smuzhiyunto those in the Intel-specified vendor range.
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunOur conversion process produces a result that is reported as two bytes.
32*4882a593SmuzhiyunThe fan speed control uses this finer value to produce a "step-less" fan
33*4882a593SmuzhiyunPWM output. These two bytes are "read-locked" to guarantee that once a
34*4882a593Smuzhiyunhigh or low byte is read, the other byte is locked-in until after the
35*4882a593Smuzhiyunnext read of any register. So to get an atomic reading, read high or low
36*4882a593Smuzhiyunbyte, then the very next read should be the opposite byte. Our data
37*4882a593Smuzhiyunsheet says 10-bits of resolution, although you may find the lower bits
38*4882a593Smuzhiyunare active, they are not necessarily reliable or useful externally. We
39*4882a593Smuzhiyunchose not to mask them.
40*4882a593Smuzhiyun
41*4882a593SmuzhiyunWe employ significant filtering that is user tunable as described in the
42*4882a593Smuzhiyundata sheet. Our temperature reports and fan PWM outputs are very smooth
43*4882a593Smuzhiyunwhen compared to the competition, in addition to the higher resolution
44*4882a593Smuzhiyuntemperature reports. The smoother PWM output does not require user
45*4882a593Smuzhiyunintervention.
46*4882a593Smuzhiyun
47*4882a593SmuzhiyunWe offer GPIO features on the former VID pins. These are open-drain
48*4882a593Smuzhiyunoutputs or inputs and may be used as general purpose I/O or as alarm
49*4882a593Smuzhiyunoutputs that are based on temperature limits. These are in 19h and 1Ah.
50*4882a593Smuzhiyun
51*4882a593SmuzhiyunWe offer flexible mapping of temperature readings to thermal zones. Any
52*4882a593Smuzhiyuntemperature may be mapped to any zone, which has a default assignment
53*4882a593Smuzhiyunthat follows Intel's specs.
54*4882a593Smuzhiyun
55*4882a593SmuzhiyunSince there is a fan to zone assignment that allows for the "hotter" of
56*4882a593Smuzhiyuna set of zones to control the PWM of an individual fan, but there is no
57*4882a593Smuzhiyunindication to the user, we have added an indicator that shows which zone
58*4882a593Smuzhiyunis currently controlling the PWM for a given fan. This is in register
59*4882a593Smuzhiyun00h.
60*4882a593Smuzhiyun
61*4882a593SmuzhiyunBoth remote diode temperature readings may be given an offset value such
62*4882a593Smuzhiyunthat the reported reading as well as the temperature used to determine
63*4882a593SmuzhiyunPWM may be offset for system calibration purposes.
64*4882a593Smuzhiyun
65*4882a593SmuzhiyunPECI Extended configuration allows for having more than two domains per
66*4882a593SmuzhiyunPECI address and also provides an enabling function for each PECI
67*4882a593Smuzhiyunaddress. One could use our flexible zone assignment to have a zone
68*4882a593Smuzhiyunassigned to up to 4 PECI addresses. This is not possible in the default
69*4882a593SmuzhiyunIntel configuration. This would be useful in multi-CPU systems with
70*4882a593Smuzhiyunindividual fans on each that would benefit from individual fan control.
71*4882a593SmuzhiyunThis is in register 0Eh.
72*4882a593Smuzhiyun
73*4882a593SmuzhiyunThe tachometer measurement system is flexible and able to adapt to many
74*4882a593Smuzhiyunfan types. We can also support pulse-stretched PWM so that 3-wire fans
75*4882a593Smuzhiyunmay be used. These characteristics are in registers 04h to 07h.
76*4882a593Smuzhiyun
77*4882a593SmuzhiyunFinally, we have added a tach disable function that turns off the tach
78*4882a593Smuzhiyunmeasurement system for individual tachs in order to save power. That is
79*4882a593Smuzhiyunin register 75h.
80*4882a593Smuzhiyun
81*4882a593Smuzhiyun--------------------------------------------------------------------------
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunaSC7621 Product Description
84*4882a593Smuzhiyun===========================
85*4882a593Smuzhiyun
86*4882a593SmuzhiyunThe aSC7621 has a two wire digital interface compatible with SMBus 2.0.
87*4882a593SmuzhiyunUsing a 10-bit ADC, the aSC7621 measures the temperature of two remote diode
88*4882a593Smuzhiyunconnected transistors as well as its own die. Support for Platform
89*4882a593SmuzhiyunEnvironmental Control Interface (PECI) is included.
90*4882a593Smuzhiyun
91*4882a593SmuzhiyunUsing temperature information from these four zones, an automatic fan speed
92*4882a593Smuzhiyuncontrol algorithm is employed to minimize acoustic impact while achieving
93*4882a593Smuzhiyunrecommended CPU temperature under varying operational loads.
94*4882a593Smuzhiyun
95*4882a593SmuzhiyunTo set fan speed, the aSC7621 has three independent pulse width modulation
96*4882a593Smuzhiyun(PWM) outputs that are controlled by one, or a combination of three,
97*4882a593Smuzhiyuntemperature zones. Both high- and low-frequency PWM ranges are supported.
98*4882a593Smuzhiyun
99*4882a593SmuzhiyunThe aSC7621 also includes a digital filter that can be invoked to smooth
100*4882a593Smuzhiyuntemperature readings for better control of fan speed and minimum acoustic
101*4882a593Smuzhiyunimpact.
102*4882a593Smuzhiyun
103*4882a593SmuzhiyunThe aSC7621 has tachometer inputs to measure fan speed on up to four fans.
104*4882a593SmuzhiyunLimit and status registers for all measured values are included to alert
105*4882a593Smuzhiyunthe system host that any measurements are outside of programmed limits
106*4882a593Smuzhiyunvia status registers.
107*4882a593Smuzhiyun
108*4882a593SmuzhiyunSystem voltages of VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard power are
109*4882a593Smuzhiyunmonitored efficiently with internal scaling resistors.
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunFeatures
112*4882a593Smuzhiyun--------
113*4882a593Smuzhiyun
114*4882a593Smuzhiyun- Supports PECI interface and monitors internal and remote thermal diodes
115*4882a593Smuzhiyun- 2-wire, SMBus 2.0 compliant, serial interface
116*4882a593Smuzhiyun- 10-bit ADC
117*4882a593Smuzhiyun- Monitors VCCP, 2.5V, 3.3V, 5.0V, and 12V motherboard/processor supplies
118*4882a593Smuzhiyun- Programmable autonomous fan control based on temperature readings
119*4882a593Smuzhiyun- Noise filtering of temperature reading for fan speed control
120*4882a593Smuzhiyun- 0.25C digital temperature sensor resolution
121*4882a593Smuzhiyun- 3 PWM fan speed control outputs for 2-, 3- or 4-wire fans and up to 4 fan
122*4882a593Smuzhiyun  tachometer inputs
123*4882a593Smuzhiyun- Enhanced measured temperature to Temperature Zone assignment.
124*4882a593Smuzhiyun- Provides high and low PWM frequency ranges
125*4882a593Smuzhiyun- 3 GPIO pins for custom use
126*4882a593Smuzhiyun- 24-Lead QSOP package
127*4882a593Smuzhiyun
128*4882a593SmuzhiyunConfiguration Notes
129*4882a593Smuzhiyun===================
130*4882a593Smuzhiyun
131*4882a593SmuzhiyunExcept where noted below, the sysfs entries created by this driver follow
132*4882a593Smuzhiyunthe standards defined in "sysfs-interface".
133*4882a593Smuzhiyun
134*4882a593Smuzhiyuntemp1_source
135*4882a593Smuzhiyun	=	===============================================
136*4882a593Smuzhiyun	0 	(default) peci_legacy = 0, Remote 1 Temperature
137*4882a593Smuzhiyun		peci_legacy = 1, PECI Processor Temperature 0
138*4882a593Smuzhiyun	1 	Remote 1 Temperature
139*4882a593Smuzhiyun	2 	Remote 2 Temperature
140*4882a593Smuzhiyun	3 	Internal Temperature
141*4882a593Smuzhiyun	4 	PECI Processor Temperature 0
142*4882a593Smuzhiyun	5 	PECI Processor Temperature 1
143*4882a593Smuzhiyun	6 	PECI Processor Temperature 2
144*4882a593Smuzhiyun	7	PECI Processor Temperature 3
145*4882a593Smuzhiyun	=	===============================================
146*4882a593Smuzhiyun
147*4882a593Smuzhiyuntemp2_source
148*4882a593Smuzhiyun	=	===============================================
149*4882a593Smuzhiyun	0 	(default) Internal Temperature
150*4882a593Smuzhiyun	1 	Remote 1 Temperature
151*4882a593Smuzhiyun	2 	Remote 2 Temperature
152*4882a593Smuzhiyun	3 	Internal Temperature
153*4882a593Smuzhiyun	4 	PECI Processor Temperature 0
154*4882a593Smuzhiyun	5 	PECI Processor Temperature 1
155*4882a593Smuzhiyun	6 	PECI Processor Temperature 2
156*4882a593Smuzhiyun	7 	PECI Processor Temperature 3
157*4882a593Smuzhiyun	=	===============================================
158*4882a593Smuzhiyun
159*4882a593Smuzhiyuntemp3_source
160*4882a593Smuzhiyun	=	===============================================
161*4882a593Smuzhiyun	0 	(default) Remote 2 Temperature
162*4882a593Smuzhiyun	1 	Remote 1 Temperature
163*4882a593Smuzhiyun	2 	Remote 2 Temperature
164*4882a593Smuzhiyun	3 	Internal Temperature
165*4882a593Smuzhiyun	4 	PECI Processor Temperature 0
166*4882a593Smuzhiyun	5 	PECI Processor Temperature 1
167*4882a593Smuzhiyun	6 	PECI Processor Temperature 2
168*4882a593Smuzhiyun	7 	PECI Processor Temperature 3
169*4882a593Smuzhiyun	=	===============================================
170*4882a593Smuzhiyun
171*4882a593Smuzhiyuntemp4_source
172*4882a593Smuzhiyun	=	===============================================
173*4882a593Smuzhiyun	0 	(default) peci_legacy = 0, PECI Processor Temperature 0
174*4882a593Smuzhiyun		peci_legacy = 1, Remote 1 Temperature
175*4882a593Smuzhiyun	1 	Remote 1 Temperature
176*4882a593Smuzhiyun	2 	Remote 2 Temperature
177*4882a593Smuzhiyun	3 	Internal Temperature
178*4882a593Smuzhiyun	4 	PECI Processor Temperature 0
179*4882a593Smuzhiyun	5 	PECI Processor Temperature 1
180*4882a593Smuzhiyun	6 	PECI Processor Temperature 2
181*4882a593Smuzhiyun	7 	PECI Processor Temperature 3
182*4882a593Smuzhiyun	=	===============================================
183*4882a593Smuzhiyun
184*4882a593Smuzhiyuntemp[1-4]_smoothing_enable / temp[1-4]_smoothing_time
185*4882a593Smuzhiyun	Smooths spikes in temp readings caused by noise.
186*4882a593Smuzhiyun	Valid values in milliseconds are:
187*4882a593Smuzhiyun
188*4882a593Smuzhiyun	* 35000
189*4882a593Smuzhiyun	* 17600
190*4882a593Smuzhiyun	* 11800
191*4882a593Smuzhiyun	*  7000
192*4882a593Smuzhiyun	*  4400
193*4882a593Smuzhiyun	*  3000
194*4882a593Smuzhiyun	*  1600
195*4882a593Smuzhiyun	*   800
196*4882a593Smuzhiyun
197*4882a593Smuzhiyuntemp[1-4]_crit
198*4882a593Smuzhiyun	When the corresponding zone temperature reaches this value,
199*4882a593Smuzhiyun	ALL pwm outputs will got to 100%.
200*4882a593Smuzhiyun
201*4882a593Smuzhiyuntemp[5-8]_input / temp[5-8]_enable
202*4882a593Smuzhiyun	The aSC7621 can also read temperatures provided by the processor
203*4882a593Smuzhiyun	via the PECI bus.  Usually these are "core" temps and are relative
204*4882a593Smuzhiyun	to the point where the automatic thermal control circuit starts
205*4882a593Smuzhiyun	throttling.  This means that these are usually negative numbers.
206*4882a593Smuzhiyun
207*4882a593Smuzhiyunpwm[1-3]_enable
208*4882a593Smuzhiyun	=============== ========================================================
209*4882a593Smuzhiyun	0		Fan off.
210*4882a593Smuzhiyun	1		Fan on manual control.
211*4882a593Smuzhiyun	2		Fan on automatic control and will run at the minimum pwm
212*4882a593Smuzhiyun			if the temperature for the zone is below the minimum.
213*4882a593Smuzhiyun	3		Fan on automatic control but will be off if the
214*4882a593Smuzhiyun			temperature for the zone is below the minimum.
215*4882a593Smuzhiyun	4-254		Ignored.
216*4882a593Smuzhiyun	255		Fan on full.
217*4882a593Smuzhiyun	=============== ========================================================
218*4882a593Smuzhiyun
219*4882a593Smuzhiyunpwm[1-3]_auto_channels
220*4882a593Smuzhiyun	Bitmap as described in sysctl-interface with the following
221*4882a593Smuzhiyun	exceptions...
222*4882a593Smuzhiyun
223*4882a593Smuzhiyun	Only the following combination of zones (and their corresponding masks)
224*4882a593Smuzhiyun	are valid:
225*4882a593Smuzhiyun
226*4882a593Smuzhiyun	* 1
227*4882a593Smuzhiyun	* 2
228*4882a593Smuzhiyun	* 3
229*4882a593Smuzhiyun	* 2,3
230*4882a593Smuzhiyun	* 1,2,3
231*4882a593Smuzhiyun	* 4
232*4882a593Smuzhiyun	* 1,2,3,4
233*4882a593Smuzhiyun
234*4882a593Smuzhiyun	* Special values:
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun	  ==		======================
237*4882a593Smuzhiyun	  0		Disabled.
238*4882a593Smuzhiyun	  16		Fan on manual control.
239*4882a593Smuzhiyun	  31		Fan on full.
240*4882a593Smuzhiyun	  ==		======================
241*4882a593Smuzhiyun
242*4882a593Smuzhiyun
243*4882a593Smuzhiyunpwm[1-3]_invert
244*4882a593Smuzhiyun	When set, inverts the meaning of pwm[1-3].
245*4882a593Smuzhiyun	i.e.  when pwm = 0, the fan will be on full and
246*4882a593Smuzhiyun	when pwm = 255 the fan will be off.
247*4882a593Smuzhiyun
248*4882a593Smuzhiyunpwm[1-3]_freq
249*4882a593Smuzhiyun	PWM frequency in Hz
250*4882a593Smuzhiyun	Valid values in Hz are:
251*4882a593Smuzhiyun
252*4882a593Smuzhiyun	* 10
253*4882a593Smuzhiyun	* 15
254*4882a593Smuzhiyun	* 23
255*4882a593Smuzhiyun	* 30  (default)
256*4882a593Smuzhiyun	* 38
257*4882a593Smuzhiyun	* 47
258*4882a593Smuzhiyun	* 62
259*4882a593Smuzhiyun	* 94
260*4882a593Smuzhiyun	* 23000
261*4882a593Smuzhiyun	* 24000
262*4882a593Smuzhiyun	* 25000
263*4882a593Smuzhiyun	* 26000
264*4882a593Smuzhiyun	* 27000
265*4882a593Smuzhiyun	* 28000
266*4882a593Smuzhiyun	* 29000
267*4882a593Smuzhiyun	* 30000
268*4882a593Smuzhiyun
269*4882a593Smuzhiyun	Setting any other value will be ignored.
270*4882a593Smuzhiyun
271*4882a593Smuzhiyunpeci_enable
272*4882a593Smuzhiyun	Enables or disables PECI
273*4882a593Smuzhiyun
274*4882a593Smuzhiyunpeci_avg
275*4882a593Smuzhiyun	Input filter average time.
276*4882a593Smuzhiyun
277*4882a593Smuzhiyun	* 0 	0 Sec. (no Smoothing) (default)
278*4882a593Smuzhiyun	* 1 	0.25 Sec.
279*4882a593Smuzhiyun	* 2 	0.5 Sec.
280*4882a593Smuzhiyun	* 3 	1.0 Sec.
281*4882a593Smuzhiyun	* 4 	2.0 Sec.
282*4882a593Smuzhiyun	* 5 	4.0 Sec.
283*4882a593Smuzhiyun	* 6 	8.0 Sec.
284*4882a593Smuzhiyun	* 7 	0.0 Sec.
285*4882a593Smuzhiyun
286*4882a593Smuzhiyunpeci_legacy
287*4882a593Smuzhiyun	=	============================================
288*4882a593Smuzhiyun	0	Standard Mode (default)
289*4882a593Smuzhiyun		Remote Diode 1 reading is associated with
290*4882a593Smuzhiyun		Temperature Zone 1, PECI is associated with
291*4882a593Smuzhiyun		Zone 4
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun	1	Legacy Mode
294*4882a593Smuzhiyun		PECI is associated with Temperature Zone 1,
295*4882a593Smuzhiyun		Remote Diode 1 is associated with Zone 4
296*4882a593Smuzhiyun	=	============================================
297*4882a593Smuzhiyun
298*4882a593Smuzhiyunpeci_diode
299*4882a593Smuzhiyun	Diode filter
300*4882a593Smuzhiyun
301*4882a593Smuzhiyun	=	====================
302*4882a593Smuzhiyun	0	0.25 Sec.
303*4882a593Smuzhiyun	1 	1.1 Sec.
304*4882a593Smuzhiyun	2 	2.4 Sec.  (default)
305*4882a593Smuzhiyun	3 	3.4 Sec.
306*4882a593Smuzhiyun	4 	5.0 Sec.
307*4882a593Smuzhiyun	5 	6.8 Sec.
308*4882a593Smuzhiyun	6 	10.2 Sec.
309*4882a593Smuzhiyun	7 	16.4 Sec.
310*4882a593Smuzhiyun	=	====================
311*4882a593Smuzhiyun
312*4882a593Smuzhiyunpeci_4domain
313*4882a593Smuzhiyun	Four domain enable
314*4882a593Smuzhiyun
315*4882a593Smuzhiyun	=	===============================================
316*4882a593Smuzhiyun	0 	1 or 2 Domains for enabled processors (default)
317*4882a593Smuzhiyun	1 	3 or 4 Domains for enabled processors
318*4882a593Smuzhiyun	=	===============================================
319*4882a593Smuzhiyun
320*4882a593Smuzhiyunpeci_domain
321*4882a593Smuzhiyun	Domain
322*4882a593Smuzhiyun
323*4882a593Smuzhiyun	=	==================================================
324*4882a593Smuzhiyun	0 	Processor contains a single domain (0) 	 (default)
325*4882a593Smuzhiyun	1 	Processor contains two domains (0,1)
326*4882a593Smuzhiyun	=	==================================================
327