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