blob: 3a43b694892490b564350cff1169e26e6487d048 [file] [log] [blame]
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +00001Kernel driver smsc47b397
2========================
3
4Supported chips:
5 * SMSC LPC47B397-NC
Mark M. Hoffman7ab83a92005-10-17 23:01:45 +02006 * SMSC SCH5307-NS
Juerg Haefliger2dbbdb32007-06-20 15:41:33 -07007 * SMSC SCH5317
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +00008 Prefix: 'smsc47b397'
9 Addresses scanned: none, address read from Super I/O config space
10 Datasheet: In this file
11
12Authors: Mark M. Hoffman <mhoffman@lightlink.com>
13 Utilitek Systems, Inc.
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015November 23, 2004
16
Mark M. Hoffman7ab83a92005-10-17 23:01:45 +020017The following specification describes the SMSC LPC47B397-NC[1] sensor chip
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000018(for which there is no public datasheet available). This document was
Linus Torvalds1da177e2005-04-16 15:20:36 -070019provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
20by Mark M. Hoffman <mhoffman@lightlink.com>.
21
Juerg Haefliger2dbbdb32007-06-20 15:41:33 -070022[1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are
23otherwise compatible.
Mark M. Hoffman7ab83a92005-10-17 23:01:45 +020024
Linus Torvalds1da177e2005-04-16 15:20:36 -070025* * * * *
26
27Methods for detecting the HP SIO and reading the thermal data on a dc7100.
28
29The thermal information on the dc7100 is contained in the SIO Hardware Monitor
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000030(HWM). The information is accessed through an index/data pair. The index/data
31pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The
Linus Torvalds1da177e2005-04-16 15:20:36 -070032HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000033and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340x480 and 0x481 for the index/data pair.
35
36Reading temperature information.
37The temperature information is located in the following registers:
38Temp1 0x25 (Currently, this reflects the CPU temp on all systems).
39Temp2 0x26
40Temp3 0x27
41Temp4 0x80
42
43Programming Example
44The following is an example of how to read the HWM temperature registers:
45MOV DX,480H
46MOV AX,25H
47OUT DX,AL
48MOV DX,481H
49IN AL,DX
50
51AL contains the data in hex, the temperature in Celsius is the decimal
52equivalent.
53
54Ex: If AL contains 0x2A, the temperature is 42 degrees C.
55
56Reading tach information.
57The fan speed information is located in the following registers:
58 LSB MSB
59Tach1 0x28 0x29 (Currently, this reflects the CPU
60 fan speed on all systems).
61Tach2 0x2A 0x2B
62Tach3 0x2C 0x2D
63Tach4 0x2E 0x2F
64
65Important!!!
66Reading the tach LSB locks the tach MSB.
67The LSB Must be read first.
68
69How to convert the tach reading to RPM.
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000070The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
Linus Torvalds1da177e2005-04-16 15:20:36 -070071The SIO counts the number of 90kHz (11.111us) pulses per revolution.
72RPM = 60/(TCount * 11.111us)
73
74Example:
75Reg 0x28 = 0x9B
76Reg 0x29 = 0x08
77
78TCount = 0x89B = 2203
79
80RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM
81
82Obtaining the SIO version.
83
84CONFIGURATION SEQUENCE
85To program the configuration registers, the following sequence must be followed:
861. Enter Configuration Mode
872. Configure the Configuration Registers
883. Exit Configuration Mode.
89
90Enter Configuration Mode
91To place the chip into the Configuration State The config key (0x55) is written
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +000092to the CONFIG PORT (0x2E).
Linus Torvalds1da177e2005-04-16 15:20:36 -070093
94Configuration Mode
95In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
96the DATA PORT is at INDEX PORT address + 1.
97
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +000098The desired configuration registers are accessed in two steps:
Linus Torvalds1da177e2005-04-16 15:20:36 -070099a. Write the index of the Logical Device Number Configuration Register
100 (i.e., 0x07) to the INDEX PORT and then write the number of the
101 desired logical device to the DATA PORT.
102
103b. Write the address of the desired configuration register within the
104 logical device to the INDEX PORT and then write or read the config-
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000105 uration register through the DATA PORT.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
107Note: If accessing the Global Configuration Registers, step (a) is not required.
108
109Exit Configuration Mode
110To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
111The chip returns to the RUN State. (This is important).
112
113Programming Example
114The following is an example of how to read the SIO Device ID located at 0x20
115
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000116; ENTER CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117MOV DX,02EH
118MOV AX,055H
119OUT DX,AL
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000120; GLOBAL CONFIGURATION REGISTER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121MOV DX,02EH
122MOV AL,20H
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000123OUT DX,AL
Linus Torvalds1da177e2005-04-16 15:20:36 -0700124; READ THE DATA
125MOV DX,02FH
126IN AL,DX
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000127; EXIT CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128MOV DX,02EH
129MOV AX,0AAH
130OUT DX,AL
131
132The registers of interest for identifying the SIO on the dc7100 are Device ID
133(0x20) and Device Rev (0x21).
134
Juerg Haefliger2dbbdb32007-06-20 15:41:33 -0700135The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136The Device Rev currently reads 0x01
137
138Obtaining the HWM Base Address.
139The following is an example of how to read the HWM Base Address located in
140Logical Device 8.
141
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000142; ENTER CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143MOV DX,02EH
144MOV AX,055H
145OUT DX,AL
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000146; CONFIGURE REGISTER CRE0,
147; LOGICAL DEVICE 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148MOV DX,02EH
149MOV AL,07H
150OUT DX,AL ;Point to LD# Config Reg
151MOV DX,02FH
152MOV AL, 08H
153OUT DX,AL;Point to Logical Device 8
154;
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000155MOV DX,02EH
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156MOV AL,60H
157OUT DX,AL ; Point to HWM Base Addr MSB
158MOV DX,02FH
159IN AL,DX ; Get MSB of HWM Base Addr
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000160; EXIT CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161MOV DX,02EH
162MOV AX,0AAH
163OUT DX,AL