root/lm-sensors/branches/lm-sensors-2.10/doc/chips/lm85

Revision 3007, 21.3 KB (checked in by khali, 7 years ago)

Backport the cleanups and corrections Rudolf Marek and I did when
porting the chips documentation to Linux 2.6.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1Kernel driver `lm85.o'
2======================
3
4Status: Complete and somewhat tested
5
6Supported chips:
7  * National Semiconductor LM85 (B and C versions)
8    Prefix: 'lm85'
9    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
10    Datasheet: http://www.national.com/pf/LM/LM85.html
11  * Analog Devices ADM1027
12    Prefix: 'adm1027'
13    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
14    Datasheet: http://www.analog.com/en/prod/0,,766_825_ADM1027,00.html
15  * Analog Devices ADT7463
16    Prefix: 'adt7463'
17    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
18    Datasheet: http://www.analog.com/en/prod/0,,766_825_ADT7463,00.html
19  * SMSC EMC6D100, SMSC EMC6D101
20    Prefix: 'emc6d100'
21    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
22    Datasheet: http://www.smsc.com/main/tools/discontinued/6d100.pdf
23  * SMSC EMC6D102, SMSC EMC6D101
24    Prefix: 'emc6d102'
25    Addresses scanned: I2C 0x2c, 0x2d, 0x2e
26    Datasheet: http://www.smsc.com/main/catalog/emc6d102.html
27
28Authors:
29      Philip Pokorny <ppokorny@penguincomputing.com>
30      Frodo Looijaard <frodol@dds.nl>
31      Richard Barrington <rich_b_nz@clear.net.nz>
32
33
34Module Parameters
35-----------------
36
37* force: short array (min = 1, max = 48)
38  List of adapter,address pairs to assume to be present.  Autodetection
39  of the target device will still be attempted.  Use one of the more
40  specific force directives below if this doesn't detect the device.
41* force_lm85b: short array (min = 1, max = 48)
42  List of adapter,address pairs which are unquestionably assumed to contain
43  a `lm85-B' chip
44* force_lm85c: short array (min = 1, max = 48)
45  List of adapter,address pairs which are unquestionably assumed to contain
46  a `lm85-C' chip
47* force_adm1027: short array (min = 1, max = 48)
48  List of adapter,address pairs which are unquestionably assumed to contain
49  a `adm1027' chip
50* force_adt7463: short array (min = 1, max = 48)
51  List of adapter,address pairs which are unquestionably assumed to contain
52  a `adt7463' chip
53* ignore: short array (min = 1, max = 48)
54  List of adapter,address pairs not to scan
55* ignore_range: short array (min = 1, max = 48)
56  List of adapter,start-addr,end-addr triples not to scan
57* probe: short array (min = 1, max = 48)
58  List of adapter,address pairs to scan additionally
59* probe_range: short array (min = 1, max = 48)
60  List of adapter,start-addr,end-addr triples to scan additionally
61
62
63Description
64-----------
65
66This driver implements support for the National Semiconductor LM85
67and compatible chips including the Analog Devices ADM1027 and ADT7463,
68and SMSC EMC6D100, EMC6D101 and EMC6D102.
69
70The LM85 uses the 2-wire interface compatible with the SMBUS 2.0
71specification.  Using an analog to digital converter it measures three
72(3) temperatures and five (5) voltages.  It has four (4) 16-bit
73counters for measuring fan speed.  Five (5) digital inputs are
74provided for sampling the VID signals from the processor to the VRM.
75Lastly, there are three (3) PWM outputs that can be used to control
76fan speed.
77
78The voltage inputs have internal scaling resistors so that the
79following voltage can be measured without external resistors:
80
81   2.5V, 3.3V, 5V, 12V, and CPU core voltage (2.25V)
82
83The temperatures measured are one internal diode, and two remote
84diodes.  Remote 1 is generally the CPU temperature.  These inputs are
85designed to measure a thermal diode like the one in a Pentium 4
86processor in a socket 423 or socket 478 package.  They can also
87measure temperature using a transistor like the 2N3904.
88
89A sophisticated control system for the PWM outputs is designed into
90the LM85 that allows fan speed to be adjusted automatically based on
91any of the three temperature sensors.  Each PWM output is individually
92adjustable and programmable.  Once configured, the LM85 will adjust
93the PWM outputs in response to the measured temperatures without
94further host intervention.  This feature can also be disabled for
95manual control of the PWM's.
96
97Each of the measured inputs (voltage, temperature, fan speed) has
98corresponding high/low limit values.  The LM85 will signal an ALARM if
99any measured value exceeds either limit.
100
101The LM85 samples all inputs continuously.  The lm85 driver will not
102read the registers more often than once a second.  Further, configuration
103data is only read once each 5 minutes.  There is twice as much config
104data as measurements, so this would seem to be a worthwhile
105optimization.
106
107Special Features
108
109The LM85 has four fan speed monitoring modes.  The ADM1027 has only
110two.  Both have special circuitry to compensate for PWM interactions
111with the TACH signal from the fans.  The ADM1027 can be configured to
112measure the speed of a two wire fan, but the input conditioning
113circuitry is different for 3-wire and 2-wire mode.  For this reason,
114the 2-wire fan modes are not exposed to user control.  The BIOS should
115initialize them to the correct mode.  If you've designed your own
116ADM1027, you'll have to modify the init_client function and add an
117insmod parameter to set this up.
118
119To smooth the response of fans to changes in temperature, the LM85 has
120an optional filter for smoothing temperatures.  The ADM1027 has the
121same config option but uses it to rate limit the changes to fan speed
122instead.  In libsensors, we associate the smoothing feature with a
123zone in the LM85 and with a PWM in the ADM1027.
124
125The ADM1027 and ADT7463 have a 10-bit ADC and can therefore measure
126temperatures with 0.25 degC resolution.  They also provide an offset to
127the temperature readings that is automatically applied during
128measurement.  This offset can be used to zero out any errors due to
129traces and placement.  The documentation says that the offset is in
1300.25 degC steps, but in initial testing of the ADM1027 it was 1.00
131degC steps.  Analog Devices has confirmed this "bug".  The ADT7463 is
132reported to work as described in the documentation.  Accordingly, the
133driver currently reports 1.00 degC steps for the ADM1027 and 0.25 degC
134steps for the ADT7463.  If you have an ADT7463, please confirm to the
135LM85 maintainer that the temperature offset works as implemented.
136
137The ADT7463 has a THERM asserted counter.  This counter has a 22.76ms
138resolution and a range of 5.8 seconds.  The driver implements a 31-bit
139accumulator of the counter value to extend the range to over a year.
140The counter will stay at it's max value until read.  If you want to
141insure no counts get lost, you need to trigger the driver to read the
142counter every 5 seconds.  You can do this by reading just the
143therm_signal value.  The driver implements reads of 'therm_signal'
144without reading the other values for speed.  A background shell script
145like:
146
147    #!/bin/bash
148    while [ 1 ] ; do
149       cat /proc/sys/dev/sensors/adt7463-*/therm_signal > /dev/null
150       sleep 5
151    done
152
153Or if you want to record the values:
154
155    #!/bin/bash
156    last=0
157    while [ 1 ] ; do
158       read tlim total ovfl < /proc/sys/dev/sensors/adt7463-*/therm_signal
159       if [ $total -gt $last ]; then
160          echo $(date) - $tlim $total $ovfl
161          last=$total
162       fi
163       sleep 5;
164    done
165
166Either script should insure no counts are lost.
167
168See the vendor datasheets for more information.  There is application
169note from National (AN-1260) with some additional information about
170the LM85.  The Analog Devices datasheet is very detailed and describes
171a procedure for determining an optimal configuration for the automatic
172PWM control.
173
174Hardware Configurations
175-----------------------
176
177The LM85 can be jumpered for 3 different SMBus addresses.  There are
178no other hardware configuration options for the LM85.
179
180The lm85 driver detects both LM85B and LM85C revisions of the chip.
181See the datasheet for a complete description of the differences.
182Other than identifying the chip, the driver behaves no differently
183with regard to these two chips.  The LM85B is recommended for new
184designs.
185
186The ADM1027 and ADT7463 chips have an optional SMBALERT output that
187can be used to signal the chipset in case a limit is exceeded or the
188temperature sensors fail.  Individual sensor interrupts can be masked
189with 'alarm_mask' so they won't trigger SMBALERT.  The SMBALERT output
190if configured replaces one of the other functions (PWM2 or IN0).  The
191driver will print a message if the BIOS has configured this option
192when the chip is detected.
193
194The ADT7463 also has an optional THERM output/input which can be
195connected to the processor PROC_HOT output.  If available, the autofan
196control dynamic Tmin feature can be enabled to keep the system
197temperature within spec (just?!) with the least possible fan noise.
198
199Configuration Notes
200-------------------
201
202The voltage, temperature and fan inputs are available in libsensors
203and the sensors executable.  In addition, the automatic control of the
204PWM outputs can also be configured via sensors.conf.  This
205configuration is described below:
206
207* Temperatures and Zones
208
209Each temperature sensor is associated with a Zone.  There are three
210sensors and therefore three zones.  Each zone has the following
211temperature configuration points:
212
213    Limit temp    -- Temperature at which the fan will turn on
214                     [ absolute deg C from 0.0 to 127.0 ]
215                     [ sensors.conf:   zone#_limit ]
216    Hysteresis    -- Degrees below the limit that fan will remain
217                     on before turning off.
218                     [ relative C from 0.0 to -15.0 ]
219                     [ sensors.conf:   zone#_hyst ]
220    Range         -- Degrees above the limit over which the fan
221                     PWM will be adjusted (from PWM_MIN to 100%)
222                     [ relative deg C from 2.0 to 80.0 ]
223                     [ sensors.conf:   zone#_range ]
224    Critical temp -- Temperature above which other fans will be
225                     forced to 100% PWM
226                     [ absolute deg C from 0.0 to 127.0 ]
227                     [ sensors.conf:   zone#_critical ]
228
229** Temperature Range for a Zone
230
231The RANGE value for a given zone can have one of 16 different values
232in an approximately logrithmic spacing:
233Selecting a RANGE not in this list will cause the next larger range to
234be used.
235
236    Temperature ranges:    2.0, 2.5, 3.3, 4.0, 5.0, 6.6, 8.0, 10.0,
237      (in deg C)           13.3, 16.0, 20.0, 26.6, 32.0, 40.0, 53.3,
238                           80.0
239
240* Temperature Smoothing or Acoustic Enhancement
241
242The LM85 and ADM1027 use this value in different ways.  In the LM85
243it's used to filter the temperature input of a zone.  In this way, it
244affects all PWM's controlled by that zone temperature.  In the
245ADM1027, it limits the rate of change in fan speed.  Thus it is part
246of the PWM control algorithm.
247
248    Smooth filter -- Optional filter constant to smooth the system
249                     response to temperature spikes.  It either
250                     filters the measured temperatures or limits the
251                     rate of change of fan speed.  This improves
252                     the system by limiting rapid changes in fan
253                     speed.
254                     [ seconds from 0.8 to 35.0 or 0.0 for OFF ]
255                     [ sensors.conf:   zone#_smooth or pwm#_smooth ]
256
257The smoothing can be disabled, or enabled and set to one of the values
258listed below.  Selecting a filter time constant not on this list will
259cause the next smaller value to be used.  Setting the time constant to
2600 will disable the filtering.
261
262    Filter time constant:  35.0, 17.6, 11.8, 7.0, 4.4, 3.0, 1.6, 0.8
263      (in seconds)
264
265* PWM Control
266
267There are three PWM outputs.  The LM85 datasheet suggests that the
268pwm3 output control both fan3 and fan4.  Each PWM can be individually
269configured and assigned to a zone for it's control value.  Each PWM can be
270configured individually according to the following options.
271
272    Spinup time   -- When turning on a fan that was off, the PWM will
273                     temporarily be set to 100% for this length of
274                     time to insure the fan starts spinning.
275                     [ seconds from 0.0 to 4.0 ]
276                     [ sensors.conf:  pwm#_spinup ]
277    Minimum PWM   -- This is the PWM value at the limit temp of the
278                     referenced zone.
279                     [ PWM value from 0.0 to 255.0 ]
280                     [ sensors.conf:  pwm#_min ]
281    Frequency     -- This is the base frequency of the PWM output.
282                     [ Hz from 10.0 to 98.0 ]
283                     [ sensors.conf:  pwm#_freq ]
284    Min/Off flag  -- This flag determines if the PWM will be off or
285                     "min PWM" below the limit temperature.
286                     [ 0.0 means PWM off (0%) below limit ]
287                     [ sensors.conf:  pwm#_min_ctl ]
288    Invert flag   -- This flag causes the PWM output to be inverted.
289                     If inverted, a PWM setting of 0 will be full on
290                     and 100 will be off.
291                     [ 0.0 means PWM is "normal" ]
292                     [ sensors.conf:  pwm#_invert ]
293
294** Spinup Time
295
296Spinup time can be one of eight (8) values.  Selecting a spinup time
297not on this list will result in the next larger spinup time being
298selected.  Note, the value 0.2 actually results in a setting of 0.250
299seconds.
300
301    Spinup Time     0.0, 0.1, 0.2, 0.4, 0.7, 1.0, 2.0, 4.0
302      (in seconds)
303
304** PWM Frequency
305
306The base frequency of the PWM can be controlled.  The frequency can be
307set to one of the following 8 values.  Setting the frequency to a
308value not on this list, will result in the next higher frequency being
309selected.  The actual device frequency may vary slightly from this
310specification as designed by the manufacturer.  Consult the datasheet
311for more details.
312
313    PWM Frequency   10.0, 15.0, 23.0, 30.0, 38.0, 47.0, 62.0, 98.0
314      (in Hz)
315
316** Min/Off Flag
317
318Below the temperature "Limit - Hysteresis" from the controlling zone,
319the PWM can turn off (set to 0) or it can stay at the minimum PWM
320value.  Setting this flag to 1 will cause the PWM value to be the
321"Minimum PWM" value below this limit.  Setting it to 0 will set the
322PWM to 0 (off) below that limit.
323
324NOTE: It has been reported that there is a bug in the LM85 that causes
325the Min/Off flag to be associated with the zones not the PWMs.  This
326contradicts all the published documentation.  Setting pwm#_min_ctl in
327this case actually affects all PWMs controlled by zone '#'.
328
329** Invert Flag
330
331The PWM output can be inverted.  This may be useful if the fan power
332circuitry is inverted. (A low output turns on power and a high output
333turns off power to the fan).  Alternatively, if a slower fan speed is
334needed for higher temperatures, this could be set.
335
336Setting this flag to 1 will invert the PWM output.  A value of 0
337does not invert the PWM output.
338
339* PWM Controlling Zone selection
340
341PWM's can be controlled by zones according to the following
342configuration choices:
343
344   Value     Meaning
345  ------  ------------------------------------------------
346      1    Controlled by Zone 1
347      2    Controlled by Zone 2
348      3    Controlled by Zone 3
349     23    Controlled by higher temp of Zone 2 or 3
350    123    Controlled by highest temp of Zone 1, 2 or 3
351      0    PWM alwasy 0%  (off)
352     -1    PWM always 100%  (full on)
353     -2    Manual control (write to 'pwm#' to set)
354
355These are specified in sensors.conf using 'pwm#_zone'
356
357* /proc Interface
358
359These values can also be set using the /proc interface.  The following
360files contain the above settings in the order listed below:
361
362    Name         Values
363   ---------- ----------------------------------------------------
364    zone#      Limit, Hysteresis, Range, Critical
365    pwm#_cfg   Spinup, PWM at low limit, Frequency, Min/Off, Invert
366    pwm#_zone  Control Zone choice
367    smooth#    Filtering
368
369The National LM85's have two vendor specific configuration
370features.  Tach. mode and Spinup Control.  For more details on these,
371see the LM85 datasheet or Application Note AN-1260.
372
373    Name           Values
374   ------------ --------------------------------------------------
375    tach_mode    For best fan speed measurement when PWM's are in use,
376                 the Tach Mode should be set to 2 for all three (Fan's
377                 3 and 4 share a config setting) config values.  If
378                 PWM's are not in use or not wired to control fan
379                 speed, mode 0 or 1 may be better.
380                 [ sensors.conf:   fan#_tach_mode ]
381    spinup_ctl   Setting spinup_ctl to 1 will modify the fan spinup
382                 algorithm.  Instead of setting the PWM to 100% for
383                 the configured period of time, it will be set to 100%
384                 until the measured RPM is greater than the RPM limit
385                 register or the time period elapses.
386                 [ sensors.conf:   pwm#_spinup_ctl ]
387
388The Analog Devices ADM1027 has several vendor specific enhancements.
389The number of pulses-per-rev of the fans can be set, Tach monitoring
390can be optimized for PWM operation, and an offset can be applied to
391the temperatures to compensate for systemic errors in the
392measurements.
393
394    Name           Values
395   ------------ --------------------------------------------------
396    tach_mode    For best fan speed measurement when PWM's are in use,
397                 the Tach Mode should be set to 0.  If PWM's are not
398                 in use or not wired to control fan speed, a mode of 1
399                 can be selected.  This will also increase the rate
400                 of fan speed measurement from 1 per second to 4 per
401                 second.
402                 [ sensors.conf:   fan#_tach_mode ]
403    fan_ppr      You can set the pulses per rev to 1, 2, 3 or 4 so
404                 that fan speeds don't have to be scaled.
405                 [ sensors.conf:   fan#_ppr ]
406    temp#_offset This is the value to be added or subtracted from the
407                 measured temperature before reporting it.  This also
408                 affects the PWM control algorithms.
409                 [ sensors.conf:   temp#_offset ]
410
411In addition to the ADM1027 features, the ADT7463 also has Tmin control
412and THERM asserted counts.  Automatic Tmin control acts to adjust the
413Tmin value to maintain the measured temperature sensor at a specified
414temperature.  There isn't much documentation on this feature in the
415ADT7463 data sheet.   The following values control this feature.
416(These are not available via sensors.conf)
417
418    Enable Flag   -- When set to 1, the Tmin control is enabled.  When
419                     set to 0, Tmin will remain unchanged.
420                     [ 1 means Tmin control is enabled ]
421                     [ sensors.conf:  none ]
422    Control Loop  -- This value sets the cycle time of the control
423                     loop which adjusts the Tmin value.  The mapping
424                     from raw value to loop period is non-linear.
425                     [ Raw value from 0 to 7 (4sec) ]
426                     [ sensors.conf:  none ]
427    Set on THERM  -- If enabled, this causes the operating point to be
428                     set from the current temperature when THERM is
429                     asserted.  If THERM is connected to a PROC_HOT
430                     signal, this can automatically set the operating
431                     point to the highest value that is within spec.
432                     allowing the lowest/quietest fan speed possible.
433                     [ 1 means set op-point on THERM asserted ]
434                     [ sensors.conf:  none ]
435    Target Temp   -- This is the target temperature.  Tmin will be
436                     adjusted to keep the measured temperature at this
437                     value.
438                     [ degC -127 to 127 degC ]
439                     [ sensors.conf:  none ]
440
441The THERM signal monitoring has three parameters:
442
443    THERM Limit   -- How long THERM can be asserted before an ALARM is
444                     triggered.
445                     [ 22.7 ms counts ]
446                     [ sensors.conf:  none ]
447    THERM Total   -- How long THERM has been asserted since the driver
448                     was loaded.
449                     [ 22.7 ms counts ]
450                     [ sensors.conf:  none ]
451    Overflows     -- How many times the THERM counter was read with a
452                     max value indicating it overflowed.
453                     [ count ]
454                     [ sensors.conf:  none ]
455
456These values are available via /proc under the following names in the
457listed order.
458
459    Name           Values
460   ------------ --------------------------------------------------
461    tmin_ctl#    Enable, Control Period, Set on THREM, Target
462    therm_signal Limit, Total, Overflows
463
464
465* Sample sensors.conf Config File
466
467Here is a sample LM85 chip config for sensors.conf
468
469--------- cut here ---------
470chip "lm85c-*" "adm1027-*" "adt7463-*" "lm85-*" "lm85b-*"
471
472# Voltage inputs
473   label in0   "V1.5"      # AGP on Intel S845WD1-E
474   label in1   "VCore"
475   label in2   "V3.3"
476   label in3   "V5"
477   label in4   "V12"
478
479# Temperature inputs
480   label temp1  "CPU"
481   label temp2  "Board"
482   label temp3  "Remote"
483
484# Fan inputs
485   label fan1   "CPU_Fan"
486   label fan2   "Fan2"
487   label fan3   "Fan3"
488   label fan4   "Fan4"
489
490# PWM Outputs
491   label pwm1   "CPU_PWM"
492   label pwm2   "Fan2_PWM"
493   label pwm3   "Fan3_PWM"
494
495# Voltage scaling is done on-chip.  No 'compute' directive
496#    should be necessary.  If in0 has external scaling set
497#    it here.
498
499#   compute in0  @ * 2.5,   @ / 2.5
500
501# Adjust fans speeds for actual pulses per rev
502   compute fan1  @ * 2,  @ / 2    # 1 pulse per rev
503#  set fan1_ppr  1                # ADM1027 or ADT7463
504   compute fan2  @ / 2,  @ * 2    # 4 pulse per rev
505#  set fan2_ppr  4                # ADM1027 or ADT7463
506
507# Set VRM version
508   set vrm  9.1   # Pentium 4
509
510# Set voltage limits
511   set in0_min  1.5 * 0.95
512   set in0_max  1.5 * 1.05
513   set in1_min  vid * 0.95
514   set in1_max  vid * 1.05
515   set in2_min  3.3 * 0.95
516   set in2_max  3.3 * 1.05
517   set in3_min  5.0 * 0.95
518   set in3_max  5.0 * 1.05
519   set in4_min   12 * 0.95
520   set in4_max   12 * 1.05
521
522# Set Fan limits
523   set fan1_min  3000
524   set fan2_min  3000
525   set fan3_min  3000
526   set fan4_min  3000
527
Note: See TracBrowser for help on using the browser.