smsc47b397.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. Kernel driver smsc47b397
  2. ========================
  3. Supported chips:
  4. * SMSC LPC47B397-NC
  5. * SMSC SCH5307-NS
  6. * SMSC SCH5317
  7. Prefix: 'smsc47b397'
  8. Addresses scanned: none, address read from Super I/O config space
  9. Datasheet: In this file
  10. Authors:
  11. - Mark M. Hoffman <mhoffman@lightlink.com>
  12. - Utilitek Systems, Inc.
  13. November 23, 2004
  14. The following specification describes the SMSC LPC47B397-NC [1]_ sensor chip
  15. (for which there is no public datasheet available). This document was
  16. provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
  17. by Mark M. Hoffman <mhoffman@lightlink.com>.
  18. .. [1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are
  19. otherwise compatible.
  20. -------------------------------------------------------------------------
  21. Methods for detecting the HP SIO and reading the thermal data on a dc7100
  22. -------------------------------------------------------------------------
  23. The thermal information on the dc7100 is contained in the SIO Hardware Monitor
  24. (HWM). The information is accessed through an index/data pair. The index/data
  25. pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The
  26. HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
  27. and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
  28. 0x480 and 0x481 for the index/data pair.
  29. Reading temperature information.
  30. The temperature information is located in the following registers:
  31. =============== ======= =======================================================
  32. Temp1 0x25 (Currently, this reflects the CPU temp on all systems).
  33. Temp2 0x26
  34. Temp3 0x27
  35. Temp4 0x80
  36. =============== ======= =======================================================
  37. Programming Example
  38. The following is an example of how to read the HWM temperature registers::
  39. MOV DX,480H
  40. MOV AX,25H
  41. OUT DX,AL
  42. MOV DX,481H
  43. IN AL,DX
  44. AL contains the data in hex, the temperature in Celsius is the decimal
  45. equivalent.
  46. Ex: If AL contains 0x2A, the temperature is 42 degrees C.
  47. Reading tach information.
  48. The fan speed information is located in the following registers:
  49. =============== ======= ======= =================================
  50. LSB MSB
  51. Tach1 0x28 0x29 (Currently, this reflects the CPU
  52. fan speed on all systems).
  53. Tach2 0x2A 0x2B
  54. Tach3 0x2C 0x2D
  55. Tach4 0x2E 0x2F
  56. =============== ======= ======= =================================
  57. .. Important::
  58. Reading the tach LSB locks the tach MSB.
  59. The LSB Must be read first.
  60. How to convert the tach reading to RPM
  61. --------------------------------------
  62. The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
  63. The SIO counts the number of 90kHz (11.111us) pulses per revolution.
  64. RPM = 60/(TCount * 11.111us)
  65. Example::
  66. Reg 0x28 = 0x9B
  67. Reg 0x29 = 0x08
  68. TCount = 0x89B = 2203
  69. RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM
  70. Obtaining the SIO version.
  71. Configuration Sequence
  72. ----------------------
  73. To program the configuration registers, the following sequence must be followed:
  74. 1. Enter Configuration Mode
  75. 2. Configure the Configuration Registers
  76. 3. Exit Configuration Mode.
  77. Enter Configuration Mode
  78. ^^^^^^^^^^^^^^^^^^^^^^^^
  79. To place the chip into the Configuration State The config key (0x55) is written
  80. to the CONFIG PORT (0x2E).
  81. Configuration Mode
  82. ^^^^^^^^^^^^^^^^^^
  83. In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
  84. the DATA PORT is at INDEX PORT address + 1.
  85. The desired configuration registers are accessed in two steps:
  86. a. Write the index of the Logical Device Number Configuration Register
  87. (i.e., 0x07) to the INDEX PORT and then write the number of the
  88. desired logical device to the DATA PORT.
  89. b. Write the address of the desired configuration register within the
  90. logical device to the INDEX PORT and then write or read the config-
  91. uration register through the DATA PORT.
  92. Note:
  93. If accessing the Global Configuration Registers, step (a) is not required.
  94. Exit Configuration Mode
  95. ^^^^^^^^^^^^^^^^^^^^^^^
  96. To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
  97. The chip returns to the RUN State. (This is important).
  98. Programming Example
  99. ^^^^^^^^^^^^^^^^^^^
  100. The following is an example of how to read the SIO Device ID located at 0x20:
  101. ; ENTER CONFIGURATION MODE
  102. MOV DX,02EH
  103. MOV AX,055H
  104. OUT DX,AL
  105. ; GLOBAL CONFIGURATION REGISTER
  106. MOV DX,02EH
  107. MOV AL,20H
  108. OUT DX,AL
  109. ; READ THE DATA
  110. MOV DX,02FH
  111. IN AL,DX
  112. ; EXIT CONFIGURATION MODE
  113. MOV DX,02EH
  114. MOV AX,0AAH
  115. OUT DX,AL
  116. The registers of interest for identifying the SIO on the dc7100 are Device ID
  117. (0x20) and Device Rev (0x21).
  118. The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)
  119. The Device Rev currently reads 0x01
  120. Obtaining the HWM Base Address
  121. ------------------------------
  122. The following is an example of how to read the HWM Base Address located in
  123. Logical Device 8::
  124. ; ENTER CONFIGURATION MODE
  125. MOV DX,02EH
  126. MOV AX,055H
  127. OUT DX,AL
  128. ; CONFIGURE REGISTER CRE0,
  129. ; LOGICAL DEVICE 8
  130. MOV DX,02EH
  131. MOV AL,07H
  132. OUT DX,AL ;Point to LD# Config Reg
  133. MOV DX,02FH
  134. MOV AL, 08H
  135. OUT DX,AL;Point to Logical Device 8
  136. ;
  137. MOV DX,02EH
  138. MOV AL,60H
  139. OUT DX,AL ; Point to HWM Base Addr MSB
  140. MOV DX,02FH
  141. IN AL,DX ; Get MSB of HWM Base Addr
  142. ; EXIT CONFIGURATION MODE
  143. MOV DX,02EH
  144. MOV AX,0AAH
  145. OUT DX,AL