blob: 6d0e16f0a50a97861e549131d599e12b9915dd5e [file] [log] [blame]
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +00001Kernel driver w83781d
2=====================
3
4Supported chips:
5 * Winbond W83781D
6 Prefix: 'w83781d'
7 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
8 Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83781d.pdf
9 * Winbond W83782D
10 Prefix: 'w83782d'
11 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
12 Datasheet: http://www.winbond.com/PDF/sheet/w83782d.pdf
13 * Winbond W83783S
14 Prefix: 'w83783s'
15 Addresses scanned: I2C 0x2d
16 Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83783s.pdf
17 * Winbond W83627HF
18 Prefix: 'w83627hf'
19 Addresses scanned: I2C 0x20 - 0x2f, ISA 0x290 (8 I/O ports)
20 Datasheet: http://www.winbond.com/PDF/sheet/w83627hf.pdf
21 * Winbond W83627THF
22 Prefix: 'w83627thf'
23 Addresses scanned: ISA address 0x290 (8 I/O ports)
24 Datasheet: http://www.winbond.com/PDF/sheet/w83627thf.pdf
25 * Winbond W83697HF
26 Prefix: 'w83697hf'
27 Addresses scanned: ISA 0x290 (8 I/O ports)
28 Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83697hf.pdf
29 * Asus AS99127F
30 Prefix: 'as99127f'
31 Addresses scanned: I2C 0x28 - 0x2f
32 Datasheet: Unavailable from Asus
33
34Authors:
35 Frodo Looijaard <frodol@dds.nl>,
36 Philip Edelbrock <phil@netroedge.com>,
37 Mark Studebaker <mdsxyz123@yahoo.com>
38
39Module parameters
40-----------------
41
42* init int
43 (default 1)
44 Use 'init=0' to bypass initializing the chip.
45 Try this if your computer crashes when you load the module.
46
47force_subclients=bus,caddr,saddr,saddr
48 This is used to force the i2c addresses for subclients of
49 a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b'
50 to force the subclients of chip 0x2d on bus 0 to i2c addresses
51 0x4a and 0x4b. This parameter is useful for certain Tyan boards.
52
53Description
54-----------
55
56This driver implements support for the Winbond W83627HF, W83627THF, W83781D,
57W83782D, W83783S, W83697HF chips, and the Asus AS99127F chips. We will refer
58to them collectively as W8378* chips.
59
60There is quite some difference between these chips, but they are similar
61enough that it was sensible to put them together in one driver.
62The W83627HF chip is assumed to be identical to the ISA W83782D.
63The Asus chips are similar to an I2C-only W83782D.
64
65Chip #vin #fanin #pwm #temp wchipid vendid i2c ISA
66as99127f 7 3 0 3 0x31 0x12c3 yes no
67as99127f rev.2 (type_name = as99127f) 0x31 0x5ca3 yes no
68w83781d 7 3 0 3 0x10-1 0x5ca3 yes yes
69w83627hf 9 3 2 3 0x21 0x5ca3 yes yes(LPC)
70w83627thf 9 3 2 3 0x90 0x5ca3 no yes(LPC)
71w83782d 9 3 2-4 3 0x30 0x5ca3 yes yes
72w83783s 5-6 3 2 1-2 0x40 0x5ca3 yes no
73w83697hf 8 2 2 2 0x60 0x5ca3 no yes(LPC)
74
75Detection of these chips can sometimes be foiled because they can be in
76an internal state that allows no clean access. If you know the address
77of the chip, use a 'force' parameter; this will put them into a more
78well-behaved state first.
79
80The W8378* implements temperature sensors (three on the W83781D and W83782D,
81two on the W83783S), three fan rotation speed sensors, voltage sensors
82(seven on the W83781D, nine on the W83782D and six on the W83783S), VID
83lines, alarms with beep warnings, and some miscellaneous stuff.
84
85Temperatures are measured in degrees Celsius. There is always one main
86temperature sensor, and one (W83783S) or two (W83781D and W83782D) other
87sensors. An alarm is triggered for the main sensor once when the
88Overtemperature Shutdown limit is crossed; it is triggered again as soon as
89it drops below the Hysteresis value. A more useful behavior
90can be found by setting the Hysteresis value to +127 degrees Celsius; in
91this case, alarms are issued during all the time when the actual temperature
92is above the Overtemperature Shutdown value. The driver sets the
93hysteresis value for temp1 to 127 at initialization.
94
95For the other temperature sensor(s), an alarm is triggered when the
96temperature gets higher then the Overtemperature Shutdown value; it stays
97on until the temperature falls below the Hysteresis value. But on the
98W83781D, there is only one alarm that functions for both other sensors!
99Temperatures are guaranteed within a range of -55 to +125 degrees. The
100main temperature sensors has a resolution of 1 degree; the other sensor(s)
101of 0.5 degree.
102
103Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
104triggered if the rotation speed has dropped below a programmable limit. Fan
105readings can be divided by a programmable divider (1, 2, 4 or 8 for the
106W83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give
107the readings more range or accuracy. Not all RPM values can accurately
108be represented, so some rounding is done. With a divider of 2, the lowest
109representable value is around 2600 RPM.
110
111Voltage sensors (also known as IN sensors) report their values in volts.
112An alarm is triggered if the voltage has crossed a programmable minimum
113or maximum limit. Note that minimum in this case always means 'closest to
114zero'; this is important for negative voltage measurements. All voltage
115inputs can measure voltages between 0 and 4.08 volts, with a resolution
116of 0.016 volt.
117
118The VID lines encode the core voltage value: the voltage level your processor
119should work with. This is hardcoded by the mainboard and/or processor itself.
120It is a value in volts. When it is unconnected, you will often find the
121value 3.50 V here.
122
123The W83782D and W83783S temperature conversion machine understands about
124several kinds of temperature probes. You can program the so-called
125beta value in the sensor files. '1' is the PII/Celeron diode, '2' is the
126TN3904 transistor, and 3435 the default thermistor value. Other values
127are (not yet) supported.
128
129In addition to the alarms described above, there is a CHAS alarm on the
130chips which triggers if your computer case is open.
131
132When an alarm goes off, you can be warned by a beeping signal through
133your computer speaker. It is possible to enable all beeping globally,
134or only the beeping for some alarms.
135
136If an alarm triggers, it will remain triggered until the hardware register
137is read at least once. This means that the cause for the alarm may
138already have disappeared! Note that in the current implementation, all
139hardware registers are read whenever any data is read (unless it is less
140than 1.5 seconds since the last update). This means that you can easily
141miss once-only alarms.
142
143The chips only update values each 1.5 seconds; reading them more often
144will do no harm, but will return 'old' values.
145
146AS99127F PROBLEMS
147-----------------
148The as99127f support was developed without the benefit of a datasheet.
149In most cases it is treated as a w83781d (although revision 2 of the
150AS99127F looks more like a w83782d).
151This support will be BETA until a datasheet is released.
152One user has reported problems with fans stopping
153occasionally.
154
155Note that the individual beep bits are inverted from the other chips.
156The driver now takes care of this so that user-space applications
157don't have to know about it.
158
159Known problems:
160 - Problems with diode/thermistor settings (supported?)
161 - One user reports fans stopping under high server load.
162 - Revision 2 seems to have 2 PWM registers but we don't know
163 how to handle them. More details below.
164
165These will not be fixed unless we get a datasheet.
166If you have problems, please lobby Asus to release a datasheet.
167Unfortunately several others have without success.
168Please do not send mail to us asking for better as99127f support.
169We have done the best we can without a datasheet.
170Please do not send mail to the author or the sensors group asking for
171a datasheet or ideas on how to convince Asus. We can't help.
172
173
174NOTES:
175-----
176 783s has no in1 so that in[2-6] are compatible with the 781d/782d.
177
178 783s pin is programmable for -5V or temp1; defaults to -5V,
179 no control in driver so temp1 doesn't work.
180
181 782d and 783s datasheets differ on which is pwm1 and which is pwm2.
182 We chose to follow 782d.
183
184 782d and 783s pin is programmable for fan3 input or pwm2 output;
185 defaults to fan3 input.
186 If pwm2 is enabled (with echo 255 1 > pwm2), then
187 fan3 will report 0.
188
189 782d has pwm1-2 for ISA, pwm1-4 for i2c. (pwm3-4 share pins with
190 the ISA pins)
191
192Data sheet updates:
193------------------
194 - PWM clock registers:
195
196 000: master / 512
197 001: master / 1024
198 010: master / 2048
199 011: master / 4096
200 100: master / 8192
201
202
203Answers from Winbond tech support
204---------------------------------
205>
206> 1) In the W83781D data sheet section 7.2 last paragraph, it talks about
207> reprogramming the R-T table if the Beta of the thermistor is not
208> 3435K. The R-T table is described briefly in section 8.20.
209> What formulas do I use to program a new R-T table for a given Beta?
210>
211 We are sorry that the calculation for R-T table value is
212confidential. If you have another Beta value of thermistor, we can help
213to calculate the R-T table for you. But you should give us real R-T
214Table which can be gotten by thermistor vendor. Therefore we will calculate
215them and obtain 32-byte data, and you can fill the 32-byte data to the
216register in Bank0.CR51 of W83781D.
217
218
219> 2) In the W83782D data sheet, it mentions that pins 38, 39, and 40 are
220> programmable to be either thermistor or Pentium II diode inputs.
221> How do I program them for diode inputs? I can't find any register
222> to program these to be diode inputs.
223 --> You may program Bank0 CR[5Dh] and CR[59h] registers.
224
225 CR[5Dh] bit 1(VTIN1) bit 2(VTIN2) bit 3(VTIN3)
226
227 thermistor 0 0 0
228 diode 1 1 1
229
230
231(error) CR[59h] bit 4(VTIN1) bit 2(VTIN2) bit 3(VTIN3)
232(right) CR[59h] bit 4(VTIN1) bit 5(VTIN2) bit 6(VTIN3)
233
234 PII thermal diode 1 1 1
235 2N3904 diode 0 0 0
236
237
238Asus Clones
239-----------
240
241We have no datasheets for the Asus clones (AS99127F and ASB100 Bach).
242Here are some very useful information that were given to us by Alex Van
243Kaam about how to detect these chips, and how to read their values. He
244also gives advice for another Asus chipset, the Mozart-2 (which we
245don't support yet). Thanks Alex!
246I reworded some parts and added personal comments.
247
248# Detection:
249
250AS99127F rev.1, AS99127F rev.2 and ASB100:
251- I2C address range: 0x29 - 0x2F
252- If register 0x58 holds 0x31 then we have an Asus (either ASB100 or
253 AS99127F)
254- Which one depends on register 0x4F (manufacturer ID):
255 0x06 or 0x94: ASB100
256 0x12 or 0xC3: AS99127F rev.1
257 0x5C or 0xA3: AS99127F rev.2
258 Note that 0x5CA3 is Winbond's ID (WEC), which let us think Asus get their
259 AS99127F rev.2 direct from Winbond. The other codes mean ATT and DVC,
260 respectively. ATT could stand for Asustek something (although it would be
261 very badly chosen IMHO), I don't know what DVC could stand for. Maybe
262 these codes simply aren't meant to be decoded that way.
263
264Mozart-2:
265- I2C address: 0x77
266- If register 0x58 holds 0x56 or 0x10 then we have a Mozart-2
267- Of the Mozart there are 3 types:
268 0x58=0x56, 0x4E=0x94, 0x4F=0x36: Asus ASM58 Mozart-2
269 0x58=0x56, 0x4E=0x94, 0x4F=0x06: Asus AS2K129R Mozart-2
270 0x58=0x10, 0x4E=0x5C, 0x4F=0xA3: Asus ??? Mozart-2
271 You can handle all 3 the exact same way :)
272
273# Temperature sensors:
274
275ASB100:
276- sensor 1: register 0x27
277- sensor 2 & 3 are the 2 LM75's on the SMBus
278- sensor 4: register 0x17
279Remark: I noticed that on Intel boards sensor 2 is used for the CPU
280 and 4 is ignored/stuck, on AMD boards sensor 4 is the CPU and sensor 2 is
281 either ignored or a socket temperature.
282
283AS99127F (rev.1 and 2 alike):
284- sensor 1: register 0x27
285- sensor 2 & 3 are the 2 LM75's on the SMBus
286Remark: Register 0x5b is suspected to be temperature type selector. Bit 1
287 would control temp1, bit 3 temp2 and bit 5 temp3.
288
289Mozart-2:
290- sensor 1: register 0x27
291- sensor 2: register 0x13
292
293# Fan sensors:
294
295ASB100, AS99127F (rev.1 and 2 alike):
296- 3 fans, identical to the W83781D
297
298Mozart-2:
299- 2 fans only, 1350000/RPM/div
300- fan 1: register 0x28, divisor on register 0xA1 (bits 4-5)
301- fan 2: register 0x29, divisor on register 0xA1 (bits 6-7)
302
303# Voltages:
304
305This is where there is a difference between AS99127F rev.1 and 2.
306Remark: The difference is similar to the difference between
307 W83781D and W83782D.
308
309ASB100:
310in0=r(0x20)*0.016
311in1=r(0x21)*0.016
312in2=r(0x22)*0.016
313in3=r(0x23)*0.016*1.68
314in4=r(0x24)*0.016*3.8
315in5=r(0x25)*(-0.016)*3.97
316in6=r(0x26)*(-0.016)*1.666
317
318AS99127F rev.1:
319in0=r(0x20)*0.016
320in1=r(0x21)*0.016
321in2=r(0x22)*0.016
322in3=r(0x23)*0.016*1.68
323in4=r(0x24)*0.016*3.8
324in5=r(0x25)*(-0.016)*3.97
325in6=r(0x26)*(-0.016)*1.503
326
327AS99127F rev.2:
328in0=r(0x20)*0.016
329in1=r(0x21)*0.016
330in2=r(0x22)*0.016
331in3=r(0x23)*0.016*1.68
332in4=r(0x24)*0.016*3.8
333in5=(r(0x25)*0.016-3.6)*5.14+3.6
334in6=(r(0x26)*0.016-3.6)*3.14+3.6
335
336Mozart-2:
337in0=r(0x20)*0.016
338in1=255
339in2=r(0x22)*0.016
340in3=r(0x23)*0.016*1.68
341in4=r(0x24)*0.016*4
342in5=255
343in6=255
344
345
346# PWM
347
348Additional info about PWM on the AS99127F (may apply to other Asus
349chips as well) by Jean Delvare as of 2004-04-09:
350
351AS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,
352and a temperature sensor type selector at 0x5B (which basically means
353that they swapped registers 0x59 and 0x5B when you compare with Winbond
354chips).
355Revision 1 of the chip also has the temperature sensor type selector at
3560x5B, but PWM registers have no effect.
357
358We don't know exactly how the temperature sensor type selection works.
359Looks like bits 1-0 are for temp1, bits 3-2 for temp2 and bits 5-4 for
360temp3, although it is possible that only the most significant bit matters
361each time. So far, values other than 0 always broke the readings.
362
363PWM registers seem to be split in two parts: bit 7 is a mode selector,
364while the other bits seem to define a value or threshold.
365
366When bit 7 is clear, bits 6-0 seem to hold a threshold value. If the value
367is below a given limit, the fan runs at low speed. If the value is above
368the limit, the fan runs at full speed. We have no clue as to what the limit
369represents. Note that there seem to be some inertia in this mode, speed
370changes may need some time to trigger. Also, an hysteresis mechanism is
371suspected since walking through all the values increasingly and then
372decreasingly led to slightly different limits.
373
374When bit 7 is set, bits 3-0 seem to hold a threshold value, while bits 6-4
375would not be significant. If the value is below a given limit, the fan runs
376at full speed, while if it is above the limit it runs at low speed (so this
377is the contrary of the other mode, in a way). Here again, we don't know
378what the limit is supposed to represent.
379
380One remarkable thing is that the fans would only have two or three
381different speeds (transitional states left apart), not a whole range as
382you usually get with PWM.
383
384As a conclusion, you can write 0x00 or 0x8F to the PWM registers to make
385fans run at low speed, and 0x7F or 0x80 to make them run at full speed.
386
387Please contact us if you can figure out how it is supposed to work. As
388long as we don't know more, the w83781d driver doesn't handle PWM on
389AS99127F chips at all.
390
391Additional info about PWM on the AS99127F rev.1 by Hector Martin:
392
393I've been fiddling around with the (in)famous 0x59 register and
394found out the following values do work as a form of coarse pwm:
395
3960x80 - seems to turn fans off after some time(1-2 minutes)... might be
397some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an
398old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attemp at Qfan
399that was dropped at the BIOS)
4000x81 - off
4010x82 - slightly "on-ner" than off, but my fans do not get to move. I can
402hear the high-pitched PWM sound that motors give off at too-low-pwm.
4030x83 - now they do move. Estimate about 70% speed or so.
4040x84-0x8f - full on
405
406Changing the high nibble doesn't seem to do much except the high bit
407(0x80) must be set for PWM to work, else the current pwm doesn't seem to
408change.
409
410My mobo is an ASUS A7V266-E. This behavior is similar to what I got
411with speedfan under Windows, where 0-15% would be off, 15-2x% (can't
412remember the exact value) would be 70% and higher would be full on.