smsc47b397 4.4 KB

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