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