| 1 | Kernel driver `adm1026.o' |
|---|
| 2 | ====================== |
|---|
| 3 | |
|---|
| 4 | Status: In development |
|---|
| 5 | |
|---|
| 6 | Supported chips: |
|---|
| 7 | * Analog Devices ADM1026 |
|---|
| 8 | Prefix: 'adm1026' |
|---|
| 9 | Addresses scanned: I2C 0x2c, 0x2d, 0x2e |
|---|
| 10 | |
|---|
| 11 | Author: Philip Pokorny <ppokorny@penguincomputing.com> |
|---|
| 12 | for Penguin Computing |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | Module Parameters |
|---|
| 16 | ----------------- |
|---|
| 17 | |
|---|
| 18 | * force: short array (min = 1, max = 48) |
|---|
| 19 | List of adapter,address pairs to boldly assume to be present |
|---|
| 20 | * force_adm1026: short array (min = 1, max = 48) |
|---|
| 21 | List of adapter,address pairs which are unquestionably assumed to contain |
|---|
| 22 | an `adm1026' chip |
|---|
| 23 | * ignore: short array (min = 1, max = 48) |
|---|
| 24 | List of adapter,address pairs not to scan |
|---|
| 25 | * ignore_range: short array (min = 1, max = 48) |
|---|
| 26 | List of adapter,start-addr,end-addr triples not to scan |
|---|
| 27 | * probe: short array (min = 1, max = 48) |
|---|
| 28 | List of adapter,address pairs to scan additionally |
|---|
| 29 | * probe_range: short array (min = 1, max = 48) |
|---|
| 30 | List of adapter,start-addr,end-addr triples to scan additionally |
|---|
| 31 | |
|---|
| 32 | The following only apply to the first ADM1026 detected. These are a |
|---|
| 33 | workaround for if your BIOS hasn't setup your chip. |
|---|
| 34 | |
|---|
| 35 | * gpio_input: int array (min = 1, max = 17) |
|---|
| 36 | List of GPIO pins (0-16) to program as inputs |
|---|
| 37 | * gpio_output: int array (min = 1, max = 17) |
|---|
| 38 | List of GPIO pins (0-16) to program as outputs |
|---|
| 39 | * gpio_inverted: int array (min = 1, max = 17) |
|---|
| 40 | List of GPIO pins (0-16) to program as inverted |
|---|
| 41 | * gpio_normal: int array (min = 1, max = 17) |
|---|
| 42 | List of GPIO pins (0-16) to program as normal/non-inverted |
|---|
| 43 | * gpio_fan: int array (min = 1, max = 8) |
|---|
| 44 | List of GPIO pins (0-7) to program as fan tachs |
|---|
| 45 | |
|---|
| 46 | |
|---|
| 47 | Description |
|---|
| 48 | ----------- |
|---|
| 49 | |
|---|
| 50 | This driver implements support for the Analog Devices ADM1026. Analog |
|---|
| 51 | Devices calls it a "complete thermal system management controller." |
|---|
| 52 | |
|---|
| 53 | The ADM1026 implements three (3) temperature sensors, 17 voltage |
|---|
| 54 | sensors, 16 general purpose digital I/O lines, eight (8) fan speed |
|---|
| 55 | sensors (8-bit), an analog output and a PWM output along with limit, |
|---|
| 56 | alarm and mask bits for all of the above. There is even 8k bytes of |
|---|
| 57 | EEPROM memory on chip. |
|---|
| 58 | |
|---|
| 59 | Temperatures are measured in degrees Celsius. There are two external |
|---|
| 60 | sensor inputs and one internal sensor. Each sensor has a high and low |
|---|
| 61 | limit. If the limit is exceeded, an interrupt (#SMBALERT) can be |
|---|
| 62 | generated. The interrupts can be masked. In addition, there are |
|---|
| 63 | over-temp limits for each sensor. If this limit is exceeded, the |
|---|
| 64 | #THERM output will be asserted. The current temperature and limits |
|---|
| 65 | have a resolution of 1 degree. |
|---|
| 66 | |
|---|
| 67 | Fan rotation speeds are reported in RPM (rotations per minute) but |
|---|
| 68 | measured in counts of a 22.5kHz internal clock. Each fan has a high |
|---|
| 69 | limit which corresponds to a minimum fan speed. If the limit is |
|---|
| 70 | exceeded, an interrupt can be generated. Each fan can be programmed |
|---|
| 71 | to divide the reference clock by 1, 2, 4 or 8. Not all RPM values can |
|---|
| 72 | accurately be represented, so some rounding is done. With a divider of |
|---|
| 73 | 8, the slowest measureable speed of a one pulse per rev fan is 1323 |
|---|
| 74 | RPM. Two pulse per rev fans can be measured as slow as 661 RPM. |
|---|
| 75 | |
|---|
| 76 | Voltage sensors (in0 to in16) report their values in volts. An alarm |
|---|
| 77 | is triggered if the voltage has crossed a programmable minimum or |
|---|
| 78 | maximum limit. Note that minimum in this case always means 'closest |
|---|
| 79 | to zero'; this is important for negative voltage measurements. |
|---|
| 80 | Several inputs have integrated attenuators so they can measure higher |
|---|
| 81 | voltages directly. 3.3V, 5V, 12V, -12V and battery voltage all have |
|---|
| 82 | dedicated inputs. There are several inputs scaled to 0-3V full-scale |
|---|
| 83 | range for SCSI terminator power. The remaining inputs are not scaled |
|---|
| 84 | and have a 0-2.5V full-scale range. A 2.5V or 1.82V reference voltage |
|---|
| 85 | is provided for negative voltage measurements. |
|---|
| 86 | |
|---|
| 87 | If an alarm triggers, it will remain triggered until the hardware |
|---|
| 88 | register is read at least once. This means that the cause for the |
|---|
| 89 | alarm may already have disappeared! Note that in the current |
|---|
| 90 | implementation, all hardware registers are read whenever any data is |
|---|
| 91 | read (unless it is less than 2.0 seconds since the last update). This |
|---|
| 92 | means that you can easily miss once-only alarms. |
|---|
| 93 | |
|---|
| 94 | The ADM1026 measures continuously. Analog inputs are measured about 4 |
|---|
| 95 | times a second. Fan speed measurement time depends on fan speed and |
|---|
| 96 | divisor. It can take as long as 1.5 seconds to measure all fan |
|---|
| 97 | speeds. |
|---|
| 98 | |
|---|
| 99 | The ADM1026 has the ability to automaticaly control fan speed based on |
|---|
| 100 | the temperature sensor inputs. Both the PWM output and the DAC output |
|---|
| 101 | can be used to control fan speed. Usually only one of these two |
|---|
| 102 | outputs will be used. Write the minimum PWM or DAC value to the |
|---|
| 103 | appropriate control register. Then set the low temperature limit in |
|---|
| 104 | the tmin values for each temperature sensor. The range of control is |
|---|
| 105 | fixed at 20 degC, and the largest difference between current and tmin |
|---|
| 106 | of the temperature sensors sets the control output. See the datasheet |
|---|
| 107 | for several example circuits for controlling fan speed with the PWM |
|---|
| 108 | and DAC outputs. The fan speed sensors do not have PWM compensation, |
|---|
| 109 | so it is probably best to control the fan voltage from the power |
|---|
| 110 | lead rather than on the ground lead. |
|---|
| 111 | |
|---|
| 112 | The datasheet shows an example application with VID signals attached |
|---|
| 113 | to GPIO lines. Unfortunately, the chip may not be connected to the |
|---|
| 114 | VID lines in this way. The driver assumes that the chips *is* |
|---|
| 115 | connected this way to get a vid voltage. If the VID value is wrong or |
|---|
| 116 | not wired as shown in the example, then you will need to write the |
|---|
| 117 | correct VID value to the driver either based on the GPIO values or |
|---|
| 118 | setting it directly. The value written to VID should be the *raw* VID |
|---|
| 119 | value (0 to 0x3f) or -1 (to restore the default value). When read, |
|---|
| 120 | the vid interface returns the scaled voltage according to the VRM spec |
|---|
| 121 | selected. |
|---|
| 122 | |
|---|
| 123 | Example sensors.conf |
|---|
| 124 | -------------------- |
|---|
| 125 | |
|---|
| 126 | Here is an example sensors.conf configuration section for the ADM1026. |
|---|
| 127 | |
|---|
| 128 | --------- cut here --------- |
|---|
| 129 | chip "adm1026-*" |
|---|
| 130 | |
|---|
| 131 | # Voltage inputs |
|---|
| 132 | label in0 "V2.25_0" # Scaled for "SCSI terminator"? |
|---|
| 133 | label in1 "V2.25_1" # supply voltage? |
|---|
| 134 | label in2 "V2.25_2" |
|---|
| 135 | label in3 "V2.25_3" |
|---|
| 136 | label in4 "V2.25_4" |
|---|
| 137 | label in5 "V2.25_5" |
|---|
| 138 | |
|---|
| 139 | label in6 "V1.875_0" # Unscaled inputs |
|---|
| 140 | label in7 "V1.875_1" |
|---|
| 141 | |
|---|
| 142 | # If temp3 is enabled, in8 and in9 are disabled. |
|---|
| 143 | # label in8 "V1.875_2" |
|---|
| 144 | # label in9 "V1.875_3" |
|---|
| 145 | ignore in8 |
|---|
| 146 | ignore in9 |
|---|
| 147 | |
|---|
| 148 | # Dedicated voltage inputs |
|---|
| 149 | label in10 "Vbat" |
|---|
| 150 | label in11 "V3.3STBY" |
|---|
| 151 | label in12 "V3.3MAIN" |
|---|
| 152 | label in13 "V5" |
|---|
| 153 | label in14 "Vccp" |
|---|
| 154 | label in15 "V12" |
|---|
| 155 | label in16 "V-12" |
|---|
| 156 | |
|---|
| 157 | # Temperature inputs |
|---|
| 158 | label temp1 "Board" |
|---|
| 159 | label temp2 "CPU0" |
|---|
| 160 | label temp3 "CPU1" |
|---|
| 161 | |
|---|
| 162 | # Fan inputs |
|---|
| 163 | label fan0 "CPU_Fan" |
|---|
| 164 | label fan1 "Fan1" |
|---|
| 165 | label fan2 "Fan2" |
|---|
| 166 | label fan3 "Fan3" |
|---|
| 167 | label fan4 "Fan4" |
|---|
| 168 | label fan5 "Fan5" |
|---|
| 169 | label fan6 "Fan6" |
|---|
| 170 | label fan7 "Fan7" |
|---|
| 171 | |
|---|
| 172 | # PWM Outputs |
|---|
| 173 | label pwm "PWM" |
|---|
| 174 | |
|---|
| 175 | # Voltage scaling is done on-chip. No 'compute' directive |
|---|
| 176 | # should be necessary. If in0-in9 have external scaling, |
|---|
| 177 | # set it here. |
|---|
| 178 | |
|---|
| 179 | # compute in0 @ * 2.5, @ / 2.5 |
|---|
| 180 | |
|---|
| 181 | # Adjust fans speeds for actual pulses per rev |
|---|
| 182 | # compute fan0 @ / 2, @ * 2 # 2 pulse per rev |
|---|
| 183 | # compute fan1 @ / 3, @ * 3 # 3 pulse per rev |
|---|
| 184 | # compute fan2 @ / 4, @ * 4 # 4 pulse per rev |
|---|
| 185 | # compute fan3 @ / 8, @ * 8 # 8 pulse per rev |
|---|
| 186 | |
|---|
| 187 | # Set VRM version |
|---|
| 188 | set vrm 9.1 |
|---|
| 189 | # set vid 1.580 |
|---|
| 190 | |
|---|
| 191 | # Set voltage limits |
|---|
| 192 | set in10_min 3.0 * 0.95 |
|---|
| 193 | set in10_max 3.0 * 1.05 |
|---|
| 194 | set in11_min 3.3 * 0.95 |
|---|
| 195 | set in11_max 3.3 * 1.05 |
|---|
| 196 | set in12_min 3.3 * 0.95 |
|---|
| 197 | set in12_max 3.3 * 1.05 |
|---|
| 198 | set in13_min 5.0 * 0.95 |
|---|
| 199 | set in13_max 5.0 * 1.05 |
|---|
| 200 | # Uncomment if VID is wired or set above |
|---|
| 201 | # set in14_min vid * 0.95 |
|---|
| 202 | # set in14_max vid * 1.05 |
|---|
| 203 | set in15_min 12 * 0.95 |
|---|
| 204 | set in15_max 12 * 1.05 |
|---|
| 205 | set in16_min -12 * 0.95 |
|---|
| 206 | set in16_max -12 * 1.05 |
|---|
| 207 | |
|---|
| 208 | # Set Fan limits |
|---|
| 209 | set fan0_min 7000 |
|---|
| 210 | set fan1_min 7000 |
|---|
| 211 | set fan2_min 7000 |
|---|
| 212 | set fan3_min 7000 |
|---|
| 213 | set fan4_min 3000 |
|---|
| 214 | set fan5_min 3000 |
|---|
| 215 | set fan6_min 3000 |
|---|
| 216 | set fan7_min 3000 |
|---|
| 217 | |
|---|