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