blob: 20682f15ae410cc7962c1914fe0f959465330f91 [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
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +00007 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070014November 23, 2004
15
Mark M. Hoffman7ab83a92005-10-17 23:01:45 +020016The following specification describes the SMSC LPC47B397-NC[1] sensor chip
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000017(for which there is no public datasheet available). This document was
Linus Torvalds1da177e2005-04-16 15:20:36 -070018provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
19by Mark M. Hoffman <mhoffman@lightlink.com>.
20
Mark M. Hoffman7ab83a92005-10-17 23:01:45 +020021[1] And SMSC SCH5307-NS, which has a different device ID but is otherwise
22compatible.
23
Linus Torvalds1da177e2005-04-16 15:20:36 -070024* * * * *
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
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000029(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
Linus Torvalds1da177e2005-04-16 15:20:36 -070031HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000032and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
Linus Torvalds1da177e2005-04-16 15:20:36 -0700330x480 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.
R.Marek@sh.cvut.cz7f15b662005-05-26 12:42:19 +000069The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
Linus Torvalds1da177e2005-04-16 15:20:36 -070070The 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
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +000091to the CONFIG PORT (0x2E).
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
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
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +000097The desired configuration registers are accessed in two steps:
Linus Torvalds1da177e2005-04-16 15:20:36 -070098a. 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-
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000104 uration register through the DATA PORT.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
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
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000115; ENTER CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700116MOV DX,02EH
117MOV AX,055H
118OUT DX,AL
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000119; GLOBAL CONFIGURATION REGISTER
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120MOV DX,02EH
121MOV AL,20H
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000122OUT DX,AL
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123; READ THE DATA
124MOV DX,02FH
125IN AL,DX
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000126; EXIT CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127MOV 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
Mark M. Hoffman7ab83a92005-10-17 23:01:45 +0200134The Device ID will read 0x6F (for SCH5307-NS, 0x81)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700135The 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
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000141; ENTER CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142MOV DX,02EH
143MOV AX,055H
144OUT DX,AL
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000145; CONFIGURE REGISTER CRE0,
146; LOGICAL DEVICE 8
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147MOV 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;
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000154MOV DX,02EH
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155MOV AL,60H
156OUT DX,AL ; Point to HWM Base Addr MSB
157MOV DX,02FH
158IN AL,DX ; Get MSB of HWM Base Addr
R.Marek@sh.cvut.cz2bf34a12005-05-26 12:42:11 +0000159; EXIT CONFIGURATION MODE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160MOV DX,02EH
161MOV AX,0AAH
162OUT DX,AL