w83781d.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. Kernel driver w83781d
  2. =====================
  3. Supported chips:
  4. * Winbond W83781D
  5. Prefix: 'w83781d'
  6. Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)
  7. Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83781d.pdf
  8. * Winbond W83782D
  9. Prefix: 'w83782d'
  10. Addresses scanned: I2C 0x28 - 0x2f, ISA 0x290 (8 I/O ports)
  11. Datasheet: https://www.winbond.com
  12. * Winbond W83783S
  13. Prefix: 'w83783s'
  14. Addresses scanned: I2C 0x2d
  15. Datasheet: http://www.winbond-usa.com/products/winbond_products/pdfs/PCIC/w83783s.pdf
  16. * Asus AS99127F
  17. Prefix: 'as99127f'
  18. Addresses scanned: I2C 0x28 - 0x2f
  19. Datasheet: Unavailable from Asus
  20. Authors:
  21. - Frodo Looijaard <frodol@dds.nl>,
  22. - Philip Edelbrock <phil@netroedge.com>,
  23. - Mark Studebaker <mdsxyz123@yahoo.com>
  24. Module parameters
  25. -----------------
  26. * init int
  27. (default 1)
  28. Use 'init=0' to bypass initializing the chip.
  29. Try this if your computer crashes when you load the module.
  30. * reset int
  31. (default 0)
  32. The driver used to reset the chip on load, but does no more. Use
  33. 'reset=1' to restore the old behavior. Report if you need to do this.
  34. force_subclients=bus,caddr,saddr,saddr
  35. This is used to force the i2c addresses for subclients of
  36. a certain chip. Typical usage is `force_subclients=0,0x2d,0x4a,0x4b`
  37. to force the subclients of chip 0x2d on bus 0 to i2c addresses
  38. 0x4a and 0x4b. This parameter is useful for certain Tyan boards.
  39. Description
  40. -----------
  41. This driver implements support for the Winbond W83781D, W83782D, W83783S
  42. chips, and the Asus AS99127F chips. We will refer to them collectively as
  43. W8378* chips.
  44. There is quite some difference between these chips, but they are similar
  45. enough that it was sensible to put them together in one driver.
  46. The Asus chips are similar to an I2C-only W83782D.
  47. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  48. | Chip | #vin | #fanin | #pwm | #temp | wchipid | vendid | i2c | ISA |
  49. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  50. | as99127f | 7 | 3 | 0 | 3 | 0x31 | 0x12c3 | yes | no |
  51. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  52. | as99127f rev.2 (type_name = as99127f) | 0x31 | 0x5ca3 | yes | no |
  53. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  54. | w83781d | 7 | 3 | 0 | 3 | 0x10-1 | 0x5ca3 | yes | yes |
  55. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  56. | w83782d | 9 | 3 | 2-4 | 3 | 0x30 | 0x5ca3 | yes | yes |
  57. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  58. | w83783s | 5-6 | 3 | 2 | 1-2 | 0x40 | 0x5ca3 | yes | no |
  59. +----------+---------+--------+-------+-------+---------+--------+------+-----+
  60. Detection of these chips can sometimes be foiled because they can be in
  61. an internal state that allows no clean access. If you know the address
  62. of the chip, use a 'force' parameter; this will put them into a more
  63. well-behaved state first.
  64. The W8378* implements temperature sensors (three on the W83781D and W83782D,
  65. two on the W83783S), three fan rotation speed sensors, voltage sensors
  66. (seven on the W83781D, nine on the W83782D and six on the W83783S), VID
  67. lines, alarms with beep warnings, and some miscellaneous stuff.
  68. Temperatures are measured in degrees Celsius. There is always one main
  69. temperature sensor, and one (W83783S) or two (W83781D and W83782D) other
  70. sensors. An alarm is triggered for the main sensor once when the
  71. Overtemperature Shutdown limit is crossed; it is triggered again as soon as
  72. it drops below the Hysteresis value. A more useful behavior
  73. can be found by setting the Hysteresis value to +127 degrees Celsius; in
  74. this case, alarms are issued during all the time when the actual temperature
  75. is above the Overtemperature Shutdown value. The driver sets the
  76. hysteresis value for temp1 to 127 at initialization.
  77. For the other temperature sensor(s), an alarm is triggered when the
  78. temperature gets higher then the Overtemperature Shutdown value; it stays
  79. on until the temperature falls below the Hysteresis value. But on the
  80. W83781D, there is only one alarm that functions for both other sensors!
  81. Temperatures are guaranteed within a range of -55 to +125 degrees. The
  82. main temperature sensors has a resolution of 1 degree; the other sensor(s)
  83. of 0.5 degree.
  84. Fan rotation speeds are reported in RPM (rotations per minute). An alarm is
  85. triggered if the rotation speed has dropped below a programmable limit. Fan
  86. readings can be divided by a programmable divider (1, 2, 4 or 8 for the
  87. W83781D; 1, 2, 4, 8, 16, 32, 64 or 128 for the others) to give
  88. the readings more range or accuracy. Not all RPM values can accurately
  89. be represented, so some rounding is done. With a divider of 2, the lowest
  90. representable value is around 2600 RPM.
  91. Voltage sensors (also known as IN sensors) report their values in volts.
  92. An alarm is triggered if the voltage has crossed a programmable minimum
  93. or maximum limit. Note that minimum in this case always means 'closest to
  94. zero'; this is important for negative voltage measurements. All voltage
  95. inputs can measure voltages between 0 and 4.08 volts, with a resolution
  96. of 0.016 volt.
  97. The VID lines encode the core voltage value: the voltage level your processor
  98. should work with. This is hardcoded by the mainboard and/or processor itself.
  99. It is a value in volts. When it is unconnected, you will often find the
  100. value 3.50 V here.
  101. The W83782D and W83783S temperature conversion machine understands about
  102. several kinds of temperature probes. You can program the so-called
  103. beta value in the sensor files. '1' is the PII/Celeron diode, '2' is the
  104. TN3904 transistor, and 3435 the default thermistor value. Other values
  105. are (not yet) supported.
  106. In addition to the alarms described above, there is a CHAS alarm on the
  107. chips which triggers if your computer case is open.
  108. When an alarm goes off, you can be warned by a beeping signal through
  109. your computer speaker. It is possible to enable all beeping globally,
  110. or only the beeping for some alarms.
  111. Individual alarm and beep bits:
  112. ======== ==========================
  113. 0x000001 in0
  114. 0x000002 in1
  115. 0x000004 in2
  116. 0x000008 in3
  117. 0x000010 temp1
  118. 0x000020 temp2 (+temp3 on W83781D)
  119. 0x000040 fan1
  120. 0x000080 fan2
  121. 0x000100 in4
  122. 0x000200 in5
  123. 0x000400 in6
  124. 0x000800 fan3
  125. 0x001000 chassis
  126. 0x002000 temp3 (W83782D only)
  127. 0x010000 in7 (W83782D only)
  128. 0x020000 in8 (W83782D only)
  129. ======== ==========================
  130. If an alarm triggers, it will remain triggered until the hardware register
  131. is read at least once. This means that the cause for the alarm may
  132. already have disappeared! Note that in the current implementation, all
  133. hardware registers are read whenever any data is read (unless it is less
  134. than 1.5 seconds since the last update). This means that you can easily
  135. miss once-only alarms.
  136. The chips only update values each 1.5 seconds; reading them more often
  137. will do no harm, but will return 'old' values.
  138. AS99127F PROBLEMS
  139. -----------------
  140. The as99127f support was developed without the benefit of a datasheet.
  141. In most cases it is treated as a w83781d (although revision 2 of the
  142. AS99127F looks more like a w83782d).
  143. This support will be BETA until a datasheet is released.
  144. One user has reported problems with fans stopping
  145. occasionally.
  146. Note that the individual beep bits are inverted from the other chips.
  147. The driver now takes care of this so that user-space applications
  148. don't have to know about it.
  149. Known problems:
  150. - Problems with diode/thermistor settings (supported?)
  151. - One user reports fans stopping under high server load.
  152. - Revision 2 seems to have 2 PWM registers but we don't know
  153. how to handle them. More details below.
  154. These will not be fixed unless we get a datasheet.
  155. If you have problems, please lobby Asus to release a datasheet.
  156. Unfortunately several others have without success.
  157. Please do not send mail to us asking for better as99127f support.
  158. We have done the best we can without a datasheet.
  159. Please do not send mail to the author or the sensors group asking for
  160. a datasheet or ideas on how to convince Asus. We can't help.
  161. NOTES
  162. -----
  163. 783s has no in1 so that in[2-6] are compatible with the 781d/782d.
  164. 783s pin is programmable for -5V or temp1; defaults to -5V,
  165. no control in driver so temp1 doesn't work.
  166. 782d and 783s datasheets differ on which is pwm1 and which is pwm2.
  167. We chose to follow 782d.
  168. 782d and 783s pin is programmable for fan3 input or pwm2 output;
  169. defaults to fan3 input.
  170. If pwm2 is enabled (with echo 255 1 > pwm2), then
  171. fan3 will report 0.
  172. 782d has pwm1-2 for ISA, pwm1-4 for i2c. (pwm3-4 share pins with
  173. the ISA pins)
  174. Data sheet updates
  175. ------------------
  176. - PWM clock registers:
  177. * 000: master / 512
  178. * 001: master / 1024
  179. * 010: master / 2048
  180. * 011: master / 4096
  181. * 100: master / 8192
  182. Answers from Winbond tech support
  183. ---------------------------------
  184. ::
  185. >
  186. > 1) In the W83781D data sheet section 7.2 last paragraph, it talks about
  187. > reprogramming the R-T table if the Beta of the thermistor is not
  188. > 3435K. The R-T table is described briefly in section 8.20.
  189. > What formulas do I use to program a new R-T table for a given Beta?
  190. >
  191. We are sorry that the calculation for R-T table value is
  192. confidential. If you have another Beta value of thermistor, we can help
  193. to calculate the R-T table for you. But you should give us real R-T
  194. Table which can be gotten by thermistor vendor. Therefore we will calculate
  195. them and obtain 32-byte data, and you can fill the 32-byte data to the
  196. register in Bank0.CR51 of W83781D.
  197. > 2) In the W83782D data sheet, it mentions that pins 38, 39, and 40 are
  198. > programmable to be either thermistor or Pentium II diode inputs.
  199. > How do I program them for diode inputs? I can't find any register
  200. > to program these to be diode inputs.
  201. You may program Bank0 CR[5Dh] and CR[59h] registers.
  202. =============================== =============== ============== ============
  203. CR[5Dh] bit 1(VTIN1) bit 2(VTIN2) bit 3(VTIN3)
  204. thermistor 0 0 0
  205. diode 1 1 1
  206. (error) CR[59h] bit 4(VTIN1) bit 2(VTIN2) bit 3(VTIN3)
  207. (right) CR[59h] bit 4(VTIN1) bit 5(VTIN2) bit 6(VTIN3)
  208. PII thermal diode 1 1 1
  209. 2N3904 diode 0 0 0
  210. =============================== =============== ============== ============
  211. Asus Clones
  212. -----------
  213. We have no datasheets for the Asus clones (AS99127F and ASB100 Bach).
  214. Here are some very useful information that were given to us by Alex Van
  215. Kaam about how to detect these chips, and how to read their values. He
  216. also gives advice for another Asus chipset, the Mozart-2 (which we
  217. don't support yet). Thanks Alex!
  218. I reworded some parts and added personal comments.
  219. Detection
  220. ^^^^^^^^^
  221. AS99127F rev.1, AS99127F rev.2 and ASB100:
  222. - I2C address range: 0x29 - 0x2F
  223. - If register 0x58 holds 0x31 then we have an Asus (either ASB100 or AS99127F)
  224. - Which one depends on register 0x4F (manufacturer ID):
  225. - 0x06 or 0x94: ASB100
  226. - 0x12 or 0xC3: AS99127F rev.1
  227. - 0x5C or 0xA3: AS99127F rev.2
  228. Note that 0x5CA3 is Winbond's ID (WEC), which let us think Asus get their
  229. AS99127F rev.2 direct from Winbond. The other codes mean ATT and DVC,
  230. respectively. ATT could stand for Asustek something (although it would be
  231. very badly chosen IMHO), I don't know what DVC could stand for. Maybe
  232. these codes simply aren't meant to be decoded that way.
  233. Mozart-2:
  234. - I2C address: 0x77
  235. - If register 0x58 holds 0x56 or 0x10 then we have a Mozart-2
  236. - Of the Mozart there are 3 types:
  237. - 0x58=0x56, 0x4E=0x94, 0x4F=0x36: Asus ASM58 Mozart-2
  238. - 0x58=0x56, 0x4E=0x94, 0x4F=0x06: Asus AS2K129R Mozart-2
  239. - 0x58=0x10, 0x4E=0x5C, 0x4F=0xA3: Asus ??? Mozart-2
  240. You can handle all 3 the exact same way :)
  241. Temperature sensors
  242. ^^^^^^^^^^^^^^^^^^^
  243. ASB100:
  244. - sensor 1: register 0x27
  245. - sensor 2 & 3 are the 2 LM75's on the SMBus
  246. - sensor 4: register 0x17
  247. Remark:
  248. I noticed that on Intel boards sensor 2 is used for the CPU
  249. and 4 is ignored/stuck, on AMD boards sensor 4 is the CPU and sensor 2 is
  250. either ignored or a socket temperature.
  251. AS99127F (rev.1 and 2 alike):
  252. - sensor 1: register 0x27
  253. - sensor 2 & 3 are the 2 LM75's on the SMBus
  254. Remark:
  255. Register 0x5b is suspected to be temperature type selector. Bit 1
  256. would control temp1, bit 3 temp2 and bit 5 temp3.
  257. Mozart-2:
  258. - sensor 1: register 0x27
  259. - sensor 2: register 0x13
  260. Fan sensors
  261. ^^^^^^^^^^^
  262. ASB100, AS99127F (rev.1 and 2 alike):
  263. - 3 fans, identical to the W83781D
  264. Mozart-2:
  265. - 2 fans only, 1350000/RPM/div
  266. - fan 1: register 0x28, divisor on register 0xA1 (bits 4-5)
  267. - fan 2: register 0x29, divisor on register 0xA1 (bits 6-7)
  268. Voltages
  269. ^^^^^^^^
  270. This is where there is a difference between AS99127F rev.1 and 2.
  271. Remark:
  272. The difference is similar to the difference between
  273. W83781D and W83782D.
  274. ASB100:
  275. - in0=r(0x20)*0.016
  276. - in1=r(0x21)*0.016
  277. - in2=r(0x22)*0.016
  278. - in3=r(0x23)*0.016*1.68
  279. - in4=r(0x24)*0.016*3.8
  280. - in5=r(0x25)*(-0.016)*3.97
  281. - in6=r(0x26)*(-0.016)*1.666
  282. AS99127F rev.1:
  283. - in0=r(0x20)*0.016
  284. - in1=r(0x21)*0.016
  285. - in2=r(0x22)*0.016
  286. - in3=r(0x23)*0.016*1.68
  287. - in4=r(0x24)*0.016*3.8
  288. - in5=r(0x25)*(-0.016)*3.97
  289. - in6=r(0x26)*(-0.016)*1.503
  290. AS99127F rev.2:
  291. - in0=r(0x20)*0.016
  292. - in1=r(0x21)*0.016
  293. - in2=r(0x22)*0.016
  294. - in3=r(0x23)*0.016*1.68
  295. - in4=r(0x24)*0.016*3.8
  296. - in5=(r(0x25)*0.016-3.6)*5.14+3.6
  297. - in6=(r(0x26)*0.016-3.6)*3.14+3.6
  298. Mozart-2:
  299. - in0=r(0x20)*0.016
  300. - in1=255
  301. - in2=r(0x22)*0.016
  302. - in3=r(0x23)*0.016*1.68
  303. - in4=r(0x24)*0.016*4
  304. - in5=255
  305. - in6=255
  306. PWM
  307. ^^^
  308. * Additional info about PWM on the AS99127F (may apply to other Asus
  309. chips as well) by Jean Delvare as of 2004-04-09:
  310. AS99127F revision 2 seems to have two PWM registers at 0x59 and 0x5A,
  311. and a temperature sensor type selector at 0x5B (which basically means
  312. that they swapped registers 0x59 and 0x5B when you compare with Winbond
  313. chips).
  314. Revision 1 of the chip also has the temperature sensor type selector at
  315. 0x5B, but PWM registers have no effect.
  316. We don't know exactly how the temperature sensor type selection works.
  317. Looks like bits 1-0 are for temp1, bits 3-2 for temp2 and bits 5-4 for
  318. temp3, although it is possible that only the most significant bit matters
  319. each time. So far, values other than 0 always broke the readings.
  320. PWM registers seem to be split in two parts: bit 7 is a mode selector,
  321. while the other bits seem to define a value or threshold.
  322. When bit 7 is clear, bits 6-0 seem to hold a threshold value. If the value
  323. is below a given limit, the fan runs at low speed. If the value is above
  324. the limit, the fan runs at full speed. We have no clue as to what the limit
  325. represents. Note that there seem to be some inertia in this mode, speed
  326. changes may need some time to trigger. Also, an hysteresis mechanism is
  327. suspected since walking through all the values increasingly and then
  328. decreasingly led to slightly different limits.
  329. When bit 7 is set, bits 3-0 seem to hold a threshold value, while bits 6-4
  330. would not be significant. If the value is below a given limit, the fan runs
  331. at full speed, while if it is above the limit it runs at low speed (so this
  332. is the contrary of the other mode, in a way). Here again, we don't know
  333. what the limit is supposed to represent.
  334. One remarkable thing is that the fans would only have two or three
  335. different speeds (transitional states left apart), not a whole range as
  336. you usually get with PWM.
  337. As a conclusion, you can write 0x00 or 0x8F to the PWM registers to make
  338. fans run at low speed, and 0x7F or 0x80 to make them run at full speed.
  339. Please contact us if you can figure out how it is supposed to work. As
  340. long as we don't know more, the w83781d driver doesn't handle PWM on
  341. AS99127F chips at all.
  342. * Additional info about PWM on the AS99127F rev.1 by Hector Martin:
  343. I've been fiddling around with the (in)famous 0x59 register and
  344. found out the following values do work as a form of coarse pwm:
  345. 0x80
  346. - seems to turn fans off after some time(1-2 minutes)... might be
  347. some form of auto-fan-control based on temp? hmm (Qfan? this mobo is an
  348. old ASUS, it isn't marketed as Qfan. Maybe some beta pre-attempt at Qfan
  349. that was dropped at the BIOS)
  350. 0x81
  351. - off
  352. 0x82
  353. - slightly "on-ner" than off, but my fans do not get to move. I can
  354. hear the high-pitched PWM sound that motors give off at too-low-pwm.
  355. 0x83
  356. - now they do move. Estimate about 70% speed or so.
  357. 0x84-0x8f
  358. - full on
  359. Changing the high nibble doesn't seem to do much except the high bit
  360. (0x80) must be set for PWM to work, else the current pwm doesn't seem to
  361. change.
  362. My mobo is an ASUS A7V266-E. This behavior is similar to what I got
  363. with speedfan under Windows, where 0-15% would be off, 15-2x% (can't
  364. remember the exact value) would be 70% and higher would be full on.
  365. * Additional info about PWM on the AS99127F rev.1 from lm-sensors
  366. ticket #2350:
  367. I conducted some experiment on Asus P3B-F motherboard with AS99127F
  368. (Ver. 1).
  369. I confirm that 0x59 register control the CPU_Fan Header on this
  370. motherboard, and 0x5a register control PWR_Fan.
  371. In order to reduce the dependency of specific fan, the measurement is
  372. conducted with a digital scope without fan connected. I found out that
  373. P3B-F actually output variable DC voltage on fan header center pin,
  374. looks like PWM is filtered on this motherboard.
  375. Here are some of measurements:
  376. ==== =========
  377. 0x80 20 mV
  378. 0x81 20 mV
  379. 0x82 232 mV
  380. 0x83 1.2 V
  381. 0x84 2.31 V
  382. 0x85 3.44 V
  383. 0x86 4.62 V
  384. 0x87 5.81 V
  385. 0x88 7.01 V
  386. 9x89 8.22 V
  387. 0x8a 9.42 V
  388. 0x8b 10.6 V
  389. 0x8c 11.9 V
  390. 0x8d 12.4 V
  391. 0x8e 12.4 V
  392. 0x8f 12.4 V
  393. ==== =========