0001 Kernel driver smsc47b397
0002 ========================
0003
0004 Supported chips:
0005
0006 * SMSC LPC47B397-NC
0007
0008 * SMSC SCH5307-NS
0009
0010 * SMSC SCH5317
0011
0012 Prefix: 'smsc47b397'
0013
0014 Addresses scanned: none, address read from Super I/O config space
0015
0016 Datasheet: In this file
0017
0018 Authors:
0019
0020 - Mark M. Hoffman <mhoffman@lightlink.com>
0021 - Utilitek Systems, Inc.
0022
0023 November 23, 2004
0024
0025 The following specification describes the SMSC LPC47B397-NC [1]_ sensor chip
0026 (for which there is no public datasheet available). This document was
0027 provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
0028 by Mark M. Hoffman <mhoffman@lightlink.com>.
0029
0030 .. [1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are
0031 otherwise compatible.
0032
0033 -------------------------------------------------------------------------
0034
0035 Methods for detecting the HP SIO and reading the thermal data on a dc7100
0036 -------------------------------------------------------------------------
0037
0038 The thermal information on the dc7100 is contained in the SIO Hardware Monitor
0039 (HWM). The information is accessed through an index/data pair. The index/data
0040 pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The
0041 HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
0042 and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
0043 0x480 and 0x481 for the index/data pair.
0044
0045 Reading temperature information.
0046 The temperature information is located in the following registers:
0047
0048 =============== ======= =======================================================
0049 Temp1 0x25 (Currently, this reflects the CPU temp on all systems).
0050 Temp2 0x26
0051 Temp3 0x27
0052 Temp4 0x80
0053 =============== ======= =======================================================
0054
0055 Programming Example
0056 The following is an example of how to read the HWM temperature registers::
0057
0058 MOV DX,480H
0059 MOV AX,25H
0060 OUT DX,AL
0061 MOV DX,481H
0062 IN AL,DX
0063
0064 AL contains the data in hex, the temperature in Celsius is the decimal
0065 equivalent.
0066
0067 Ex: If AL contains 0x2A, the temperature is 42 degrees C.
0068
0069 Reading tach information.
0070 The fan speed information is located in the following registers:
0071
0072 =============== ======= ======= =================================
0073 LSB MSB
0074 Tach1 0x28 0x29 (Currently, this reflects the CPU
0075 fan speed on all systems).
0076 Tach2 0x2A 0x2B
0077 Tach3 0x2C 0x2D
0078 Tach4 0x2E 0x2F
0079 =============== ======= ======= =================================
0080
0081 .. Important::
0082
0083 Reading the tach LSB locks the tach MSB.
0084 The LSB Must be read first.
0085
0086 How to convert the tach reading to RPM
0087 --------------------------------------
0088
0089 The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
0090 The SIO counts the number of 90kHz (11.111us) pulses per revolution.
0091 RPM = 60/(TCount * 11.111us)
0092
0093 Example::
0094
0095 Reg 0x28 = 0x9B
0096 Reg 0x29 = 0x08
0097
0098 TCount = 0x89B = 2203
0099
0100 RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM
0101
0102 Obtaining the SIO version.
0103
0104 Configuration Sequence
0105 ----------------------
0106
0107 To program the configuration registers, the following sequence must be followed:
0108 1. Enter Configuration Mode
0109 2. Configure the Configuration Registers
0110 3. Exit Configuration Mode.
0111
0112 Enter Configuration Mode
0113 ^^^^^^^^^^^^^^^^^^^^^^^^
0114
0115 To place the chip into the Configuration State The config key (0x55) is written
0116 to the CONFIG PORT (0x2E).
0117
0118 Configuration Mode
0119 ^^^^^^^^^^^^^^^^^^
0120
0121 In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
0122 the DATA PORT is at INDEX PORT address + 1.
0123
0124 The desired configuration registers are accessed in two steps:
0125
0126 a. Write the index of the Logical Device Number Configuration Register
0127 (i.e., 0x07) to the INDEX PORT and then write the number of the
0128 desired logical device to the DATA PORT.
0129
0130 b. Write the address of the desired configuration register within the
0131 logical device to the INDEX PORT and then write or read the config-
0132 uration register through the DATA PORT.
0133
0134 Note:
0135 If accessing the Global Configuration Registers, step (a) is not required.
0136
0137 Exit Configuration Mode
0138 ^^^^^^^^^^^^^^^^^^^^^^^
0139
0140 To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
0141 The chip returns to the RUN State. (This is important).
0142
0143 Programming Example
0144 ^^^^^^^^^^^^^^^^^^^
0145
0146 The following is an example of how to read the SIO Device ID located at 0x20:
0147
0148 ; ENTER CONFIGURATION MODE
0149 MOV DX,02EH
0150 MOV AX,055H
0151 OUT DX,AL
0152 ; GLOBAL CONFIGURATION REGISTER
0153 MOV DX,02EH
0154 MOV AL,20H
0155 OUT DX,AL
0156 ; READ THE DATA
0157 MOV DX,02FH
0158 IN AL,DX
0159 ; EXIT CONFIGURATION MODE
0160 MOV DX,02EH
0161 MOV AX,0AAH
0162 OUT DX,AL
0163
0164 The registers of interest for identifying the SIO on the dc7100 are Device ID
0165 (0x20) and Device Rev (0x21).
0166
0167 The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)
0168 The Device Rev currently reads 0x01
0169
0170 Obtaining the HWM Base Address
0171 ------------------------------
0172
0173 The following is an example of how to read the HWM Base Address located in
0174 Logical Device 8::
0175
0176 ; ENTER CONFIGURATION MODE
0177 MOV DX,02EH
0178 MOV AX,055H
0179 OUT DX,AL
0180 ; CONFIGURE REGISTER CRE0,
0181 ; LOGICAL DEVICE 8
0182 MOV DX,02EH
0183 MOV AL,07H
0184 OUT DX,AL ;Point to LD# Config Reg
0185 MOV DX,02FH
0186 MOV AL, 08H
0187 OUT DX,AL;Point to Logical Device 8
0188 ;
0189 MOV DX,02EH
0190 MOV AL,60H
0191 OUT DX,AL ; Point to HWM Base Addr MSB
0192 MOV DX,02FH
0193 IN AL,DX ; Get MSB of HWM Base Addr
0194 ; EXIT CONFIGURATION MODE
0195 MOV DX,02EH
0196 MOV AX,0AAH
0197 OUT DX,AL