Blame view

Documentation/hwmon/smsc47b397 4.49 KB
7f15b6646   Rudolf Marek   [PATCH] I2C: docu...
1
2
3
4
5
  Kernel driver smsc47b397
  ========================
  
  Supported chips:
    * SMSC LPC47B397-NC
7ab83a913   Mark M. Hoffman   [PATCH] hwmon: Ne...
6
    * SMSC SCH5307-NS
2dbbdb357   Juerg Haefliger   hwmon: add SCH531...
7
    * SMSC SCH5317
7f15b6646   Rudolf Marek   [PATCH] I2C: docu...
8
9
10
11
12
13
      Prefix: 'smsc47b397'
      Addresses scanned: none, address read from Super I/O config space
      Datasheet: In this file
  
  Authors: Mark M. Hoffman <mhoffman@lightlink.com>
           Utilitek Systems, Inc.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
14
  November 23, 2004
7ab83a913   Mark M. Hoffman   [PATCH] hwmon: Ne...
15
  The following specification describes the SMSC LPC47B397-NC[1] sensor chip
7f15b6646   Rudolf Marek   [PATCH] I2C: docu...
16
  (for which there is no public datasheet available). This document was
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
17
18
  provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected
  by Mark M. Hoffman <mhoffman@lightlink.com>.
2dbbdb357   Juerg Haefliger   hwmon: add SCH531...
19
20
  [1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are
  otherwise compatible.
7ab83a913   Mark M. Hoffman   [PATCH] hwmon: Ne...
21

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
22
23
24
25
26
  * * * * *
  
  Methods for detecting the HP SIO and reading the thermal data on a dc7100.
  
  The thermal information on the dc7100 is contained in the SIO Hardware Monitor
7f15b6646   Rudolf Marek   [PATCH] I2C: docu...
27
28
  (HWM). The information is accessed through an index/data pair. The index/data
  pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
29
  HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)
7f15b6646   Rudolf Marek   [PATCH] I2C: docu...
30
  and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  0x480 and 0x481 for the index/data pair.
  
  Reading temperature information.
  The temperature information is located in the following registers:
  Temp1		0x25	(Currently, this reflects the CPU temp on all systems).
  Temp2		0x26
  Temp3		0x27
  Temp4		0x80
  
  Programming Example
  The following is an example of how to read the HWM temperature registers:
  MOV	DX,480H
  MOV	AX,25H
  OUT	DX,AL
  MOV	DX,481H
  IN	AL,DX
  
  AL contains the data in hex, the temperature in Celsius is the decimal
  equivalent.
  
  Ex: If AL contains 0x2A, the temperature is 42 degrees C.
  
  Reading tach information.
  The fan speed information is located in the following registers:
  		LSB	MSB
  Tach1		0x28	0x29	(Currently, this reflects the CPU
  				fan speed on all systems).
  Tach2		0x2A	0x2B
  Tach3		0x2C	0x2D
  Tach4		0x2E	0x2F
  
  Important!!!
  Reading the tach LSB locks the tach MSB.
  The LSB Must be read first.
  
  How to convert the tach reading to RPM.
7f15b6646   Rudolf Marek   [PATCH] I2C: docu...
67
  The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
  The SIO counts the number of 90kHz (11.111us) pulses per revolution.
  RPM = 60/(TCount * 11.111us)
  
  Example:
  Reg 0x28 = 0x9B
  Reg 0x29 = 0x08
  
  TCount = 0x89B = 2203
  
  RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM
  
  Obtaining the SIO version.
  
  CONFIGURATION SEQUENCE
  To program the configuration registers, the following sequence must be followed:
  1. Enter Configuration Mode
  2. Configure the Configuration Registers
  3. Exit Configuration Mode.
  
  Enter Configuration Mode
  To place the chip into the Configuration State The config key (0x55) is written
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
89
  to the CONFIG PORT (0x2E).
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
90
91
92
93
  
  Configuration Mode
  In configuration mode, the INDEX PORT is located at the CONFIG PORT address and
  the DATA PORT is at INDEX PORT address + 1.
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
94
  The desired configuration registers are accessed in two steps:
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
95
96
97
98
99
100
  a.	Write the index of the Logical Device Number Configuration Register
  	(i.e., 0x07) to the INDEX PORT and then write the number of the
  	desired logical device to the DATA PORT.
  
  b.	Write the address of the desired configuration register within the
  	logical device to the INDEX PORT and then write or read the config-
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
101
  	uration register through the DATA PORT.
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
102
103
104
105
106
107
108
109
110
  
  Note: If accessing the Global Configuration Registers, step (a) is not required.
  
  Exit Configuration Mode
  To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).
  The chip returns to the RUN State.  (This is important).
  
  Programming Example
  The following is an example of how to read the SIO Device ID located at 0x20
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
111
  ; ENTER CONFIGURATION MODE
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
112
113
114
  MOV	DX,02EH
  MOV	AX,055H
  OUT	DX,AL
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
115
  ; GLOBAL CONFIGURATION  REGISTER
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
116
117
  MOV	DX,02EH
  MOV	AL,20H
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
118
  OUT	DX,AL
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
119
120
121
  ; READ THE DATA
  MOV	DX,02FH
  IN	AL,DX
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
122
  ; EXIT CONFIGURATION MODE
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
123
124
125
126
127
128
  MOV	DX,02EH
  MOV	AX,0AAH
  OUT	DX,AL
  
  The registers of interest for identifying the SIO on the dc7100 are Device ID
  (0x20) and Device Rev  (0x21).
2dbbdb357   Juerg Haefliger   hwmon: add SCH531...
129
  The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
130
131
132
133
134
  The Device Rev currently reads 0x01
  
  Obtaining the HWM Base Address.
  The following is an example of how to read the HWM Base Address located in
  Logical Device 8.
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
135
  ; ENTER CONFIGURATION MODE
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
136
137
138
  MOV	DX,02EH
  MOV	AX,055H
  OUT	DX,AL
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
139
140
  ; CONFIGURE REGISTER CRE0,
  ; LOGICAL DEVICE 8
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
141
142
143
144
145
146
147
  MOV	DX,02EH
  MOV	AL,07H
  OUT	DX,AL ;Point to LD# Config Reg
  MOV	DX,02FH
  MOV	AL, 08H
  OUT	DX,AL;Point to Logical Device 8
  ;
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
148
  MOV	DX,02EH
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
149
150
151
152
  MOV	AL,60H
  OUT	DX,AL	; Point to HWM Base Addr MSB
  MOV	DX,02FH
  IN	AL,DX	; Get MSB of HWM Base Addr
2bf34a1ca   Rudolf Marek   [PATCH] I2C: docu...
153
  ; EXIT CONFIGURATION MODE
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
154
155
156
  MOV	DX,02EH
  MOV	AX,0AAH
  OUT	DX,AL