Rev 205 | Rev 243 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
205 | heavyiron | 1 | ; Integrated Technology Express |
223 | Ghost | 2 | ; Chip Temp Volt Fan ISA SMBus |
3 | ; it8705 3 8 3 + + |
||
4 | ; it8712 3 8 3 + + |
||
205 | heavyiron | 5 | |
6 | ; SiS |
||
223 | Ghost | 7 | ; Chip Temp Volt Fan ISA SMBus |
8 | ; sis950 3 8 3 + + |
||
205 | heavyiron | 9 | |
10 | IT87_REGCHIP equ 0x58 |
||
11 | IT87_CHIPID equ 0x90 |
||
12 | IT87_FANDIV equ 0x0B |
||
13 | it8705 db 15, 'IT8705F/SiS 950' |
||
14 | it8712 db 7, 'IT8712F' |
||
15 | it8716 db 7, 'IT8716F' |
||
16 | ite_unk db 11, 'Unknown ITE' |
||
17 | |||
18 | ite_coeff: dd 0.016 ; Vcore |
||
19 | dd 0.016 ; Vin0 |
||
20 | dd 0.016 ; Vin1 (+3.3V) |
||
21 | dd 0.02688 ; AVcc (+5V) |
||
22 | dd 0.0608 ; Vin2 (+12V) |
||
23 | dd -0.055632 ; -12V |
||
24 | dd -0.02408 ; -5V |
||
25 | ;----------------------------------- |
||
26 | it87_init: |
||
27 | ; Проверка наличия и инициализация |
||
28 | ; OUT - CF = 1 - error |
||
223 | Ghost | 29 | cmp byte[acc_type], 2 ; Only ISA and SMBus |
30 | jae it87_no |
||
205 | heavyiron | 31 | ;--- Проверяем IT87* -------- |
32 | mov al, IT87_REGCHIP |
||
223 | Ghost | 33 | call [IO_Read] |
205 | heavyiron | 34 | cmp al, IT87_CHIPID |
35 | jne it87_no ; это не it87 !!! |
||
36 | ; -~- not tested ~-~- |
||
223 | Ghost | 37 | mov al, 0x21 ; --- узнаём идентификатор чипа -- |
38 | call [IO_Read] |
||
39 | mov edx, it8705 |
||
40 | cmp al, 0x05 |
||
41 | je @f |
||
42 | mov edx, it8712 |
||
43 | cmp al, 0x12 |
||
44 | je @f |
||
45 | mov edx, it8716 |
||
46 | cmp al, 0x16 |
||
47 | je @f |
||
48 | mov edx, ite_unk |
||
49 | @@: mov [hwm_chip_name], edx |
||
205 | heavyiron | 50 | ; -~-~-~-~-~-~-~-~-~- |
51 | clc |
||
52 | ret |
||
53 | it87_no:stc |
||
54 | ret |
||
223 | Ghost | 55 | |
205 | heavyiron | 56 | ;----------------------------------- |
223 | Ghost | 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 |
||
63 | ;----------------------------------- |
||
205 | heavyiron | 64 | it87_get_temp: |
65 | xor ecx, ecx |
||
223 | Ghost | 66 | mov esi, hwm_temps |
67 | @@: mov eax, ecx |
||
205 | heavyiron | 68 | add al, 0x29 |
223 | Ghost | 69 | call [IO_Read] |
205 | heavyiron | 70 | mov [esi + ecx * 2], al |
71 | inc ecx |
||
72 | cmp ecx, 3 |
||
73 | jb @b |
||
74 | ret |
||
75 | ;----------------------------------- |
||
76 | it87_fan_div db 1, 1, 1 |
||
77 | it87_get_fan_speed: |
||
78 | ; читаем делители |
||
79 | mov al, IT87_FANDIV |
||
223 | Ghost | 80 | call [IO_Read] |
81 | |||
205 | heavyiron | 82 | mov ah, al |
83 | and al, 0x07 |
||
84 | mov [it87_fan_div], al |
||
85 | shr ah, 3 |
||
86 | and ah, 0x07 |
||
87 | mov [it87_fan_div + 1], ah |
||
223 | Ghost | 88 | |
205 | heavyiron | 89 | xor ecx, ecx |
223 | Ghost | 90 | @@: mov al, 0x0D |
205 | heavyiron | 91 | add al, cl |
223 | Ghost | 92 | call [IO_Read] |
93 | |||
205 | heavyiron | 94 | movzx ebx, al |
95 | push ecx |
||
96 | mov cl, [it87_fan_div + ecx] |
||
97 | shl ebx, cl |
||
98 | pop ecx |
||
99 | mov eax, 1350000 |
||
100 | xor edx, edx |
||
101 | div ebx |
||
223 | Ghost | 102 | mov [hwm_rpms + 4 * ecx], eax |
205 | heavyiron | 103 | inc ecx |
104 | cmp ecx, 3 |
||
105 | jb @b |
||
106 | |||
107 | ret |
||
108 | ;-------------------------------------------------------------------------- |