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