Subversion Repositories Kolibri OS

Rev

Rev 205 | Rev 243 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 223
Line 1... Line 1...
1
; Integrated Technology Express
1
; Integrated Technology Express
2
;	Chip	Temp	Volt	Fan
2
;	Chip	Temp	Volt	Fan   ISA   SMBus
3
;	it8705	 3	 8	 3
3
;	it8705	 3	 8	 3     +      +
4
;	it8712	 3	 8	 3
4
;	it8712	 3	 8	 3     +      +
Line 5... Line 5...
5
 
5
 
6
; SiS
6
; SiS
7
;	Chip	Temp	Volt	Fan
7
;	Chip	Temp	Volt	Fan   ISA   SMBus
Line 8... Line 8...
8
;	sis950	 3	 8	 3
8
;	sis950	 3	 8	 3     +      +
9
 
9
 
10
IT87_REGCHIP	equ	0x58
10
IT87_REGCHIP	equ	0x58
11
IT87_CHIPID	equ	0x90
-
 
12
IT87_FANDIV	equ	0x0B
-
 
13
uglobal
-
 
14
it_chip_id	db	0
11
IT87_CHIPID	equ	0x90
15
endg
12
IT87_FANDIV	equ	0x0B
16
it8705		db	15, 'IT8705F/SiS 950'
13
it8705		db	15, 'IT8705F/SiS 950'
17
it8712		db	 7, 'IT8712F'
14
it8712		db	 7, 'IT8712F'
Line 27... Line 24...
27
		dd -0.02408		; -5V
24
		dd -0.02408		; -5V
28
;-----------------------------------
25
;-----------------------------------
29
it87_init:
26
it87_init:
30
; Ïðîâåðêà íàëè÷èÿ è èíèöèàëèçàöèÿ
27
; Ïðîâåðêà íàëè÷èÿ è èíèöèàëèçàöèÿ
31
; OUT - CF = 1 - error
28
; OUT - CF = 1 - error
-
 
29
	cmp	byte[acc_type], 2	; Only ISA and SMBus
-
 
30
	jae	it87_no
32
	;--- Ïðîâåðÿåì IT87* --------
31
	;--- Ïðîâåðÿåì IT87* --------
33
	mov	dx, 0x295
-
 
34
	mov	al, IT87_REGCHIP
32
	mov	al, IT87_REGCHIP
35
	out	dx, al
33
	call	[IO_Read]
36
	inc	edx
-
 
37
	in	al, dx
-
 
38
	cmp	al, IT87_CHIPID
34
	cmp	al, IT87_CHIPID
39
	jne	it87_no		; ýòî íå it87 !!!
35
	jne	it87_no		; ýòî íå it87 !!!
40
	; -~- not tested ~-~-
36
	; -~- not tested ~-~-
41
	dec	edx		; --- óçíà¸ì èäåíòèôèêàòîð ÷èïà --
37
	mov	al, 0x21	; --- óçíà¸ì èäåíòèôèêàòîð ÷èïà --
-
 
38
	call	[IO_Read]
-
 
39
	mov	edx, it8705
42
	mov	al, 0x21
40
	cmp	al, 0x05
-
 
41
	je	@f
-
 
42
	mov	edx, it8712
43
	out	dx, al
43
	cmp	al, 0x12
44
	inc	edx
44
	je	@f
-
 
45
	mov	edx, it8716
45
	in	al, dx
46
	cmp	al, 0x16
-
 
47
	je	@f
-
 
48
	mov	edx, ite_unk
46
	mov	byte[it_chip_id], al
49
@@:	mov	[hwm_chip_name], edx
47
	; -~-~-~-~-~-~-~-~-~-
50
	; -~-~-~-~-~-~-~-~-~-
48
	clc
51
	clc
49
	ret
52
	ret
50
it87_no:stc
53
it87_no:stc
51
	ret
54
	ret
-
 
55
	
-
 
56
;-----------------------------------
-
 
57
it87_getparam:
-
 
58
	call	it87_get_temp
-
 
59
	call	it87_get_fan_speed
-
 
60
	mov	edi, ite_coeff
-
 
61
	call	wb_get_volt
-
 
62
	ret
52
;-----------------------------------
63
;-----------------------------------
53
it87_get_temp:
64
it87_get_temp:
54
	mov	dx, 0x296
-
 
55
	xor	ecx, ecx
65
	xor	ecx, ecx
56
	mov	esi, temps
66
	mov	esi, hwm_temps
57
@@:	dec	edx
-
 
58
	mov	eax, ecx
67
@@:	mov	eax, ecx
59
	add	al, 0x29
68
	add	al, 0x29
60
	out	dx, al
69
	call	[IO_Read]
61
	inc	edx
-
 
62
	in	al, dx
-
 
63
	mov	[esi + ecx * 2], al
70
	mov	[esi + ecx * 2], al
64
	inc	ecx
71
	inc	ecx
65
	cmp	ecx, 3
72
	cmp	ecx, 3
66
	jb	@b
73
	jb	@b
67
	ret
74
	ret
68
;-----------------------------------
75
;-----------------------------------
69
it87_fan_div	db	1, 1, 1
76
it87_fan_div	db	1, 1, 1
70
it87_get_fan_speed:
77
it87_get_fan_speed:
71
; ÷èòàåì äåëèòåëè
78
; ÷èòàåì äåëèòåëè
72
	mov	dx, 0x295
-
 
73
	mov	al, IT87_FANDIV
79
	mov	al, IT87_FANDIV
74
	out	dx, al
80
	call	[IO_Read]
75
	inc	dx
81
 
76
	in	al, dx
-
 
77
	mov	ah, al
82
	mov	ah, al
78
	and	al, 0x07
83
	and	al, 0x07
79
	mov	[it87_fan_div], al
84
	mov	[it87_fan_div], al
80
	shr	ah, 3
85
	shr	ah, 3
81
	and	ah, 0x07
86
	and	ah, 0x07
82
	mov	[it87_fan_div + 1], ah
87
	mov	[it87_fan_div + 1], ah
Line 83... Line 88...
83
	
88
 
84
	xor	ecx, ecx
-
 
85
@@:	mov	dx, 0x295
89
	xor	ecx, ecx
86
	mov	al, 0x0D
90
@@:	mov	al, 0x0D
87
	add	al, cl
91
	add	al, cl
88
	out	dx, al
92
	call	[IO_Read]
89
	inc	edx
-
 
90
	in	al, dx
93
 
91
	movzx	ebx, al
94
	movzx	ebx, al
92
	push	ecx
95
	push	ecx
93
	mov	cl, [it87_fan_div + ecx]
96
	mov	cl, [it87_fan_div + ecx]
94
	shl	ebx, cl
97
	shl	ebx, cl
95
	pop	ecx
98
	pop	ecx
96
	mov	eax, 1350000
99
	mov	eax, 1350000
97
	xor	edx, edx
100
	xor	edx, edx
98
	div	ebx
101
	div	ebx
99
	mov	[rpms + 4 * ecx], eax
102
	mov	[hwm_rpms + 4 * ecx], eax
100
	inc	ecx
103
	inc	ecx
101
	cmp	ecx, 3
104
	cmp	ecx, 3
Line 102... Line 105...
102
	jb	@b
105
	jb	@b
103
 
106
 
104
	ret
-
 
105
;--------------------------------------------------------------------------
-
 
106
it87_get_name:
-
 
107
	mov	edx, it8705
-
 
108
	cmp	byte[it_chip_id], 0x05
-
 
109
	je	@f
-
 
110
	mov	edx, it8712
-
 
111
	cmp	byte[it_chip_id], 0x12
-
 
112
	je	@f
-
 
113
	mov	edx, it8716
-
 
114
	cmp	byte[it_chip_id], 0x16
-
 
115
	je	@f
-