abituguru-datasheet 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. uGuru datasheet
  2. ===============
  3. First of all, what I know about uGuru is no fact based on any help, hints or
  4. datasheet from Abit. The data I have got on uGuru have I assembled through
  5. my weak knowledge in "backwards engineering".
  6. And just for the record, you may have noticed uGuru isn't a chip developed by
  7. Abit, as they claim it to be. It's realy just an microprocessor (uC) created by
  8. Winbond (W83L950D). And no, reading the manual for this specific uC or
  9. mailing Windbond for help won't give any usefull data about uGuru, as it is
  10. the program inside the uC that is responding to calls.
  11. Olle Sandberg <ollebull@gmail.com>, 2005-05-25
  12. Original version by Olle Sandberg who did the heavy lifting of the initial
  13. reverse engineering. This version has been almost fully rewritten for clarity
  14. and extended with write support and info on more databanks, the write support
  15. is once again reverse engineered by Olle the additional databanks have been
  16. reverse engineered by me. I would like to express my thanks to Olle, this
  17. document and the Linux driver could not have been written without his efforts.
  18. Note: because of the lack of specs only the sensors part of the uGuru is
  19. described here and not the CPU / RAM / etc voltage & frequency control.
  20. Hans de Goede <j.w.r.degoede@hhs.nl>, 28-01-2006
  21. Detection
  22. =========
  23. As far as known the uGuru is always placed at and using the (ISA) I/O-ports
  24. 0xE0 and 0xE4, so we don't have to scan any port-range, just check what the two
  25. ports are holding for detection. We will refer to 0xE0 as CMD (command-port)
  26. and 0xE4 as DATA because Abit refers to them with these names.
  27. If DATA holds 0x00 or 0x08 and CMD holds 0x00 or 0xAC an uGuru could be
  28. present. We have to check for two different values at data-port, because
  29. after a reboot uGuru will hold 0x00 here, but if the driver is removed and
  30. later on attached again data-port will hold 0x08, more about this later.
  31. After wider testing of the Linux kernel driver some variants of the uGuru have
  32. turned up which will hold 0x00 instead of 0xAC at the CMD port, thus we also
  33. have to test CMD for two different values. On these uGuru's DATA will initally
  34. hold 0x09 and will only hold 0x08 after reading CMD first, so CMD must be read
  35. first!
  36. To be really sure an uGuru is present a test read of one or more register
  37. sets should be done.
  38. Reading / Writing
  39. =================
  40. Addressing
  41. ----------
  42. The uGuru has a number of different addressing levels. The first addressing
  43. level we will call banks. A bank holds data for one or more sensors. The data
  44. in a bank for a sensor is one or more bytes large.
  45. The number of bytes is fixed for a given bank, you should always read or write
  46. that many bytes, reading / writing more will fail, the results when writing
  47. less then the number of bytes for a given bank are undetermined.
  48. See below for all known bank addresses, numbers of sensors in that bank,
  49. number of bytes data per sensor and contents/meaning of those bytes.
  50. Although both this document and the kernel driver have kept the sensor
  51. terminoligy for the addressing within a bank this is not 100% correct, in
  52. bank 0x24 for example the addressing within the bank selects a PWM output not
  53. a sensor.
  54. Notice that some banks have both a read and a write address this is how the
  55. uGuru determines if a read from or a write to the bank is taking place, thus
  56. when reading you should always use the read address and when writing the
  57. write address. The write address is always one (1) more then the read address.
  58. uGuru ready
  59. -----------
  60. Before you can read from or write to the uGuru you must first put the uGuru
  61. in "ready" mode.
  62. To put the uGuru in ready mode first write 0x00 to DATA and then wait for DATA
  63. to hold 0x09, DATA should read 0x09 within 250 read cycles.
  64. Next CMD _must_ be read and should hold 0xAC, usually CMD will hold 0xAC the
  65. first read but sometimes it takes a while before CMD holds 0xAC and thus it
  66. has to be read a number of times (max 50).
  67. After reading CMD, DATA should hold 0x08 which means that the uGuru is ready
  68. for input. As above DATA will usually hold 0x08 the first read but not always.
  69. This step can be skipped, but it is undetermined what happens if the uGuru has
  70. not yet reported 0x08 at DATA and you proceed with writing a bank address.
  71. Sending bank and sensor addresses to the uGuru
  72. ----------------------------------------------
  73. First the uGuru must be in "ready" mode as described above, DATA should hold
  74. 0x08 indicating that the uGuru wants input, in this case the bank address.
  75. Next write the bank address to DATA. After the bank address has been written
  76. wait for to DATA to hold 0x08 again indicating that it wants / is ready for
  77. more input (max 250 reads).
  78. Once DATA holds 0x08 again write the sensor address to CMD.
  79. Reading
  80. -------
  81. First send the bank and sensor addresses as described above.
  82. Then for each byte of data you want to read wait for DATA to hold 0x01
  83. which indicates that the uGuru is ready to be read (max 250 reads) and once
  84. DATA holds 0x01 read the byte from CMD.
  85. Once all bytes have been read data will hold 0x09, but there is no reason to
  86. test for this. Notice that the number of bytes is bank address dependent see
  87. above and below.
  88. After completing a successfull read it is advised to put the uGuru back in
  89. ready mode, so that it is ready for the next read / write cycle. This way
  90. if your program / driver is unloaded and later loaded again the detection
  91. algorithm described above will still work.
  92. Writing
  93. -------
  94. First send the bank and sensor addresses as described above.
  95. Then for each byte of data you want to write wait for DATA to hold 0x00
  96. which indicates that the uGuru is ready to be written (max 250 reads) and
  97. once DATA holds 0x00 write the byte to CMD.
  98. Once all bytes have been written wait for DATA to hold 0x01 (max 250 reads)
  99. don't ask why this is the way it is.
  100. Once DATA holds 0x01 read CMD it should hold 0xAC now.
  101. After completing a successfull write it is advised to put the uGuru back in
  102. ready mode, so that it is ready for the next read / write cycle. This way
  103. if your program / driver is unloaded and later loaded again the detection
  104. algorithm described above will still work.
  105. Gotchas
  106. -------
  107. After wider testing of the Linux kernel driver some variants of the uGuru have
  108. turned up which do not hold 0x08 at DATA within 250 reads after writing the
  109. bank address. With these versions this happens quite frequent, using larger
  110. timeouts doesn't help, they just go offline for a second or 2, doing some
  111. internal callibration or whatever. Your code should be prepared to handle
  112. this and in case of no response in this specific case just goto sleep for a
  113. while and then retry.
  114. Address Map
  115. ===========
  116. Bank 0x20 Alarms (R)
  117. --------------------
  118. This bank contains 0 sensors, iow the sensor address is ignored (but must be
  119. written) just use 0. Bank 0x20 contains 3 bytes:
  120. Byte 0:
  121. This byte holds the alarm flags for sensor 0-7 of Sensor Bank1, with bit 0
  122. corresponding to sensor 0, 1 to 1, etc.
  123. Byte 1:
  124. This byte holds the alarm flags for sensor 8-15 of Sensor Bank1, with bit 0
  125. corresponding to sensor 8, 1 to 9, etc.
  126. Byte 2:
  127. This byte holds the alarm flags for sensor 0-5 of Sensor Bank2, with bit 0
  128. corresponding to sensor 0, 1 to 1, etc.
  129. Bank 0x21 Sensor Bank1 Values / Readings (R)
  130. --------------------------------------------
  131. This bank contains 16 sensors, for each sensor it contains 1 byte.
  132. So far the following sensors are known to be available on all motherboards:
  133. Sensor 0 CPU temp
  134. Sensor 1 SYS temp
  135. Sensor 3 CPU core volt
  136. Sensor 4 DDR volt
  137. Sensor 10 DDR Vtt volt
  138. Sensor 15 PWM temp
  139. Byte 0:
  140. This byte holds the reading from the sensor. Sensors in Bank1 can be both
  141. volt and temp sensors, this is motherboard specific. The uGuru however does
  142. seem to know (be programmed with) what kindoff sensor is attached see Sensor
  143. Bank1 Settings description.
  144. Volt sensors use a linear scale, a reading 0 corresponds with 0 volt and a
  145. reading of 255 with 3494 mV. The sensors for higher voltages however are
  146. connected through a division circuit. The currently known division circuits
  147. in use result in ranges of: 0-4361mV, 0-6248mV or 0-14510mV. 3.3 volt sources
  148. use the 0-4361mV range, 5 volt the 0-6248mV and 12 volt the 0-14510mV .
  149. Temp sensors also use a linear scale, a reading of 0 corresponds with 0 degree
  150. Celsius and a reading of 255 with a reading of 255 degrees Celsius.
  151. Bank 0x22 Sensor Bank1 Settings (R)
  152. Bank 0x23 Sensor Bank1 Settings (W)
  153. -----------------------------------
  154. This bank contains 16 sensors, for each sensor it contains 3 bytes. Each
  155. set of 3 bytes contains the settings for the sensor with the same sensor
  156. address in Bank 0x21 .
  157. Byte 0:
  158. Alarm behaviour for the selected sensor. A 1 enables the described behaviour.
  159. Bit 0: Give an alarm if measured temp is over the warning threshold (RW) *
  160. Bit 1: Give an alarm if measured volt is over the max threshold (RW) **
  161. Bit 2: Give an alarm if measured volt is under the min threshold (RW) **
  162. Bit 3: Beep if alarm (RW)
  163. Bit 4: 1 if alarm cause measured temp is over the warning threshold (R)
  164. Bit 5: 1 if alarm cause measured volt is over the max threshold (R)
  165. Bit 6: 1 if alarm cause measured volt is under the min threshold (R)
  166. Bit 7: Volt sensor: Shutdown if alarm persist for more then 4 seconds (RW)
  167. Temp sensor: Shutdown if temp is over the shutdown threshold (RW)
  168. * This bit is only honored/used by the uGuru if a temp sensor is connected
  169. ** This bit is only honored/used by the uGuru if a volt sensor is connected
  170. Note with some trickery this can be used to find out what kinda sensor is
  171. detected see the Linux kernel driver for an example with many comments on
  172. how todo this.
  173. Byte 1:
  174. Temp sensor: warning threshold (scale as bank 0x21)
  175. Volt sensor: min threshold (scale as bank 0x21)
  176. Byte 2:
  177. Temp sensor: shutdown threshold (scale as bank 0x21)
  178. Volt sensor: max threshold (scale as bank 0x21)
  179. Bank 0x24 PWM outputs for FAN's (R)
  180. Bank 0x25 PWM outputs for FAN's (W)
  181. -----------------------------------
  182. This bank contains 3 "sensors", for each sensor it contains 5 bytes.
  183. Sensor 0 usually controls the CPU fan
  184. Sensor 1 usually controls the NB (or chipset for single chip) fan
  185. Sensor 2 usually controls the System fan
  186. Byte 0:
  187. Flag 0x80 to enable control, Fan runs at 100% when disabled.
  188. low nibble (temp)sensor address at bank 0x21 used for control.
  189. Byte 1:
  190. 0-255 = 0-12v (linear), specify voltage at which fan will rotate when under
  191. low threshold temp (specified in byte 3)
  192. Byte 2:
  193. 0-255 = 0-12v (linear), specify voltage at which fan will rotate when above
  194. high threshold temp (specified in byte 4)
  195. Byte 3:
  196. Low threshold temp (scale as bank 0x21)
  197. byte 4:
  198. High threshold temp (scale as bank 0x21)
  199. Bank 0x26 Sensors Bank2 Values / Readings (R)
  200. ---------------------------------------------
  201. This bank contains 6 sensors (AFAIK), for each sensor it contains 1 byte.
  202. So far the following sensors are known to be available on all motherboards:
  203. Sensor 0: CPU fan speed
  204. Sensor 1: NB (or chipset for single chip) fan speed
  205. Sensor 2: SYS fan speed
  206. Byte 0:
  207. This byte holds the reading from the sensor. 0-255 = 0-15300 (linear)
  208. Bank 0x27 Sensors Bank2 Settings (R)
  209. Bank 0x28 Sensors Bank2 Settings (W)
  210. ------------------------------------
  211. This bank contains 6 sensors (AFAIK), for each sensor it contains 2 bytes.
  212. Byte 0:
  213. Alarm behaviour for the selected sensor. A 1 enables the described behaviour.
  214. Bit 0: Give an alarm if measured rpm is under the min threshold (RW)
  215. Bit 3: Beep if alarm (RW)
  216. Bit 7: Shutdown if alarm persist for more then 4 seconds (RW)
  217. Byte 1:
  218. min threshold (scale as bank 0x26)
  219. Warning for the adventerous
  220. ===========================
  221. A word of caution to those who want to experiment and see if they can figure
  222. the voltage / clock programming out, I tried reading and only reading banks
  223. 0-0x30 with the reading code used for the sensor banks (0x20-0x28) and this
  224. resulted in a _permanent_ reprogramming of the voltages, luckily I had the
  225. sensors part configured so that it would shutdown my system on any out of spec
  226. voltages which proprably safed my computer (after a reboot I managed to
  227. immediatly enter the bios and reload the defaults). This probably means that
  228. the read/write cycle for the non sensor part is different from the sensor part.