Subversion Repositories Kolibri OS

Rev

Rev 250 | Rev 518 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 250 Rev 313
-
 
1
;
-
 
2
; Ghost Monitor - óòèëèòà (ñòðåññ) òåñòèðîâàíèÿ è ìîíèòîðèíãà ñèñòåìû
-
 
3
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
-
 
4
; All Right Reserved
-
 
5
 
1
; Integrated Technology Express
6
; Integrated Technology Express
2
;	Chip	Temp	Volt	Fan   ISA   SMBus
7
;	Chip	Temp	Volt	Fan   ISA   SMBus
3
;	it8705	 3	 8	 3     +      +
8
;	it8705	 3	 8	 3     +      +
4
;	it8712	 3	 8	 3     +      +
9
;	it8712	 3	 8	 3     +      +
5
 
10
 
6
; SiS
11
; SiS
7
;	Chip	Temp	Volt	Fan   ISA   SMBus
12
;	Chip	Temp	Volt	Fan   ISA   SMBus
8
;	sis950	 3	 8	 3     +      +
13
;	sis950	 3	 8	 3     +      +
9
 
14
 
10
IT87_REGCHIP	equ	0x58
15
IT87_REGCHIP	equ	0x58
11
IT87_CHIPID	equ	0x90
16
IT87_CHIPID	equ	0x90
12
IT87_FANDIV	equ	0x0B
17
IT87_FANDIV	equ	0x0B
13
it8705		db	15, 'IT8705F/SiS 950'
18
it8705		db	15, 'IT8705F/SiS 950'
14
it8712		db	 7, 'IT8712F'
19
it8712		db	 7, 'IT8712F'
15
it8716		db	 7, 'IT8716F'
20
it8716		db	 7, 'IT8716F'
16
ite_unk		db	11, 'Unknown ITE'
21
ite_unk		db	11, 'Unknown ITE'
17
 
22
 
18
ite_coeff:	dd 0.016		; Vcore
23
ite_coeff:	dd 0.016		; Vcore
19
		dd 0.016		; Vin0
24
		dd 0.016		; Vin0
20
		dd 0.016		; Vin1 (+3.3V)
25
		dd 0.016		; Vin1 (+3.3V)
21
		dd 0.02688		; AVcc (+5V)
26
		dd 0.02688		; AVcc (+5V)
22
		dd 0.0608		; Vin2 (+12V)
27
		dd 0.0608		; Vin2 (+12V)
23
		dd -0.055632		; -12V
28
		dd -0.055632		; -12V
24
		dd -0.02408		; -5V
29
		dd -0.02408		; -5V
25
;-----------------------------------
30
;-----------------------------------
26
it87_init:
31
it87_init:
27
; Ïðîâåðêà íàëè÷èÿ è èíèöèàëèçàöèÿ
32
; Ïðîâåðêà íàëè÷èÿ è èíèöèàëèçàöèÿ
28
; OUT - CF = 1 - error
33
; OUT - CF = 1 - error
29
	cmp	byte[acc_type], 2	; Only ISA and SMBus
34
	cmp	byte[acc_type], 2	; Only ISA and SMBus
30
	jae	.no_io
35
	jae	.no_io
31
 
36
 
32
	mov	ecx, 0x2e
37
	mov	ecx, 0x2e
33
	mov	edx, 0x2f
38
	mov	edx, 0x2f
34
	call	ReservePorts
39
	call	ReservePorts
35
	jc	.no_io
40
	jc	.no_io
36
 
41
 
37
	mov	eax, 0x55550187		; ïåðåõîä â MB PnP Mode
42
	mov	eax, 0x55550187		; ïåðåõîä â MB PnP Mode
38
	out	0x2e, al
43
	out	0x2e, al
39
	shr	eax, 8
44
	shr	eax, 8
40
	out	0x2e, al
45
	out	0x2e, al
41
	shr	eax, 8
46
	shr	eax, 8
42
	out	0x2e, al
47
	out	0x2e, al
43
	shr	eax, 8
48
	shr	eax, 8
44
	out	0x2e, al
49
	out	0x2e, al
45
 
50
 
46
	mov	al, 0x20
51
	mov	al, 0x20
47
	out	0x2e, al
52
	out	0x2e, al
48
	in	al, 0x2f		; al = 0x87
53
	in	al, 0x2f		; al = 0x87
49
	push	eax
54
	push	eax
50
 
55
 
51
	mov	al, 0x21
56
	mov	al, 0x21
52
	out	0x2e, al
57
	out	0x2e, al
53
	in	al, 0x2f		; al = model
58
	in	al, 0x2f		; al = model
54
	push	eax
59
	push	eax
55
 
60
 
56
	mov	al, 0x02		; âûõîä èç ðåæèìà
61
	mov	al, 0x02		; âûõîä èç ðåæèìà
57
	out	0x2E, al
62
	out	0x2E, al
58
	out	0x2F, al
63
	out	0x2F, al
59
	
64
	
60
	mov	ecx, 0x2e
65
	mov	ecx, 0x2e
61
	mov	edx, 0x2f
66
	mov	edx, 0x2f
62
	call	FreePorts
67
	call	FreePorts
63
	
68
	
64
	pop	eax
69
	pop	eax
65
	pop	ebx
70
	pop	ebx
66
	cmp	bl, 0x87
71
	cmp	bl, 0x87
67
	jne	.no_io
72
	jne	.no_io
68
	
73
	
69
	mov	edx, it8705
74
	mov	edx, it8705
70
	cmp	al, 0x05
75
	cmp	al, 0x05
71
	je	@f
76
	je	@f
72
	mov	edx, it8712
77
	mov	edx, it8712
73
	cmp	al, 0x12
78
	cmp	al, 0x12
74
	je	@f
79
	je	@f
75
	mov	edx, it8716
80
	mov	edx, it8716
76
	cmp	al, 0x16
81
	cmp	al, 0x16
77
	je	@f
82
	je	@f
78
	mov	edx, ite_unk
83
	mov	edx, ite_unk
79
@@:	mov	[hwm_chip_name], edx
84
@@:	mov	[hwm_chip_name], edx
80
	clc
85
	clc
81
	ret	
86
	ret	
82
	
87
	
83
.no_io:	stc
88
.no_io:	stc
84
	ret
89
	ret
85
 
90
 
86
	; cmp	byte[acc_type], 2	; Only ISA and SMBus
91
	; cmp	byte[acc_type], 2	; Only ISA and SMBus
87
	; jae	it87_no
92
	; jae	it87_no
88
	;;--- Ïðîâåðÿåì IT87* --------
93
	;;--- Ïðîâåðÿåì IT87* --------
89
	; mov	al, IT87_REGCHIP
94
	; mov	al, IT87_REGCHIP
90
	; call	[IO_Read]
95
	; call	[IO_Read]
91
	; cmp	al, IT87_CHIPID
96
	; cmp	al, IT87_CHIPID
92
	; jne	it87_no		; ýòî íå it87 !!!
97
	; jne	it87_no		; ýòî íå it87 !!!
93
	;;-~- not tested ~-~-
98
	;;-~- not tested ~-~-
94
	; mov	al, 0x21	; --- óçíà¸ì èäåíòèôèêàòîð ÷èïà --
99
	; mov	al, 0x21	; --- óçíà¸ì èäåíòèôèêàòîð ÷èïà --
95
	; call	[IO_Read]
100
	; call	[IO_Read]
96
	; mov	edx, it8705
101
	; mov	edx, it8705
97
	; cmp	al, 0x05
102
	; cmp	al, 0x05
98
	; je	@f
103
	; je	@f
99
	; mov	edx, it8712
104
	; mov	edx, it8712
100
	; cmp	al, 0x12
105
	; cmp	al, 0x12
101
	; je	@f
106
	; je	@f
102
	; mov	edx, it8716
107
	; mov	edx, it8716
103
	; cmp	al, 0x16
108
	; cmp	al, 0x16
104
	; je	@f
109
	; je	@f
105
	; mov	edx, ite_unk
110
	; mov	edx, ite_unk
106
; @@:	mov	[hwm_chip_name], edx
111
; @@:	mov	[hwm_chip_name], edx
107
	;;-~-~-~-~-~-~-~-~-~-
112
	;;-~-~-~-~-~-~-~-~-~-
108
	; clc
113
	; clc
109
	; ret
114
	; ret
110
; it87_no:stc
115
; it87_no:stc
111
	; ret
116
	; ret
112
	
117
	
113
;-----------------------------------
118
;-----------------------------------
114
it87_getparam:
119
it87_getparam:
115
	call	it87_get_temp
120
	call	it87_get_temp
116
	call	it87_get_fan_speed
121
	call	it87_get_fan_speed
117
	mov	edi, ite_coeff
122
	mov	edi, ite_coeff
118
	call	wb_get_volt
123
	call	wb_get_volt
119
	ret
124
	ret
120
;-----------------------------------
125
;-----------------------------------
121
it87_get_temp:
126
it87_get_temp:
122
	xor	ecx, ecx
127
	xor	ecx, ecx
123
	mov	esi, hwm_temps
128
	mov	esi, hwm_temps
124
@@:	mov	eax, ecx
129
@@:	mov	eax, ecx
125
	add	al, 0x29
130
	add	al, 0x29
126
	call	[IO_Read]
131
	call	[IO_Read]
127
	mov	[esi + ecx * 2], al
132
	mov	[esi + ecx * 2], al
128
	inc	ecx
133
	inc	ecx
129
	cmp	ecx, 3
134
	cmp	ecx, 3
130
	jb	@b
135
	jb	@b
131
	ret
136
	ret
132
;-----------------------------------
137
;-----------------------------------
133
it87_fan_div	db	1, 1, 1
138
it87_fan_div	db	1, 1, 1
134
it87_get_fan_speed:
139
it87_get_fan_speed:
135
; ÷èòàåì äåëèòåëè
140
; ÷èòàåì äåëèòåëè
136
	mov	al, IT87_FANDIV
141
	mov	al, IT87_FANDIV
137
	call	[IO_Read]
142
	call	[IO_Read]
138
 
143
 
139
	mov	ah, al
144
	mov	ah, al
140
	and	al, 0x07
145
	and	al, 0x07
141
	mov	[it87_fan_div], al
146
	mov	[it87_fan_div], al
142
	shr	ah, 3
147
	shr	ah, 3
143
	and	ah, 0x07
148
	and	ah, 0x07
144
	mov	[it87_fan_div + 1], ah
149
	mov	[it87_fan_div + 1], ah
145
 
150
 
146
	xor	ecx, ecx
151
	xor	ecx, ecx
147
@@:	mov	al, 0x0D
152
@@:	mov	al, 0x0D
148
	add	al, cl
153
	add	al, cl
149
	call	[IO_Read]
154
	call	[IO_Read]
150
 
155
 
151
	movzx	ebx, al
156
	movzx	ebx, al
152
	push	ecx
157
	push	ecx
153
	mov	cl, [it87_fan_div + ecx]
158
	mov	cl, [it87_fan_div + ecx]
154
	shl	ebx, cl
159
	shl	ebx, cl
155
	pop	ecx
160
	pop	ecx
156
	mov	eax, 1350000
161
	mov	eax, 1350000
157
	xor	edx, edx
162
	xor	edx, edx
158
	div	ebx
163
	div	ebx
159
	mov	[hwm_rpms + 4 * ecx], eax
164
	mov	[hwm_rpms + 4 * ecx], eax
160
	inc	ecx
165
	inc	ecx
161
	cmp	ecx, 3
166
	cmp	ecx, 3
162
	jb	@b
167
	jb	@b
163
 
168
 
164
	ret
169
	ret
165
;--------------------------------------------------------------------------
170
;--------------------------------------------------------------------------
166
;
171
;
167
; Presets for IT8712
172
; Presets for IT8712
168
;
173
;
169
; Volt = A * read_val + B
174
; Volt = A * read_val + B
170
;
175
;
171
;	A, B
176
;	A, B
172
; --- 0 ---
177
; --- 0 ---
173
; dd 0.01565, 0.0
178
; dd 0.01565, 0.0
174
; dd 0.016, 0.0
179
; dd 0.016, 0.0
175
; dd 0.016, 0.0
180
; dd 0.016, 0.0
176
; dd 0.0, 0.0
181
; dd 0.0, 0.0
177
; dd 0.0608, 0.0
182
; dd 0.0608, 0.0
178
; dd 0.0, 0.0
183
; dd 0.0, 0.0
179
; dd 0.0, 0.0
184
; dd 0.0, 0.0
180
; dd 0.08224, -22.104
185
; dd 0.08224, -22.104
181
; dd 0.016, 0.0
186
; dd 0.016, 0.0
182
 
187
 
183
; --- 1 ---
188
; --- 1 ---
184
; dd 0.01614, 0.0
189
; dd 0.01614, 0.0
185
; dd 0.01614, 0.0
190
; dd 0.01614, 0.0
186
; dd 0.01614, 0.0
191
; dd 0.01614, 0.0
187
; dd 0.01614, 0.0
192
; dd 0.01614, 0.0
188
; dd 0.062946, 0.0
193
; dd 0.062946, 0.0
189
; dd 0.0, 0.0
194
; dd 0.0, 0.0
190
; dd 0.0, 0.0
195
; dd 0.0, 0.0
191
; dd 0.016, 0.0
196
; dd 0.016, 0.0
192
; dd 0.016, 0.0
197
; dd 0.016, 0.0
193
 
198
 
194
; --- 2 ---
199
; --- 2 ---
195
; dd 0.016, 0.0
200
; dd 0.016, 0.0
196
; dd 0.016, 0.0
201
; dd 0.016, 0.0
197
; dd 0.016, 0.0
202
; dd 0.016, 0.0
198
; dd 0.062946, 0.0
203
; dd 0.062946, 0.0
199
; dd 0.016, 0.0
204
; dd 0.016, 0.0
200
; dd 0.01614, 0.0
205
; dd 0.01614, 0.0
201
; dd 0.0, 0.0
206
; dd 0.0, 0.0
202
; dd 0.016, 0.0
207
; dd 0.016, 0.0
203
; dd 0.016, 0.0
208
; dd 0.016, 0.0
204
 
209
 
205
; --- 3 ---
210
; --- 3 ---
206
; dd 0.016, 0.0
211
; dd 0.016, 0.0
207
; dd 0.016, 0.0
212
; dd 0.016, 0.0
208
; dd 0.016, 0.0
213
; dd 0.016, 0.0
209
; dd 0.027, 0.0
214
; dd 0.027, 0.0
210
; dd 0.06564, 0.0
215
; dd 0.06564, 0.0
211
; dd 0.084, -17.408
216
; dd 0.084, -17.408
212
; dd 0.0512, -9.0112
217
; dd 0.0512, -9.0112
213
; dd 0.016, 0.0
218
; dd 0.016, 0.0
214
; dd 0.016, 0.0
219
; dd 0.016, 0.0
215
 
220
 
216
; --- 4 ---
221
; --- 4 ---
217
; dd 0.01653, 0.0
222
; dd 0.01653, 0.0
218
; dd 0.016, 0.0
223
; dd 0.016, 0.0
219
; dd 0.016, 0.0
224
; dd 0.016, 0.0
220
; dd 0.02684, 0.0
225
; dd 0.02684, 0.0
221
; dd 0.06398, 0.0
226
; dd 0.06398, 0.0
222
; dd 0.0, 0.0
227
; dd 0.0, 0.0
223
; dd 0.0, 0.0
228
; dd 0.0, 0.0
224
; dd 0.016, 0.0
229
; dd 0.016, 0.0
225
; dd 0.016, 0.0
230
; dd 0.016, 0.0
226
 
231
 
227
; --- 5 ---
232
; --- 5 ---
228
; dd 0.016, 0.0
233
; dd 0.016, 0.0
229
; dd 0.016, 0.0
234
; dd 0.016, 0.0
230
; dd 0.016, 0.0
235
; dd 0.016, 0.0
231
; dd 0.027, 0.0
236
; dd 0.027, 0.0
232
; dd 0.06369, 0.0
237
; dd 0.06369, 0.0
233
; dd 0.082285714288, -16.9691428598999
238
; dd 0.082285714288, -16.9691428598999
234
; dd 0.016, 0.0
239
; dd 0.016, 0.0
235
; dd 0.016, 0.0
240
; dd 0.016, 0.0
236
; dd 0.016, 0.0
241
; dd 0.016, 0.0
237
 
242
 
238
; --- 6 ---
243
; --- 6 ---
239
; dd 0.01565, 0.0
244
; dd 0.01565, 0.0
240
; dd 0.06564, 0.0
245
; dd 0.06564, 0.0
241
; dd 0.016, 0.0
246
; dd 0.016, 0.0
242
; dd 0.016, 0.0
247
; dd 0.016, 0.0
243
; dd 0.02688, 0.0
248
; dd 0.02688, 0.0
244
; dd 0.016, 0.0
249
; dd 0.016, 0.0
245
; dd 0.016, 0.0
250
; dd 0.016, 0.0
246
; dd 0.016, 0.0
251
; dd 0.016, 0.0
247
; dd 0.016, 0.0
252
; dd 0.016, 0.0
248
 
253
 
249
; --- 7 ---
254
; --- 7 ---
250
; dd 0.016, 0.0
255
; dd 0.016, 0.0
251
; dd 0.016, 0.0
256
; dd 0.016, 0.0
252
; dd 0.016, 0.0
257
; dd 0.016, 0.0
253
; dd 0.027, 0.0
258
; dd 0.027, 0.0
254
; dd 0.06369, 0.0
259
; dd 0.06369, 0.0
255
; dd 0.082285714288, -16.9691428598999
260
; dd 0.082285714288, -16.9691428598999
256
; dd 0.016, 0.0
261
; dd 0.016, 0.0
257
; dd 0.016, 0.0
262
; dd 0.016, 0.0
258
; dd 0.016, 0.0
263
; dd 0.016, 0.0
259
 
264
 
260
; --- 8 ---
265
; --- 8 ---
261
; dd 0.01653, 0.0
266
; dd 0.01653, 0.0
262
; dd 0.016, 0.0
267
; dd 0.016, 0.0
263
; dd 0.016, 0.0
268
; dd 0.016, 0.0
264
; dd 0.0265, 0.0
269
; dd 0.0265, 0.0
265
; dd 0.06398, 0.0
270
; dd 0.06398, 0.0
266
; dd 0.0, 0.0
271
; dd 0.0, 0.0
267
; dd 0.0, 0.0
272
; dd 0.0, 0.0
268
; dd 0.016, 0.0
273
; dd 0.016, 0.0
269
; dd 0.016, 0.0
274
; dd 0.016, 0.0
270
 
275
 
271
; --- 9 ---
276
; --- 9 ---
272
; dd 0.016, 0.0
277
; dd 0.016, 0.0
273
; dd 0.01565, 0.0
278
; dd 0.01565, 0.0
274
; dd 0.016, 0.0
279
; dd 0.016, 0.0
275
; dd 0.0265, 0.0
280
; dd 0.0265, 0.0
276
; dd 0.06398, 0.0
281
; dd 0.06398, 0.0
277
; dd 0.09152, -20.592
282
; dd 0.09152, -20.592
278
; dd 0.03728, -8.388
283
; dd 0.03728, -8.388
279
; dd 0.016, 0.0
284
; dd 0.016, 0.0
280
; dd 0.016, 0.0
285
; dd 0.016, 0.0
281
 
286
 
282
; --- 10 ---
287
; --- 10 ---
283
; dd 0.016, 0.0
288
; dd 0.016, 0.0
284
; dd 0.016, 0.0
289
; dd 0.016, 0.0
285
; dd 0.016, 0.0
290
; dd 0.016, 0.0
286
; dd 0.0265, 0.0
291
; dd 0.0265, 0.0
287
; dd 0.06398, 0.0
292
; dd 0.06398, 0.0
288
; dd 0.016, 0.0
293
; dd 0.016, 0.0
289
; dd 0.0512, -9.0112
294
; dd 0.0512, -9.0112
290
; dd 0.0, 0.0
295
; dd 0.0, 0.0
291
; dd 0.0, 0.0
296
; dd 0.0, 0.0
292
 
297
 
293
; --- 11 ---
298
; --- 11 ---
294
; dd 0.016, 0.0
299
; dd 0.016, 0.0
295
; dd 0.0, 0.0
300
; dd 0.0, 0.0
296
; dd 0.016, 0.0
301
; dd 0.016, 0.0
297
; dd 0.016, 0.0
302
; dd 0.016, 0.0
298
; dd 0.06564, 0.0
303
; dd 0.06564, 0.0
299
; dd 0.0, 0.0
304
; dd 0.0, 0.0
300
; dd 0.0, 0.0
305
; dd 0.0, 0.0
301
; dd 0.0, 0.0
306
; dd 0.0, 0.0
302
; dd 0.0, 0.0
307
; dd 0.0, 0.0