smsc47b397 4.3 KB

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