Kernel driver adm9240

Supported chips:

Authors:

Interface

The I2C addresses listed above assume BIOS has not changed thechip MSB 5-bit address. Each chip reports a unique manufactureridentification code as well as the chip revision/stepping level.

Description

[From ADM9240] The ADM9240 is a complete system hardware monitor formicroprocessor-based systems, providing measurement and limit comparisonof up to four power supplies and two processor core voltages, plustemperature, two fan speeds and chassis intrusion. Measured values canbe read out via an I2C-compatible serial System Management Bus, and valuesfor limit comparisons can be programmed in over the same serial bus. Thehigh speed successive approximation ADC allows frequent sampling of allanalog channels to ensure a fast interrupt response to any out-of-limitmeasurement.

The ADM9240, DS1780 and LM81 are register compatible, the followingdetails are common to the three chips. Chip differences are describedafter this section.

Measurements

The measurement cycle

The adm9240 driver will take a measurement reading no faster than onceeach two seconds. User-space may read sysfs interface faster than themeasurement update rate and will receive cached data from the mostrecent measurement.

ADM9240 has a very fast 320us temperature and voltage measurement cyclewith independent fan speed measurement cycles counting alternating risingedges of the fan tacho inputs.

DS1780 measurement cycle is about once per second including fan speed.

LM81 measurement cycle is about once per 400ms including fan speed.The LM81 12-bit extended temperature measurement mode is not supported.

Temperature

On chip temperature is reported as degrees Celsius as 9-bit signed datawith resolution of 0.5 degrees Celsius. High and low temperature limitsare 8-bit signed data with resolution of one degree Celsius.

Temperature alarm is asserted once the temperature exceeds the high limit,and is cleared when the temperature falls below the temp1_max_hyst value.

Fan Speed

Two fan tacho inputs are provided, the ADM9240 gates an internal 22.5kHzclock via a divider to an 8-bit counter. Fan speed (rpm) is calculated by:

rpm = (22500 * 60) / (count * divider)

Automatic fan clock divider

  • User sets 0 to fan_min limit
    • low speed alarm is disabled
    • fan clock divider not changed
    • auto fan clock adjuster enabled for valid fan speed reading
  • User sets fan_min limit too low
    • low speed alarm is enabled
    • fan clock divider set to max
    • fan_min set to register value 254 which correspondsto 664 rpm on adm9240
    • low speed alarm will be asserted if fan speed isless than minimum measurable speed
    • auto fan clock adjuster disabled
  • User sets reasonable fan speed
    • low speed alarm is enabled
    • fan clock divider set to suit fan_min
    • auto fan clock adjuster enabled: adjusts fan_min
  • User sets unreasonably high low fan speed limit
    • resolution of the low speed limit may be reduced
    • alarm will be asserted
    • auto fan clock adjuster enabled: adjusts fan_min
  • fan speed may be displayed as zero until the auto fan clock divideradjuster brings fan speed clock divider back into chip measurementrange, this will occur within a few measurement cycles.

Analog Output

An analog output provides a 0 to 1.25 volt signal intended for an externalfan speed amplifier circuit. The analog output is set to maximum value onpower up or reset. This doesn’t do much on the test Intel SE440BX-2.

Voltage Monitor


Voltage (IN) measurement is internally scaled:

nrlabel
nominal
mV
maximum
mV
resolution
mV
0+2.5V2500332013.0
1Vccp12700360014.1
2+3.3V3300438017.2
3+5V5000664026.0
4+12V120001594062.5
5Vccp22700360014.1

The reading is an unsigned 8-bit value, nominal voltage measurement isrepresented by a reading of 192, being 3/4 of the measurement range.

An alarm is asserted for any voltage going below or above the set limits.

The driver reports and accepts voltage limits scaled to the above table.

VID Monitor

The chip has five inputs to read the 5-bit VID and reports the mV valuebased on detected CPU type.

Chassis Intrusion

An alarm is asserted when the CI pin goes active high. The ADM9240Datasheet has an example of an external temperature sensor drivingthis pin. On an Intel SE440BX-2 the Chassis Intrusion header isconnected to a normally open switch.

The ADM9240 provides an internal open drain on this line, and may outputa 20 ms active low pulse to reset an external Chassis Intrusion latch.

Clear the CI latch by writing value 0 to the sysfs intrusion0_alarm file.

Alarm flags reported as 16-bit word

bitlabelcomment
0+2.5 V_Errorhigh or low limit exceeded
1VCCP_Errorhigh or low limit exceeded
2+3.3 V_Errorhigh or low limit exceeded
3+5 V_Errorhigh or low limit exceeded
4Temp_Errortemperature error
6FAN1_Errorfan low limit exceeded
7FAN2_Errorfan low limit exceeded
8+12 V_Errorhigh or low limit exceeded
9VCCP2_Errorhigh or low limit exceeded
12Chassis_ErrorCI pin went high

Remaining bits are reserved and thus undefined. It is important to notethat alarm bits may be cleared on read, user-space may latch alarms andprovide the end-user with a method to clear alarm memory.