brintos

brintos / linux-shallow public Read only

0
0
Text · 5.2 KiB · 600194c Raw
198 lines · plain
1Kernel driver smsc47b3972========================3 4Supported chips:5 6  * SMSC LPC47B397-NC7 8  * SMSC SCH5307-NS9 10  * SMSC SCH531711 12    Prefix: 'smsc47b397'13 14    Addresses scanned: none, address read from Super I/O config space15 16    Datasheet: In this file17 18Authors:19 20       - Mark M. Hoffman <mhoffman@lightlink.com>21       - Utilitek Systems, Inc.22 23November 23, 200424 25The following specification describes the SMSC LPC47B397-NC [1]_ sensor chip26(for which there is no public datasheet available). This document was27provided by Craig Kelly (In-Store Broadcast Network) and edited/corrected28by Mark M. Hoffman <mhoffman@lightlink.com>.29 30.. [1] And SMSC SCH5307-NS and SCH5317, which have different device IDs but are31       otherwise compatible.32 33-------------------------------------------------------------------------34 35Methods for detecting the HP SIO and reading the thermal data on a dc710036-------------------------------------------------------------------------37 38The thermal information on the dc7100 is contained in the SIO Hardware Monitor39(HWM). The information is accessed through an index/data pair. The index/data40pair is located at the HWM Base Address + 0 and the HWM Base Address + 1. The41HWM Base address can be obtained from Logical Device 8, registers 0x60 (MSB)42and 0x61 (LSB). Currently we are using 0x480 for the HWM Base Address and430x480 and 0x481 for the index/data pair.44 45Reading temperature information.46The temperature information is located in the following registers:47 48=============== ======= =======================================================49Temp1		0x25	(Currently, this reflects the CPU temp on all systems).50Temp2		0x2651Temp3		0x2752Temp4		0x8053=============== ======= =======================================================54 55Programming Example56The following is an example of how to read the HWM temperature registers::57 58	MOV	DX,480H59	MOV	AX,25H60	OUT	DX,AL61	MOV	DX,481H62	IN	AL,DX63 64AL contains the data in hex, the temperature in Celsius is the decimal65equivalent.66 67Ex: If AL contains 0x2A, the temperature is 42 degrees C.68 69Reading tach information.70The fan speed information is located in the following registers:71 72=============== ======= ======= =================================73		LSB	MSB74Tach1		0x28	0x29	(Currently, this reflects the CPU75				fan speed on all systems).76Tach2		0x2A	0x2B77Tach3		0x2C	0x2D78Tach4		0x2E	0x2F79=============== ======= ======= =================================80 81.. Important::82 83	Reading the tach LSB locks the tach MSB.84	The LSB Must be read first.85 86How to convert the tach reading to RPM87--------------------------------------88 89The tach reading (TCount) is given by: (Tach MSB * 256) + (Tach LSB)90The SIO counts the number of 90kHz (11.111us) pulses per revolution.91RPM = 60/(TCount * 11.111us)92 93Example::94 95	Reg 0x28 = 0x9B96	Reg 0x29 = 0x0897 98TCount = 0x89B = 220399 100RPM = 60 / (2203 * 11.11111 E-6) = 2451 RPM101 102Obtaining the SIO version.103 104Configuration Sequence105----------------------106 107To program the configuration registers, the following sequence must be followed:1081. Enter Configuration Mode1092. Configure the Configuration Registers1103. Exit Configuration Mode.111 112Enter Configuration Mode113^^^^^^^^^^^^^^^^^^^^^^^^114 115To place the chip into the Configuration State The config key (0x55) is written116to the CONFIG PORT (0x2E).117 118Configuration Mode119^^^^^^^^^^^^^^^^^^120 121In configuration mode, the INDEX PORT is located at the CONFIG PORT address and122the DATA PORT is at INDEX PORT address + 1.123 124The desired configuration registers are accessed in two steps:125 126a.	Write the index of the Logical Device Number Configuration Register127	(i.e., 0x07) to the INDEX PORT and then write the number of the128	desired logical device to the DATA PORT.129 130b.	Write the address of the desired configuration register within the131	logical device to the INDEX PORT and then write or read the config-132	uration register through the DATA PORT.133 134Note:135	If accessing the Global Configuration Registers, step (a) is not required.136 137Exit Configuration Mode138^^^^^^^^^^^^^^^^^^^^^^^139 140To exit the Configuration State the write 0xAA to the CONFIG PORT (0x2E).141The chip returns to the RUN State.  (This is important).142 143Programming Example144^^^^^^^^^^^^^^^^^^^145 146The following is an example of how to read the SIO Device ID located at 0x20:147 148	; ENTER CONFIGURATION MODE149	MOV	DX,02EH150	MOV	AX,055H151	OUT	DX,AL152	; GLOBAL CONFIGURATION  REGISTER153	MOV	DX,02EH154	MOV	AL,20H155	OUT	DX,AL156	; READ THE DATA157	MOV	DX,02FH158	IN	AL,DX159	; EXIT CONFIGURATION MODE160	MOV	DX,02EH161	MOV	AX,0AAH162	OUT	DX,AL163 164The registers of interest for identifying the SIO on the dc7100 are Device ID165(0x20) and Device Rev  (0x21).166 167The Device ID will read 0x6F (0x81 for SCH5307-NS, and 0x85 for SCH5317)168The Device Rev currently reads 0x01169 170Obtaining the HWM Base Address171------------------------------172 173The following is an example of how to read the HWM Base Address located in174Logical Device 8::175 176	; ENTER CONFIGURATION MODE177	MOV	DX,02EH178	MOV	AX,055H179	OUT	DX,AL180	; CONFIGURE REGISTER CRE0,181	; LOGICAL DEVICE 8182	MOV	DX,02EH183	MOV	AL,07H184	OUT	DX,AL ;Point to LD# Config Reg185	MOV	DX,02FH186	MOV	AL, 08H187	OUT	DX,AL;Point to Logical Device 8188	;189	MOV	DX,02EH190	MOV	AL,60H191	OUT	DX,AL	; Point to HWM Base Addr MSB192	MOV	DX,02FH193	IN	AL,DX	; Get MSB of HWM Base Addr194	; EXIT CONFIGURATION MODE195	MOV	DX,02EH196	MOV	AX,0AAH197	OUT	DX,AL198