smsc47b397 4.5 KB

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