dme1737 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295
  1. Kernel driver dme1737
  2. =====================
  3. Supported chips:
  4. * SMSC DME1737 and compatibles (like Asus A8000)
  5. Prefix: 'dme1737'
  6. Addresses scanned: I2C 0x2c, 0x2d, 0x2e
  7. Datasheet: Provided by SMSC upon request and under NDA
  8. * SMSC SCH3112, SCH3114, SCH3116
  9. Prefix: 'sch311x'
  10. Addresses scanned: none, address read from Super-I/O config space
  11. Datasheet: http://www.nuhorizons.com/FeaturedProducts/Volume1/SMSC/311x.pdf
  12. * SMSC SCH5027
  13. Prefix: 'sch5027'
  14. Addresses scanned: I2C 0x2c, 0x2d, 0x2e
  15. Datasheet: Provided by SMSC upon request and under NDA
  16. Authors:
  17. Juerg Haefliger <juergh@gmail.com>
  18. Module Parameters
  19. -----------------
  20. * force_start: bool Enables the monitoring of voltage, fan and temp inputs
  21. and PWM output control functions. Using this parameter
  22. shouldn't be required since the BIOS usually takes care
  23. of this.
  24. * probe_all_addr: bool Include non-standard LPC addresses 0x162e and 0x164e
  25. when probing for ISA devices. This is required for the
  26. following boards:
  27. - VIA EPIA SN18000
  28. Description
  29. -----------
  30. This driver implements support for the hardware monitoring capabilities of the
  31. SMSC DME1737 and Asus A8000 (which are the same), SMSC SCH5027, and SMSC
  32. SCH311x Super-I/O chips. These chips feature monitoring of 3 temp sensors
  33. temp[1-3] (2 remote diodes and 1 internal), 7 voltages in[0-6] (6 external and
  34. 1 internal) and up to 6 fan speeds fan[1-6]. Additionally, the chips implement
  35. up to 5 PWM outputs pwm[1-3,5-6] for controlling fan speeds both manually and
  36. automatically.
  37. For the DME1737, A8000 and SCH5027, fan[1-2] and pwm[1-2] are always present.
  38. Fan[3-6] and pwm[3,5-6] are optional features and their availability depends on
  39. the configuration of the chip. The driver will detect which features are
  40. present during initialization and create the sysfs attributes accordingly.
  41. For the SCH311x, fan[1-3] and pwm[1-3] are always present and fan[4-6] and
  42. pwm[5-6] don't exist.
  43. The hardware monitoring features of the DME1737, A8000, and SCH5027 are only
  44. accessible via SMBus, while the SCH311x only provides access via the ISA bus.
  45. The driver will therefore register itself as an I2C client driver if it detects
  46. a DME1737, A8000, or SCH5027 and as a platform driver if it detects a SCH311x
  47. chip.
  48. Voltage Monitoring
  49. ------------------
  50. The voltage inputs are sampled with 12-bit resolution and have internal
  51. scaling resistors. The values returned by the driver therefore reflect true
  52. millivolts and don't need scaling. The voltage inputs are mapped as follows
  53. (the last column indicates the input ranges):
  54. DME1737, A8000:
  55. in0: +5VTR (+5V standby) 0V - 6.64V
  56. in1: Vccp (processor core) 0V - 3V
  57. in2: VCC (internal +3.3V) 0V - 4.38V
  58. in3: +5V 0V - 6.64V
  59. in4: +12V 0V - 16V
  60. in5: VTR (+3.3V standby) 0V - 4.38V
  61. in6: Vbat (+3.0V) 0V - 4.38V
  62. SCH311x:
  63. in0: +2.5V 0V - 6.64V
  64. in1: Vccp (processor core) 0V - 2V
  65. in2: VCC (internal +3.3V) 0V - 4.38V
  66. in3: +5V 0V - 6.64V
  67. in4: +12V 0V - 16V
  68. in5: VTR (+3.3V standby) 0V - 4.38V
  69. in6: Vbat (+3.0V) 0V - 4.38V
  70. SCH5027:
  71. in0: +5VTR (+5V standby) 0V - 6.64V
  72. in1: Vccp (processor core) 0V - 3V
  73. in2: VCC (internal +3.3V) 0V - 4.38V
  74. in3: V2_IN 0V - 1.5V
  75. in4: V1_IN 0V - 1.5V
  76. in5: VTR (+3.3V standby) 0V - 4.38V
  77. in6: Vbat (+3.0V) 0V - 4.38V
  78. Each voltage input has associated min and max limits which trigger an alarm
  79. when crossed.
  80. Temperature Monitoring
  81. ----------------------
  82. Temperatures are measured with 12-bit resolution and reported in millidegree
  83. Celsius. The chip also features offsets for all 3 temperature inputs which -
  84. when programmed - get added to the input readings. The chip does all the
  85. scaling by itself and the driver therefore reports true temperatures that don't
  86. need any user-space adjustments. The temperature inputs are mapped as follows
  87. (the last column indicates the input ranges):
  88. temp1: Remote diode 1 (3904 type) temperature -127C - +127C
  89. temp2: DME1737 internal temperature -127C - +127C
  90. temp3: Remote diode 2 (3904 type) temperature -127C - +127C
  91. Each temperature input has associated min and max limits which trigger an alarm
  92. when crossed. Additionally, each temperature input has a fault attribute that
  93. returns 1 when a faulty diode or an unconnected input is detected and 0
  94. otherwise.
  95. Fan Monitoring
  96. --------------
  97. Fan RPMs are measured with 16-bit resolution. The chip provides inputs for 6
  98. fan tachometers. All 6 inputs have an associated min limit which triggers an
  99. alarm when crossed. Fan inputs 1-4 provide type attributes that need to be set
  100. to the number of pulses per fan revolution that the connected tachometer
  101. generates. Supported values are 1, 2, and 4. Fan inputs 5-6 only support fans
  102. that generate 2 pulses per revolution. Fan inputs 5-6 also provide a max
  103. attribute that needs to be set to the maximum attainable RPM (fan at 100% duty-
  104. cycle) of the input. The chip adjusts the sampling rate based on this value.
  105. PWM Output Control
  106. ------------------
  107. This chip features 5 PWM outputs. PWM outputs 1-3 are associated with fan
  108. inputs 1-3 and PWM outputs 5-6 are associated with fan inputs 5-6. PWM outputs
  109. 1-3 can be configured to operate either in manual or automatic mode by setting
  110. the appropriate enable attribute accordingly. PWM outputs 5-6 can only operate
  111. in manual mode, their enable attributes are therefore read-only. When set to
  112. manual mode, the fan speed is set by writing the duty-cycle value to the
  113. appropriate PWM attribute. In automatic mode, the PWM attribute returns the
  114. current duty-cycle as set by the fan controller in the chip. All PWM outputs
  115. support the setting of the output frequency via the freq attribute.
  116. In automatic mode, the chip supports the setting of the PWM ramp rate which
  117. defines how fast the PWM output is adjusting to changes of the associated
  118. temperature input. Associating PWM outputs to temperature inputs is done via
  119. temperature zones. The chip features 3 zones whose assignments to temperature
  120. inputs is static and determined during initialization. These assignments can
  121. be retrieved via the zone[1-3]_auto_channels_temp attributes. Each PWM output
  122. is assigned to one (or hottest of multiple) temperature zone(s) through the
  123. pwm[1-3]_auto_channels_zone attributes. Each PWM output has 3 distinct output
  124. duty-cycles: full, low, and min. Full is internally hard-wired to 255 (100%)
  125. and low and min can be programmed via pwm[1-3]_auto_point1_pwm and
  126. pwm[1-3]_auto_pwm_min, respectively. The thermal thresholds of the zones are
  127. programmed via zone[1-3]_auto_point[1-3]_temp and
  128. zone[1-3]_auto_point1_temp_hyst:
  129. pwm[1-3]_auto_point2_pwm full-speed duty-cycle (255, i.e., 100%)
  130. pwm[1-3]_auto_point1_pwm low-speed duty-cycle
  131. pwm[1-3]_auto_pwm_min min-speed duty-cycle
  132. zone[1-3]_auto_point3_temp full-speed temp (all outputs)
  133. zone[1-3]_auto_point2_temp full-speed temp
  134. zone[1-3]_auto_point1_temp low-speed temp
  135. zone[1-3]_auto_point1_temp_hyst min-speed temp
  136. The chip adjusts the output duty-cycle linearly in the range of auto_point1_pwm
  137. to auto_point2_pwm if the temperature of the associated zone is between
  138. auto_point1_temp and auto_point2_temp. If the temperature drops below the
  139. auto_point1_temp_hyst value, the output duty-cycle is set to the auto_pwm_min
  140. value which only supports two values: 0 or auto_point1_pwm. That means that the
  141. fan either turns completely off or keeps spinning with the low-speed
  142. duty-cycle. If any of the temperatures rise above the auto_point3_temp value,
  143. all PWM outputs are set to 100% duty-cycle.
  144. Following is another representation of how the chip sets the output duty-cycle
  145. based on the temperature of the associated thermal zone:
  146. Duty-Cycle Duty-Cycle
  147. Temperature Rising Temp Falling Temp
  148. ----------- ----------- ------------
  149. full-speed full-speed full-speed
  150. < linearly adjusted duty-cycle >
  151. low-speed low-speed low-speed
  152. min-speed low-speed
  153. min-speed min-speed min-speed
  154. min-speed min-speed
  155. Sysfs Attributes
  156. ----------------
  157. Following is a list of all sysfs attributes that the driver provides, their
  158. permissions and a short description:
  159. Name Perm Description
  160. ---- ---- -----------
  161. cpu0_vid RO CPU core reference voltage in
  162. millivolts.
  163. vrm RW Voltage regulator module version
  164. number.
  165. in[0-6]_input RO Measured voltage in millivolts.
  166. in[0-6]_min RW Low limit for voltage input.
  167. in[0-6]_max RW High limit for voltage input.
  168. in[0-6]_alarm RO Voltage input alarm. Returns 1 if
  169. voltage input is or went outside the
  170. associated min-max range, 0 otherwise.
  171. temp[1-3]_input RO Measured temperature in millidegree
  172. Celsius.
  173. temp[1-3]_min RW Low limit for temp input.
  174. temp[1-3]_max RW High limit for temp input.
  175. temp[1-3]_offset RW Offset for temp input. This value will
  176. be added by the chip to the measured
  177. temperature.
  178. temp[1-3]_alarm RO Alarm for temp input. Returns 1 if temp
  179. input is or went outside the associated
  180. min-max range, 0 otherwise.
  181. temp[1-3]_fault RO Temp input fault. Returns 1 if the chip
  182. detects a faulty thermal diode or an
  183. unconnected temp input, 0 otherwise.
  184. zone[1-3]_auto_channels_temp RO Temperature zone to temperature input
  185. mapping. This attribute is a bitfield
  186. and supports the following values:
  187. 1: temp1
  188. 2: temp2
  189. 4: temp3
  190. zone[1-3]_auto_point1_temp_hyst RW Auto PWM temp point1 hysteresis. The
  191. output of the corresponding PWM is set
  192. to the pwm_auto_min value if the temp
  193. falls below the auto_point1_temp_hyst
  194. value.
  195. zone[1-3]_auto_point[1-3]_temp RW Auto PWM temp points. Auto_point1 is
  196. the low-speed temp, auto_point2 is the
  197. full-speed temp, and auto_point3 is the
  198. temp at which all PWM outputs are set
  199. to full-speed (100% duty-cycle).
  200. fan[1-6]_input RO Measured fan speed in RPM.
  201. fan[1-6]_min RW Low limit for fan input.
  202. fan[1-6]_alarm RO Alarm for fan input. Returns 1 if fan
  203. input is or went below the associated
  204. min value, 0 otherwise.
  205. fan[1-4]_type RW Type of attached fan. Expressed in
  206. number of pulses per revolution that
  207. the fan generates. Supported values are
  208. 1, 2, and 4.
  209. fan[5-6]_max RW Max attainable RPM at 100% duty-cycle.
  210. Required for chip to adjust the
  211. sampling rate accordingly.
  212. pmw[1-3,5-6] RO/RW Duty-cycle of PWM output. Supported
  213. values are 0-255 (0%-100%). Only
  214. writeable if the associated PWM is in
  215. manual mode.
  216. pwm[1-3]_enable RW Enable of PWM outputs 1-3. Supported
  217. values are:
  218. 0: turned off (output @ 100%)
  219. 1: manual mode
  220. 2: automatic mode
  221. pwm[5-6]_enable RO Enable of PWM outputs 5-6. Always
  222. returns 1 since these 2 outputs are
  223. hard-wired to manual mode.
  224. pmw[1-3,5-6]_freq RW Frequency of PWM output. Supported
  225. values are in the range 11Hz-30000Hz
  226. (default is 25000Hz).
  227. pmw[1-3]_ramp_rate RW Ramp rate of PWM output. Determines how
  228. fast the PWM duty-cycle will change
  229. when the PWM is in automatic mode.
  230. Expressed in ms per PWM step. Supported
  231. values are in the range 0ms-206ms
  232. (default is 0, which means the duty-
  233. cycle changes instantly).
  234. pwm[1-3]_auto_channels_zone RW PWM output to temperature zone mapping.
  235. This attribute is a bitfield and
  236. supports the following values:
  237. 1: zone1
  238. 2: zone2
  239. 4: zone3
  240. 6: highest of zone[2-3]
  241. 7: highest of zone[1-3]
  242. pwm[1-3]_auto_pwm_min RW Auto PWM min pwm. Minimum PWM duty-
  243. cycle. Supported values are 0 or
  244. auto_point1_pwm.
  245. pwm[1-3]_auto_point1_pwm RW Auto PWM pwm point. Auto_point1 is the
  246. low-speed duty-cycle.
  247. pwm[1-3]_auto_point2_pwm RO Auto PWM pwm point. Auto_point2 is the
  248. full-speed duty-cycle which is hard-
  249. wired to 255 (100% duty-cycle).