mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-02 13:30:30 +00:00
* reading #VRDHOT inputs * reading GPIO pins (input only for now) * reading alarms status * #PROCHOT override control * #PROCHOT sampling interval control * Manual PWM output control * PWM output frequency control Also, some whitespace cleanup in the driver. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2660 7894878c-1315-0410-8ee3-d5d059ff63e0
271 lines
9.0 KiB
Plaintext
271 lines
9.0 KiB
Plaintext
Kernel driver 'lm93.o'
|
|
======================
|
|
|
|
Status: In progress
|
|
|
|
Supported chips:
|
|
* National Semiconductor LM93
|
|
Prefix 'lm93'
|
|
Addresses scanned: I2C 0x2c-0x2e
|
|
|
|
Author:
|
|
Mark M. Hoffman <mhoffman@lightlink.com>
|
|
|
|
|
|
Module Parameters
|
|
-----------------
|
|
|
|
(specific to LM93)
|
|
* init: integer
|
|
Set to zero to disable some initializations (default is 1)
|
|
* disable_block: integer
|
|
A "0" allows SMBus block data transactions if the host supports them. A "1"
|
|
disables SMBus block data transactions. The default is 0.
|
|
* vccp_limit_type: integer array (2)
|
|
Configures in7 and in8 limit type, where 0 means absolute and non-zero
|
|
means relative. "Relative" here refers to "Dynamic Vccp Monitoring using
|
|
VID" from the datasheet. It greatly simplifies the interface to allow
|
|
only one set of limits (absolute or relative) to be in operation at a
|
|
time (even though the hardware is capable of enabling both). There's
|
|
not a compelling use case for enabling both at once, anyway. The default
|
|
is "0,0".
|
|
|
|
(common among sensor drivers)
|
|
* force: short array (min = 1, max = 48)
|
|
List of adapter,address pairs to assume to be present. Autodetection
|
|
of the target device will still be attempted. Use one of the more
|
|
specific force directives below if this doesn't detect the device.
|
|
* force_lm93: short array (min = 1, max = 48)
|
|
List of adapter,address pairs which are unquestionably assumed to contain
|
|
a 'lm93' chip
|
|
* ignore: short array (min = 1, max = 48)
|
|
List of adapter,address pairs not to scan
|
|
* ignore_range: short array (min = 1, max = 48)
|
|
List of adapter,start-addr,end-addr triples not to scan
|
|
* probe: short array (min = 1, max = 48)
|
|
List of adapter,address pairs to scan additionally
|
|
* probe_range: short array (min = 1, max = 48)
|
|
List of adapter,start-addr,end-addr triples to scan additionally
|
|
|
|
|
|
Hardware Description
|
|
--------------------
|
|
|
|
(from the datasheet)
|
|
|
|
The LM93, hardware monitor, has a two wire digital interface compatible with
|
|
SMBus 2.0. Using an 8-bit ADC, the LM93 measures the temperature of two remote
|
|
diode connected transistors as well as its own die and 16 power supply
|
|
voltages. To set fan speed, the LM93 has two PWM outputs that are each
|
|
controlled by up to four temperature zones. The fancontrol algorithm is lookup
|
|
table based. The LM93 includes a digital filter that can be invoked to smooth
|
|
temperature readings for better control of fan speed. The LM93 has four
|
|
tachometer inputs to measure fan speed. Limit and status registers for all
|
|
measured values are included. The LM93 builds upon the functionality of
|
|
previous motherboard management ASICs and uses some of the LM85 s features
|
|
(i.e. smart tachometer mode). It also adds measurement and control support
|
|
for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
|
|
processor Xeon class motherboard with a minimum of external components.
|
|
|
|
|
|
Driver Description
|
|
------------------
|
|
|
|
This driver implements support for the National Semiconductor LM93.
|
|
|
|
|
|
User Interface
|
|
--------------
|
|
|
|
#PROCHOT:
|
|
|
|
The LM93 can monitor two #PROCHOT signals. The results are found in the
|
|
/proc files prochot1 and prochot2. There are two values per file: the first
|
|
value is the user limit. The second value is the current reading for the
|
|
most recent complete time interval. The third value is something like a
|
|
2 period exponential moving average (but not quite - check the datasheet).
|
|
Note that this third value is calculated by the chip itself. All values
|
|
range from 0-255 where 0 indicates no throttling, and 255 indicates > 99.6%.
|
|
|
|
The monitoring intervals for the two #PROCHOT signals is also configurable.
|
|
These intervals can be found in the /proc file prochot_interval. There are
|
|
two values in this file: one each for #P1_PROCHOT and #P2_PROCHOT, res-
|
|
pectively. Selecting a value not in this list will cause the driver to
|
|
use the next largest interval. The available intervals are:
|
|
|
|
#PROCHOT intervals: 0.73, 1.46, 2.9, 5.8, 11.7, 23.3, 46.6, 93.2, 186, 372
|
|
|
|
It is possible to configure the LM93 to logically short the two #PROCHOT
|
|
signals. I.e. when #P1_PROCHOT is asserted, the LM93 will automatically
|
|
assert #P2_PROCHOT, and vice-versa. This mode is enabled by writing a
|
|
non-zero integer to the /proc file prochot_short.
|
|
|
|
The LM93 can also override the #PROCHOT pins by driving a PWM signal onto
|
|
one or both of them. When overridden, the signal has a period of 3.56 mS,
|
|
a minimum pulse width of 5 clocks (at 22.5kHz => 6.25% duty cycle), and
|
|
a maximum pulse width of 80 clocks (at 22.5kHz => 99.88% duty cycle).
|
|
|
|
The /proc file prochot_override has three values. The first two are boolean
|
|
integers which enable/disable the override funtion for #P1_PROCHOT and
|
|
#P2_PROCHOT, the third value is 0-15 where 0 indicates minimum duty cycle
|
|
and 15 indicates maximum.
|
|
|
|
#VRD_HOT:
|
|
|
|
The LM93 can monitor two #VRD_HOT signals. The results are found in the
|
|
/proc files vrdhot1 and vrdhot2. There is one value per file: a boolean for
|
|
which 1 indicates #VRD_HOT is asserted and 0 indicates it is negated. These
|
|
files are read-only.
|
|
|
|
Smart Tach Mode:
|
|
|
|
(from the datasheet)
|
|
|
|
If a fan is driven using a low-side drive PWM, the tachometer
|
|
output of the fan is corrupted. The LM93 includes smart tachometer
|
|
circuitry that allows an accurate tachometer reading to be
|
|
achieved despite the signal corruption. In smart tach mode all
|
|
four signals are measured within 4 seconds.
|
|
|
|
Smart tach mode is enabled by the driver by writing 1 or 2 (associating the
|
|
the fan tachometer with a pwm) to the /proc file fan<n>_smart_tach. A zero
|
|
will disable the function for that fan. Note that Smart tach mode cannot be
|
|
enabled if the PWM output frequency is 22500 Hz (see below).
|
|
|
|
Manual PWM:
|
|
|
|
The LM93 has a fixed or override mode for the two PWM outputs (although, there
|
|
are still some conditions that will override even this mode - see section
|
|
15.10.6 of the datasheet for details.) The /proc files pwm1 and pwm2 are
|
|
used to enable and control this mode. The first value of the file is an
|
|
integer (0-255) where 0 is 0% duty cycle, and 255 is 100%. The second value
|
|
is a boolean integer where 0 disables and 1 enables the manual control mode.
|
|
Note that the duty cycle values are constrained by the hardware. Selecting
|
|
a value which is not available will cause the driver to use the next largest
|
|
value. Also note: when manual PWM mode is disabled, the first value of the
|
|
/proc files indicates the current duty cycle chosen by the h/w.
|
|
|
|
PWM Output Frequency:
|
|
|
|
The LM93 supports several different frequencies for the PWM output channels.
|
|
The /proc files pwm1_freq and pwm2_freq are used to select the frequency. The
|
|
frequency values are constrained by the hardware. Selecting a value which is
|
|
not available will cause the driver to use the next largest value. Also note
|
|
that this parameter has implications for the Smart Tach Mode (see above).
|
|
|
|
PWM Output Frequencies: 12, 36, 48, 60, 72, 84, 96, 22500 (h/w default)
|
|
|
|
GPIO Pins:
|
|
|
|
The LM93 can monitor the logic level of four dedicated GPIO pins as well as the
|
|
four tach input pins. GPIO0-GPIO3 correspond to (fan) tach 1-4, respectively.
|
|
All eight GPIOs are read by reading the bitmask in the /proc file gpio. The
|
|
LSB is GPIO0, and the MSB is GPIO7.
|
|
|
|
LM93 Unique /proc Files
|
|
-----------------------
|
|
|
|
file description
|
|
-------------------------------------------------------------
|
|
|
|
prochot<n> limit, current, and moving average #PROCHOT %
|
|
|
|
prochot_short enable or disable logical #PROCHOT pin short
|
|
|
|
prochot_override force #PROCHOT assertion as PWM
|
|
|
|
prochot_interval #PROCHOT PWM sampling interval
|
|
|
|
vrdhot<n> 0 means negated, 1 means asserted
|
|
|
|
fan<n>_smart_tach enable or disable smart tach mode
|
|
|
|
gpio input state of 8 GPIO pins; read-only
|
|
|
|
|
|
Sample Configuration File
|
|
-------------------------
|
|
|
|
Here is a sample LM93 chip config for sensors.conf:
|
|
|
|
---------- cut here ----------
|
|
chip "lm93-*"
|
|
|
|
# VOLTAGE INPUTS
|
|
|
|
# labels and scaling based on datasheet recommendations
|
|
label in1 "+12V1"
|
|
compute in1 @ * 12.945, @ / 12.945
|
|
set in1_min 12 * 0.90
|
|
set in1_max 12 * 1.10
|
|
|
|
label in2 "+12V2"
|
|
compute in2 @ * 12.945, @ / 12.945
|
|
set in2_min 12 * 0.90
|
|
set in2_max 12 * 1.10
|
|
|
|
label in3 "+12V3"
|
|
compute in3 @ * 12.945, @ / 12.945
|
|
set in3_min 12 * 0.90
|
|
set in3_max 12 * 1.10
|
|
|
|
label in4 "FSB_Vtt"
|
|
|
|
label in5 "3GIO"
|
|
|
|
label in6 "ICH_Core"
|
|
|
|
label in7 "Vccp1"
|
|
|
|
label in8 "Vccp2"
|
|
|
|
label in9 "+3.3V"
|
|
set in9_min 3.3 * 0.90
|
|
set in9_max 3.3 * 1.10
|
|
|
|
label in10 "+5V"
|
|
set in10_min 5.0 * 0.90
|
|
set in10_max 5.0 * 1.10
|
|
|
|
label in11 "SCSI_Core"
|
|
|
|
label in12 "Mem_Core"
|
|
|
|
label in13 "Mem_Vtt"
|
|
|
|
label in14 "Gbit_Core"
|
|
|
|
# Assuming R1/R2 = 4.1143, and 3.3V reference
|
|
# -12V = (4.1143 + 1) * (@ - 3.3) + 3.3
|
|
label in15 "-12V"
|
|
compute in15 @ * 5.1143 - 13.57719, (@ + 13.57719) / 5.1143
|
|
set in15_min -12 * 0.90
|
|
set in15_max -12 * 1.10
|
|
|
|
label in16 "+3.3VSB"
|
|
set in16_min 3.3 * 0.90
|
|
set in16_max 3.3 * 1.10
|
|
|
|
# TEMPERATURE INPUTS
|
|
|
|
label temp1 "CPU1"
|
|
label temp2 "CPU2"
|
|
label temp3 "LM93"
|
|
|
|
# TACHOMETER INPUTS
|
|
|
|
label fan1 "Fan1"
|
|
set fan1_min 3000
|
|
label fan2 "Fan2"
|
|
set fan2_min 3000
|
|
label fan3 "Fan3"
|
|
set fan3_min 3000
|
|
label fan4 "Fan4"
|
|
set fan4_min 3000
|
|
|
|
# PWM OUTPUTS
|
|
|
|
label pwm1 "CPU1"
|
|
label pwm2 "CPU2"
|
|
|