Various clean-ups:
1. Trange sysctl's belong to the temp sensors, not to the fan controllers 2. Trange really describes a slope on many chips, so modify the description 3. Most of the sysctl's are read/write even if the chip's config is locked; reflect that in the CTLFLAGs 4. Apply correct 'nominal' values for voltage sensors/limits, specify them in microVolts, and calculate once rather than each time needed 5. Be more consistent in register names - for example, use VCC instead of SUPPLY_VOLTAGE, to match VCC_LOWLIM & VCC_HIGHLIM 6. Type of dbcool_islocked() should be bool, not int 7. Reduce some unnecessary code indentation 8. Define Vtt and Imon, and add ADT7490 support (excluding PECI sensors) 9. Split the huge (250+ lines) dbcool_setup() function into a few smaller routines for better readability 10. Update sensor tables for ADT7476 and ADT7468 - these chips have five voltage sensors, not two 11. Adjust flags for ADT7463 and ADM1027 - these chips can monitor CPU VID data bits 12. Update man page
This commit is contained in:
parent
e15435197f
commit
aef4db128d
|
@ -1,4 +1,4 @@
|
|||
.\" $NetBSD: dbcool.4,v 1.2 2008/10/02 07:55:26 wiz Exp $
|
||||
.\" $NetBSD: dbcool.4,v 1.3 2008/10/06 01:35:35 pgoyette Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
|
@ -27,19 +27,21 @@
|
|||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd September 28, 2008
|
||||
.Dd October 5, 2008
|
||||
.Dt DBCOOL 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm dbcool ,
|
||||
.Nm adm1027 ,
|
||||
.Nm adm1030 ,
|
||||
.Nm adt7463 ,
|
||||
.Nm adt7466 ,
|
||||
.Nm adt7467 ,
|
||||
.Nm adt7468 ,
|
||||
.Nm adt7473 ,
|
||||
.Nm adt7475 ,
|
||||
.Nm adt7476
|
||||
.Nm adt7476 ,
|
||||
.Nm adt7490
|
||||
.Nd dbCool(tm) family of environmental monitors and fan controllers
|
||||
.Sh SYNOPSIS
|
||||
.Cd "dbcool* at ki2c?"
|
||||
|
@ -53,7 +55,7 @@ dbCool environmental monitor chips to be used with the
|
|||
.Xr envsys 4
|
||||
API.
|
||||
.Pp
|
||||
These chips support up to twelve sensors.
|
||||
These chips support up to fourteen sensors.
|
||||
Not all of the following sensors are supported on all chips.
|
||||
.Bl -column "Sensor" "Units" "Typical" -offset indent
|
||||
.It Sy "Sensor" Ta Sy "Units" Ta Sy "Typical Use"
|
||||
|
@ -65,6 +67,8 @@ Not all of the following sensors are supported on all chips.
|
|||
.It Li "2.5V" Ta "uV DC" Ta "2.5V supply"
|
||||
.It Li "5V" Ta "uV DC" Ta "5V supply"
|
||||
.It Li "12V" Ta "uV DC" Ta "12V supply"
|
||||
.It Li "Vtt" Ta "uV DC" Ta "PECI ref. voltage (2.25V ref, ADT7490 only)"
|
||||
.It Li "Imon" Ta "uV DC" Ta "Current monitor (2.25V ref, ADT7490 only)"
|
||||
.It Li "AIN1" Ta "uV DC" Ta "Analog In (2.25V ref, ADT7466 only)"
|
||||
.It Li "AIN2" Ta "uV DC" Ta "Analog In (2.25V ref, ADT7466 only)"
|
||||
.It Li "fan1" Ta "RPM" Ta "Chassis Fan"
|
||||
|
@ -73,7 +77,7 @@ Not all of the following sensors are supported on all chips.
|
|||
.It Li "fan4" Ta "RPM" Ta "Chassis Fan"
|
||||
.El
|
||||
.Pp
|
||||
Except on the ADT7466, each temperature and voltage sensor has a
|
||||
Each temperature and voltage sensor has a
|
||||
programmable high- and low-limit; fan sensors have only a low-limit.
|
||||
The user can set the threshold values using
|
||||
.Xr sysctl 8
|
||||
|
@ -87,6 +91,7 @@ hw.dbcool0.Vcc.hi_lim = 2750 milliVolts
|
|||
.Pp
|
||||
Temperature sensors also have
|
||||
.Em Tmin ,
|
||||
.Em Trange ,
|
||||
.Em Thyst ,
|
||||
and
|
||||
.Em Ttherm
|
||||
|
@ -125,15 +130,10 @@ Each fan controller is programmable using the following
|
|||
variables.
|
||||
.Bd -literal -offset indent
|
||||
hw.dbcool0.fan_ctl_0.behavior
|
||||
hw.dbcool0.fan_ctl_0.range
|
||||
hw.dbcool0.fan_ctl_0.min_duty
|
||||
hw.dbcool0.fan_ctl_0.max_duty
|
||||
hw.dbcool0.fan_ctl_0.cur_duty
|
||||
.Ed
|
||||
(On the ADM1030, the
|
||||
.Em range
|
||||
variable is associated with each individual temperature sensor rather
|
||||
than with the fan controller.)
|
||||
.Pp
|
||||
The
|
||||
.Em behavior
|
||||
|
@ -232,7 +232,7 @@ will set appropriate limits for CPU temperature and chip supply
|
|||
voltage, and powerd will be notified if the limits are exceeded:
|
||||
.Bd -literal -offset indent
|
||||
dbcool0 {
|
||||
sensor0 {
|
||||
sensor1 {
|
||||
warning-max = 60C;
|
||||
critical-max = 65C;
|
||||
}
|
||||
|
@ -248,9 +248,9 @@ Alternatively, set the following commands in
|
|||
.Pa /etc/sysctl.conf
|
||||
to perform limit checking in the hardware:
|
||||
.Bd -literal -offset indent
|
||||
hw.dbcool0.l_temp.hi_lim = 65
|
||||
hw.dbcool0.Vcc.low_lim = 3200
|
||||
hw.dbcool0.Vcc.hi_lim = 3500
|
||||
hw.dbcool0.r1_temp.hi_lim = 65
|
||||
hw.dbcool0.Vcc.low_lim = 3200000
|
||||
hw.dbcool0.Vcc.hi_lim = 3500000
|
||||
.Ed
|
||||
.Sh SEE ALSO
|
||||
.Xr envsys 4 ,
|
||||
|
@ -271,5 +271,8 @@ and refreshed.
|
|||
.Pp
|
||||
The ADT7466 chip, although officially a member of the dbCool family, is
|
||||
programmed quite differently.
|
||||
The fan controllers and sensor limits on this chip are not currently
|
||||
implemented.
|
||||
The fan controllers on this chip are not currently implemented.
|
||||
.Pp
|
||||
The PECI (Processor Environment Control Interface) temperature sensors
|
||||
and the associated PWM behavior modes on the ADT7490 are not currently
|
||||
supported.
|
||||
|
|
1085
sys/dev/i2c/dbcool.c
1085
sys/dev/i2c/dbcool.c
File diff suppressed because it is too large
Load Diff
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dbcool_reg.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp $ */
|
||||
/* $NetBSD: dbcool_reg.h,v 1.2 2008/10/06 01:35:35 pgoyette Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
#define DBCOOLREG_H
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.2 2008/10/06 01:35:35 pgoyette Exp $");
|
||||
|
||||
#define DBCOOL_ADDRMASK 0x7f
|
||||
#define DBCOOL_ADDR 0x2e /* Some chips have multiple addrs */
|
||||
|
@ -55,16 +55,16 @@ __KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp
|
|||
#define DBCOOL_INT_TRIP_FIXED 0x17
|
||||
#define DBCOOL_EXT_TRIP_FIXED 0x18
|
||||
#define DBCOOL_ANALOG_OUT 0x19
|
||||
#define DBCOOL_PECI1 0x1A
|
||||
#define DBCOOL_PECI2 0x1B
|
||||
#define DBCOOL_PECI3 0x1C
|
||||
#define DBCOOL_PECI1_TEMP 0x1A
|
||||
#define DBCOOL_PECI2_TEMP 0x1B
|
||||
#define DBCOOL_PECI3_TEMP 0x1C
|
||||
#define DBCOOL_IMON 0x1D
|
||||
#define DBCOOL_VTT 0x1E
|
||||
#define DBCOOL_EXTRES 0x1F
|
||||
#define DBCOOL_EXTRES_VTT_IMON 0x1F
|
||||
#define DBCOOL_OFFSET 0x1F
|
||||
#define DBCOOL_25VIN 0x20
|
||||
#define DBCOOL_CPU_VOLTAGE 0x21
|
||||
#define DBCOOL_SUPPLY_VOLTAGE 0x22
|
||||
#define DBCOOL_VCCP 0x21
|
||||
#define DBCOOL_VCC 0x22
|
||||
#define DBCOOL_5VIN 0x23
|
||||
#define DBCOOL_12VIN 0x24
|
||||
#define DBCOOL_CPU_VOLTAGE2 0x25
|
||||
|
@ -98,10 +98,11 @@ __KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp
|
|||
#define DBCOOL_PWM2_MAXDUTY 0x39
|
||||
#define DBCOOL_PWM3_MAXDUTY 0x3A
|
||||
/*
|
||||
* Note: ADT7490 reused the Device_ID register for PECI Tcontrol limit
|
||||
* Note: ADT7490 reused the Device_ID register for PECI Tcontrol value
|
||||
* (equivalent to Ttherm for the regular temp sensors)
|
||||
*/
|
||||
#define DBCOOL_DEVICEID_REG 0x3D
|
||||
#define DBCOOL_PECI_TCRTL_LIM 0x3D
|
||||
#define DBCOOL_PECI_TCONTROL 0x3D
|
||||
#define DBCOOL_COMPANYID_REG 0x3E
|
||||
#define DBCOOL_REVISION_REG 0x3F
|
||||
#define DBCOOL_CONFIG1_REG 0x40
|
||||
|
@ -140,9 +141,9 @@ __KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp
|
|||
#define DBCOOL_PWM1_CTL 0x5C
|
||||
#define DBCOOL_PWM2_CTL 0x5D
|
||||
#define DBCOOL_PWM3_CTL 0x5E
|
||||
#define DBCOOL_PWM1_TRANGE 0x5F
|
||||
#define DBCOOL_PWM2_TRANGE 0x60
|
||||
#define DBCOOL_PWM3_TRANGE 0x61
|
||||
#define DBCOOL_REMOTE1_TRANGE 0x5F /* Bits [7:4] */
|
||||
#define DBCOOL_LOCAL_TRANGE 0x60 /* Bits [7:4] */
|
||||
#define DBCOOL_REMOTE2_TRANGE 0x61 /* Bits [7:4] */
|
||||
#define DBCOOL_ENH_ACOUST_1 0x62
|
||||
#define DBCOOL_ENH_ACOUST_2 0x63
|
||||
#define DBCOOL_PWM1_MINDUTY 0x64
|
||||
|
@ -375,18 +376,20 @@ __KERNEL_RCSID(0, "$NetBSD: dbcool_reg.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp
|
|||
#define ADM1030_DEVICEID 0x30
|
||||
#define ADT7463_DEVICEID 0x27
|
||||
#define ADT7466_DEVICEID 0x66
|
||||
#define ADT7467_DEVICEID 0x67
|
||||
#define ADT7468_DEVICEID 0x68
|
||||
#define ADT7467_DEVICEID 0x68 /* The ADT7467/7468 cannot be */
|
||||
#define ADT7468_DEVICEID 0x68 /* distinguished by DEVICEID */
|
||||
#define ADT7473_DEVICEID 0x73
|
||||
#define ADT7475_DEVICEID 0x75
|
||||
#define ADT7476_DEVICEID 0x76
|
||||
#define ADT7490_DEVICEID 0xFF /* Device ID not used on 7490 */
|
||||
|
||||
#define ADM1027_REV_ID 0x60
|
||||
#define ADT7463_REV_ID1 0x62
|
||||
#define ADT7463_REV_ID2 0x6A
|
||||
#define ADT7467_REV_ID1 0x71
|
||||
#define ADT7467_REV_ID2 0x72
|
||||
#define ADT7473_REV_ID 0x68
|
||||
#define ADT7473_1_REV_ID 0x69
|
||||
#define ADT7473_REV_ID1 0x68
|
||||
#define ADT7473_REV_ID2 0x69
|
||||
#define ADT7490_REV_ID 0x6E
|
||||
|
||||
#endif /* def DBCOOLREG_H */
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: dbcool_var.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp $ */
|
||||
/* $NetBSD: dbcool_var.h,v 1.2 2008/10/06 01:35:35 pgoyette Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2008 The NetBSD Foundation, Inc.
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: dbcool_var.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: dbcool_var.h,v 1.2 2008/10/06 01:35:35 pgoyette Exp $");
|
||||
|
||||
#include <dev/i2c/i2cvar.h>
|
||||
|
||||
|
@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: dbcool_var.h,v 1.1 2008/10/02 00:47:51 pgoyette Exp
|
|||
|
||||
enum dbc_pwm_params {
|
||||
DBC_PWM_BEHAVIOR = 0,
|
||||
DBC_PWM_RANGE,
|
||||
DBC_PWM_MIN_DUTY,
|
||||
DBC_PWM_MAX_DUTY,
|
||||
DBC_PWM_CUR_DUTY,
|
||||
|
@ -74,6 +73,7 @@ enum dbc_sensor_type {
|
|||
#define DBCFLAG_4BIT_VER 0x0010
|
||||
#define DBCFLAG_HAS_VID 0x0020
|
||||
#define DBCFLAG_HAS_VID_SEL 0x0040
|
||||
#define DBCFLAG_HAS_PECI 0x0080
|
||||
#define DBCFLAG_ADM1027 0x1000
|
||||
#define DBCFLAG_ADM1030 0x2000
|
||||
#define DBCFLAG_ADT7466 0x4000
|
||||
|
@ -92,6 +92,7 @@ struct dbcool_sensor {
|
|||
struct reg_list reg;
|
||||
int name_index;
|
||||
int sysctl_index;
|
||||
int nom_volt_index;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -99,18 +100,14 @@ struct dbcool_sensor {
|
|||
* as the enum dbc_pwm_params above
|
||||
*/
|
||||
struct dbcool_power_control {
|
||||
uint8_t behavior;
|
||||
uint8_t range;
|
||||
uint8_t min;
|
||||
uint8_t max;
|
||||
uint8_t cur;
|
||||
uint8_t power_regs[DBC_PWM_LAST_PARAM];
|
||||
const char *desc;
|
||||
};
|
||||
|
||||
struct chip_id;
|
||||
|
||||
struct dbcool_softc {
|
||||
struct device *parent;
|
||||
struct device *sc_dev;
|
||||
i2c_tag_t sc_tag;
|
||||
i2c_addr_t sc_addr;
|
||||
struct chip_id *sc_chip;
|
||||
|
@ -118,8 +115,10 @@ struct dbcool_softc {
|
|||
envsys_data_t sc_sensor[DBCOOL_MAXSENSORS];
|
||||
int sc_sysctl_num[DBCOOL_MAXSENSORS];
|
||||
struct reg_list *sc_regs[DBCOOL_MAXSENSORS];
|
||||
uint8_t sc_suspend;
|
||||
uint8_t sc_temp_offset;
|
||||
int sc_nom_volt[DBCOOL_MAXSENSORS];
|
||||
int sc_temp_offset;
|
||||
int64_t sc_supply_voltage;
|
||||
bool sc_suspend;
|
||||
#ifdef DBCOOL_DEBUG
|
||||
uint8_t sc_user_reg;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue