2006-11-02 15:18:23 +01:00
|
|
|
|
; Integrated Technology Express
|
2006-11-28 16:54:36 +01:00
|
|
|
|
; Chip Temp Volt Fan ISA SMBus
|
|
|
|
|
; it8705 3 8 3 + +
|
|
|
|
|
; it8712 3 8 3 + +
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
|
|
|
|
; SiS
|
2006-11-28 16:54:36 +01:00
|
|
|
|
; Chip Temp Volt Fan ISA SMBus
|
|
|
|
|
; sis950 3 8 3 + +
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
|
|
|
|
IT87_REGCHIP equ 0x58
|
|
|
|
|
IT87_CHIPID equ 0x90
|
|
|
|
|
IT87_FANDIV equ 0x0B
|
|
|
|
|
it8705 db 15, 'IT8705F/SiS 950'
|
|
|
|
|
it8712 db 7, 'IT8712F'
|
|
|
|
|
it8716 db 7, 'IT8716F'
|
|
|
|
|
ite_unk db 11, 'Unknown ITE'
|
|
|
|
|
|
|
|
|
|
ite_coeff: dd 0.016 ; Vcore
|
|
|
|
|
dd 0.016 ; Vin0
|
|
|
|
|
dd 0.016 ; Vin1 (+3.3V)
|
|
|
|
|
dd 0.02688 ; AVcc (+5V)
|
|
|
|
|
dd 0.0608 ; Vin2 (+12V)
|
|
|
|
|
dd -0.055632 ; -12V
|
|
|
|
|
dd -0.02408 ; -5V
|
|
|
|
|
;-----------------------------------
|
|
|
|
|
it87_init:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; OUT - CF = 1 - error
|
2006-11-28 16:54:36 +01:00
|
|
|
|
cmp byte[acc_type], 2 ; Only ISA and SMBus
|
|
|
|
|
jae it87_no
|
2006-11-02 15:18:23 +01:00
|
|
|
|
;--- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> IT87* --------
|
|
|
|
|
mov al, IT87_REGCHIP
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
cmp al, IT87_CHIPID
|
|
|
|
|
jne it87_no ; <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> it87 !!!
|
|
|
|
|
; -~- not tested ~-~-
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov al, 0x21 ; --- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> --
|
|
|
|
|
call [IO_Read]
|
|
|
|
|
mov edx, it8705
|
|
|
|
|
cmp al, 0x05
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, it8712
|
|
|
|
|
cmp al, 0x12
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, it8716
|
|
|
|
|
cmp al, 0x16
|
|
|
|
|
je @f
|
|
|
|
|
mov edx, ite_unk
|
|
|
|
|
@@: mov [hwm_chip_name], edx
|
2006-11-02 15:18:23 +01:00
|
|
|
|
; -~-~-~-~-~-~-~-~-~-
|
|
|
|
|
clc
|
|
|
|
|
ret
|
|
|
|
|
it87_no:stc
|
|
|
|
|
ret
|
2006-11-28 16:54:36 +01:00
|
|
|
|
|
|
|
|
|
;-----------------------------------
|
|
|
|
|
it87_getparam:
|
|
|
|
|
call it87_get_temp
|
|
|
|
|
call it87_get_fan_speed
|
|
|
|
|
mov edi, ite_coeff
|
|
|
|
|
call wb_get_volt
|
|
|
|
|
ret
|
2006-11-02 15:18:23 +01:00
|
|
|
|
;-----------------------------------
|
|
|
|
|
it87_get_temp:
|
|
|
|
|
xor ecx, ecx
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov esi, hwm_temps
|
|
|
|
|
@@: mov eax, ecx
|
2006-11-02 15:18:23 +01:00
|
|
|
|
add al, 0x29
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov [esi + ecx * 2], al
|
|
|
|
|
inc ecx
|
|
|
|
|
cmp ecx, 3
|
|
|
|
|
jb @b
|
|
|
|
|
ret
|
|
|
|
|
;-----------------------------------
|
|
|
|
|
it87_fan_div db 1, 1, 1
|
|
|
|
|
it87_get_fan_speed:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov al, IT87_FANDIV
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
mov ah, al
|
|
|
|
|
and al, 0x07
|
|
|
|
|
mov [it87_fan_div], al
|
|
|
|
|
shr ah, 3
|
|
|
|
|
and ah, 0x07
|
|
|
|
|
mov [it87_fan_div + 1], ah
|
2006-11-28 16:54:36 +01:00
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
xor ecx, ecx
|
2006-11-28 16:54:36 +01:00
|
|
|
|
@@: mov al, 0x0D
|
2006-11-02 15:18:23 +01:00
|
|
|
|
add al, cl
|
2006-11-28 16:54:36 +01:00
|
|
|
|
call [IO_Read]
|
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
movzx ebx, al
|
|
|
|
|
push ecx
|
|
|
|
|
mov cl, [it87_fan_div + ecx]
|
|
|
|
|
shl ebx, cl
|
|
|
|
|
pop ecx
|
|
|
|
|
mov eax, 1350000
|
|
|
|
|
xor edx, edx
|
|
|
|
|
div ebx
|
2006-11-28 16:54:36 +01:00
|
|
|
|
mov [hwm_rpms + 4 * ecx], eax
|
2006-11-02 15:18:23 +01:00
|
|
|
|
inc ecx
|
|
|
|
|
cmp ecx, 3
|
|
|
|
|
jb @b
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
;--------------------------------------------------------------------------
|