first draft at a driver for LM93

git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@2653 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark M. Hoffman committed 2004-08-05 03:44:30 +00:00
1 parent 6cd3332205
commit 57320d467a
5 files changed
+1667

No files matched your search

+206
View File
@@ -0,0 +1,206 @@
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
Set to non-zero to disable SMBus block data transactions (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%.
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.
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.
LM93 Unique /proc Files
-----------------------
file description
-------------------------------------------------------------
prochot<n> limit, current, and moving average #PROCHOT %
prochot_short enable or disable logical #PROCHOT pin short
fan<n>_smart_tach enable or disable smart tach mode
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"
+1
View File
@@ -32,6 +32,7 @@ endif
KERNELCHIPSTARGETS += $(MODULE_DIR)/ds1307.o
KERNELCHIPSTARGETS += $(MODULE_DIR)/lm83.o
KERNELCHIPSTARGETS += $(MODULE_DIR)/lm90.o
KERNELCHIPSTARGETS += $(MODULE_DIR)/lm93.o
KERNELCHIPSTARGETS += $(MODULE_DIR)/max1619.o
KERNELCHIPSTARGETS += $(MODULE_DIR)/max6650.o
KERNELCHIPSTARGETS += $(MODULE_DIR)/saa1064.o
+1318
View File
File diff suppressed because it is too large. Load diff
+68
View File
@@ -1097,6 +1097,73 @@ static sensors_chip_feature as99127f_features[] =
{ 0 }
};
/* macro for LM93 voltage in/min/max entries */
#define SENSORS_LM93_IN_MIN_MAX(nr) \
{ SENSORS_LM93_IN##nr, "in" #nr, NOMAP, \
NOMAP, R, LM93_SYSCTL_IN##nr, \
VALUE(3), 2}, \
{ SENSORS_LM93_IN##nr##_MIN, "in" #nr "_min", SENSORS_LM93_IN##nr, \
SENSORS_LM93_IN##nr, RW, LM93_SYSCTL_IN##nr, \
VALUE(1), 2 }, \
{ SENSORS_LM93_IN##nr##_MAX, "in" #nr "_max", SENSORS_LM93_IN##nr, \
SENSORS_LM93_IN##nr, RW, LM93_SYSCTL_IN##nr, \
VALUE(2), 2 }
/* macro for LM93 fan/min entries */
#define SENSORS_LM93_FAN_MIN(nr) \
{ SENSORS_LM93_FAN##nr, "fan" #nr, NOMAP, \
NOMAP, R, LM93_SYSCTL_FAN##nr, \
VALUE(2), 0 }, \
{ SENSORS_LM93_FAN##nr##_MIN, "fan" #nr "_min", \
SENSORS_LM93_FAN##nr, SENSORS_LM93_FAN##nr, \
RW, LM93_SYSCTL_FAN##nr, VALUE(1), 0 }
/* macro for LM93 temp/min/max entries */
#define SENSORS_LM93_TEMP_MIN_MAX(nr) \
{ SENSORS_LM93_TEMP##nr, "temp" #nr, NOMAP, \
NOMAP, R, LM93_SYSCTL_TEMP##nr, \
VALUE(3), 1 }, \
{ SENSORS_LM93_TEMP##nr##_MAX, "temp" #nr "_max", \
SENSORS_LM93_TEMP##nr, SENSORS_LM93_TEMP##nr, \
RW, LM93_SYSCTL_TEMP##nr, VALUE(1), 1 }, \
{ SENSORS_LM93_TEMP##nr##_MIN, "temp" #nr "_min", \
SENSORS_LM93_TEMP##nr, SENSORS_LM93_TEMP##nr, \
RW, LM93_SYSCTL_TEMP##nr, VALUE(2), 1 }
/* macro for LM93 VID entries */
#define SENSORS_LM93_VID(nr) \
{ SENSORS_LM93_VID##nr, "vid" #nr, NOMAP, NOMAP, R, \
LM93_SYSCTL_VID##nr, VALUE(1), 3 }
static sensors_chip_feature lm93_features[] = {
SENSORS_LM93_IN_MIN_MAX(1),
SENSORS_LM93_IN_MIN_MAX(2),
SENSORS_LM93_IN_MIN_MAX(3),
SENSORS_LM93_IN_MIN_MAX(4),
SENSORS_LM93_IN_MIN_MAX(5),
SENSORS_LM93_IN_MIN_MAX(6),
SENSORS_LM93_IN_MIN_MAX(7),
SENSORS_LM93_IN_MIN_MAX(8),
SENSORS_LM93_IN_MIN_MAX(9),
SENSORS_LM93_IN_MIN_MAX(10),
SENSORS_LM93_IN_MIN_MAX(11),
SENSORS_LM93_IN_MIN_MAX(12),
SENSORS_LM93_IN_MIN_MAX(13),
SENSORS_LM93_IN_MIN_MAX(14),
SENSORS_LM93_IN_MIN_MAX(15),
SENSORS_LM93_IN_MIN_MAX(16),
SENSORS_LM93_FAN_MIN(1),
SENSORS_LM93_FAN_MIN(2),
SENSORS_LM93_FAN_MIN(3),
SENSORS_LM93_FAN_MIN(4),
SENSORS_LM93_TEMP_MIN_MAX(1),
SENSORS_LM93_TEMP_MIN_MAX(2),
SENSORS_LM93_TEMP_MIN_MAX(3),
SENSORS_LM93_VID(1),
SENSORS_LM93_VID(2),
{ 0 }
};
/* macro for ASB100 Bach voltage in/min/max entries */
#define SENSORS_ASB100_IN_MIN_MAX(nr) \
{ SENSORS_ASB100_IN##nr, "in" #nr, NOMAP, \
@@ -5221,5 +5288,6 @@ sensors_chip_features sensors_chip_features_list[] =
{ SENSORS_MAX6650_PREFIX, max6650_features },
{ SENSORS_ADM1030_PREFIX, adm1030_features },
{ SENSORS_ADM1031_PREFIX, adm1031_features },
{ SENSORS_LM93_PREFIX, lm93_features },
{ 0 }
};
+74
View File
@@ -1835,6 +1835,80 @@
#define SENSORS_BMC_CURR1_MIN 3101 /* RW */
#define SENSORS_BMC_CURR1_MAX 3201 /* RW */
#define SENSORS_LM93_PREFIX "lm93"
#define SENSORS_LM93_IN1 1011
#define SENSORS_LM93_IN1_MIN 1012
#define SENSORS_LM93_IN1_MAX 1013
#define SENSORS_LM93_IN2 1021
#define SENSORS_LM93_IN2_MIN 1022
#define SENSORS_LM93_IN2_MAX 1023
#define SENSORS_LM93_IN3 1031
#define SENSORS_LM93_IN3_MIN 1032
#define SENSORS_LM93_IN3_MAX 1033
#define SENSORS_LM93_IN4 1041
#define SENSORS_LM93_IN4_MIN 1042
#define SENSORS_LM93_IN4_MAX 1043
#define SENSORS_LM93_IN5 1051
#define SENSORS_LM93_IN5_MIN 1052
#define SENSORS_LM93_IN5_MAX 1053
#define SENSORS_LM93_IN6 1061
#define SENSORS_LM93_IN6_MIN 1062
#define SENSORS_LM93_IN6_MAX 1063
#define SENSORS_LM93_IN7 1071
#define SENSORS_LM93_IN7_MIN 1072
#define SENSORS_LM93_IN7_MAX 1073
#define SENSORS_LM93_IN8 1081
#define SENSORS_LM93_IN8_MIN 1082
#define SENSORS_LM93_IN8_MAX 1083
#define SENSORS_LM93_IN9 1091
#define SENSORS_LM93_IN9_MIN 1092
#define SENSORS_LM93_IN9_MAX 1093
#define SENSORS_LM93_IN10 1101
#define SENSORS_LM93_IN10_MIN 1102
#define SENSORS_LM93_IN10_MAX 1103
#define SENSORS_LM93_IN11 1111
#define SENSORS_LM93_IN11_MIN 1112
#define SENSORS_LM93_IN11_MAX 1113
#define SENSORS_LM93_IN12 1121
#define SENSORS_LM93_IN12_MIN 1122
#define SENSORS_LM93_IN12_MAX 1123
#define SENSORS_LM93_IN13 1131
#define SENSORS_LM93_IN13_MIN 1132
#define SENSORS_LM93_IN13_MAX 1133
#define SENSORS_LM93_IN14 1141
#define SENSORS_LM93_IN14_MIN 1142
#define SENSORS_LM93_IN14_MAX 1143
#define SENSORS_LM93_IN15 1151
#define SENSORS_LM93_IN15_MIN 1152
#define SENSORS_LM93_IN15_MAX 1153
#define SENSORS_LM93_IN16 1161
#define SENSORS_LM93_IN16_MIN 1162
#define SENSORS_LM93_IN16_MAX 1163
#define SENSORS_LM93_TEMP1 2011
#define SENSORS_LM93_TEMP1_MIN 2012
#define SENSORS_LM93_TEMP1_MAX 2013
#define SENSORS_LM93_TEMP2 2021
#define SENSORS_LM93_TEMP2_MIN 2022
#define SENSORS_LM93_TEMP2_MAX 2023
#define SENSORS_LM93_TEMP3 2031
#define SENSORS_LM93_TEMP3_MIN 2032
#define SENSORS_LM93_TEMP3_MAX 2033
#define SENSORS_LM93_FAN1 3011
#define SENSORS_LM93_FAN1_MIN 3012
#define SENSORS_LM93_FAN2 3021
#define SENSORS_LM93_FAN2_MIN 3022
#define SENSORS_LM93_FAN3 3031
#define SENSORS_LM93_FAN3_MIN 3032
#define SENSORS_LM93_FAN4 3041
#define SENSORS_LM93_FAN4_MIN 3042
#define SENSORS_LM93_VID1 4001
#define SENSORS_LM93_VID2 4002
#define SENSORS_ASB100_PREFIX "asb100"
#define SENSORS_ASB100_IN0 0x01 /* R */