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