2007-02-02 13:23:31 +03:00
|
|
|
|
;
|
|
|
|
|
; Ghost Monitor - <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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
|
|
|
|
; All Right Reserved
|
|
|
|
|
|
2006-11-28 18:54:36 +03:00
|
|
|
|
;
|
|
|
|
|
; HWM abstract interface, provide:
|
|
|
|
|
; hwm_init, hwm_get_params, hwm_enable, hwm_temps, hwm_rpms, hwm_voltages, hwm_chip_name
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if SMBus eq yes
|
|
|
|
|
include 'SMBus.inc'
|
|
|
|
|
end if
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
include 'hwm_wb.inc'
|
|
|
|
|
include 'hwm_it87.inc'
|
2006-11-28 18:54:36 +03:00
|
|
|
|
include 'hwm_uguru.inc'
|
2012-11-06 03:33:04 +04:00
|
|
|
|
;include 'hwm_hudson.inc'
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
uglobal
|
2006-11-28 18:54:36 +03:00
|
|
|
|
hwm_enable:
|
|
|
|
|
dd 0 ; 0 - no, 1 - Winbond, 2 - ITE, ... see HWMProbe list
|
|
|
|
|
hwm_temps:
|
|
|
|
|
db 0,0, 0,0, 0,0 ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, ...
|
|
|
|
|
hwm_rpms:
|
|
|
|
|
dd 0, 0, 0, 0, 0 ; fan1, fan2, fan3, ...
|
|
|
|
|
hwm_voltages:
|
2006-11-02 17:18:23 +03:00
|
|
|
|
Vcore dd 0.0
|
|
|
|
|
Vin0 dd 0.0
|
|
|
|
|
Vin1 dd 0.0
|
|
|
|
|
AVcc dd 0.0
|
|
|
|
|
Vin2 dd 0.0
|
|
|
|
|
V12 dd 0.0
|
|
|
|
|
V5 dd 0.0
|
2006-11-28 18:54:36 +03:00
|
|
|
|
vol8 dd 0.0
|
|
|
|
|
vol9 dd 0.0
|
|
|
|
|
vol10 dd 0.0
|
|
|
|
|
vol11 dd 0.0
|
|
|
|
|
acc_type db 0 ; 0 - ISA Bus, 1 - SMBus, 2 - other
|
2006-11-02 17:18:23 +03:00
|
|
|
|
endg
|
|
|
|
|
|
2006-11-28 18:54:36 +03:00
|
|
|
|
IO_Read dd isaRead ; In : al - addr, out : al - value
|
|
|
|
|
IO_Write dd isaWrite ; In : al - addr, bl - value
|
|
|
|
|
|
2007-05-18 20:18:24 +04:00
|
|
|
|
hwm_unk db 'Not found', 0
|
2006-11-02 17:18:23 +03:00
|
|
|
|
hwm_chip_name dd hwm_unk
|
|
|
|
|
|
2006-11-28 18:54:36 +03:00
|
|
|
|
; NOTE !!!
|
|
|
|
|
; HWMProbe - <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><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><EFBFBD><EFBFBD>
|
|
|
|
|
; HWMGetParam - <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><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><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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2012-11-06 03:33:04 +04:00
|
|
|
|
HWMProbe:
|
|
|
|
|
dd wb_init
|
2006-11-28 18:54:36 +03:00
|
|
|
|
dd it87_init
|
|
|
|
|
dd uGuru_init
|
2012-11-06 03:33:04 +04:00
|
|
|
|
; dd hudson_init
|
2006-11-28 18:54:36 +03:00
|
|
|
|
dd 0 ; <- <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
|
2012-11-06 03:33:04 +04:00
|
|
|
|
HWMGetParam:
|
|
|
|
|
dd wb_getparam
|
2006-11-28 18:54:36 +03:00
|
|
|
|
dd it87_getparam
|
|
|
|
|
dd uGuru_getparam
|
2012-11-06 03:33:04 +04:00
|
|
|
|
; dd hudson_getparam
|
2006-11-28 18:54:36 +03:00
|
|
|
|
|
|
|
|
|
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
2006-11-02 17:18:23 +03:00
|
|
|
|
hwm_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>
|
|
|
|
|
pusha
|
2006-11-28 18:54:36 +03:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> ISA
|
|
|
|
|
call isaInit
|
|
|
|
|
jc @f
|
|
|
|
|
call chips_probe
|
|
|
|
|
cmp byte[hwm_enable], 0
|
|
|
|
|
jne .exit
|
|
|
|
|
@@: call isaClose
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
2006-11-28 18:54:36 +03:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMBus
|
|
|
|
|
inc byte [acc_type]
|
|
|
|
|
if SMBus eq yes
|
|
|
|
|
call smbInit
|
|
|
|
|
jc @f
|
|
|
|
|
call chips_probe
|
|
|
|
|
cmp byte[hwm_enable], 0
|
|
|
|
|
jne .exit
|
|
|
|
|
@@: call smbClose
|
|
|
|
|
end if
|
|
|
|
|
; <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> (LPC etc)
|
|
|
|
|
inc byte [acc_type]
|
|
|
|
|
call chips_probe
|
|
|
|
|
|
|
|
|
|
.exit: popa
|
|
|
|
|
ret
|
|
|
|
|
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
chips_probe:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
; Out : hwm_enable = !0 if found, else hwm_enable not changed
|
|
|
|
|
cld ; Paranoia
|
|
|
|
|
mov esi, HWMProbe
|
|
|
|
|
@@: lodsd
|
2006-11-02 17:18:23 +03:00
|
|
|
|
test eax, eax
|
2006-11-28 18:54:36 +03:00
|
|
|
|
jz @f ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
call eax
|
|
|
|
|
jc @b
|
|
|
|
|
sub esi, HWMProbe
|
|
|
|
|
shr esi, 2
|
|
|
|
|
mov dword[hwm_enable], esi
|
|
|
|
|
@@: ret
|
|
|
|
|
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
hwm_get_params:
|
|
|
|
|
pusha
|
|
|
|
|
mov eax, [hwm_enable]
|
|
|
|
|
test eax, eax
|
|
|
|
|
jz @f
|
|
|
|
|
dec eax
|
|
|
|
|
sal eax, 2
|
|
|
|
|
call dword[eax + HWMGetParam]
|
|
|
|
|
@@: popa
|
2006-11-02 17:18:23 +03:00
|
|
|
|
ret
|
|
|
|
|
|
2006-11-28 18:54:36 +03:00
|
|
|
|
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
; ISA interface
|
|
|
|
|
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
|
|
|
|
isaRead:
|
|
|
|
|
push edx
|
|
|
|
|
mov dx, 0x295
|
|
|
|
|
out dx, al
|
|
|
|
|
inc edx
|
|
|
|
|
in al, dx
|
|
|
|
|
pop edx
|
|
|
|
|
ret
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
2006-11-28 18:54:36 +03:00
|
|
|
|
isaWrite:
|
|
|
|
|
push edx
|
|
|
|
|
mov dx, 0x295
|
|
|
|
|
out dx, al
|
|
|
|
|
inc edx
|
|
|
|
|
mov al, bl
|
|
|
|
|
out dx, al
|
|
|
|
|
pop edx
|
2006-11-02 17:18:23 +03:00
|
|
|
|
ret
|
2006-11-28 18:54:36 +03:00
|
|
|
|
|
|
|
|
|
isaInit:
|
|
|
|
|
; Out : CF = 0 if Ok
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0x295 <EFBFBD> 0x296 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, 0x295
|
|
|
|
|
mov edx, 0x296
|
|
|
|
|
call ReservePorts
|
|
|
|
|
; jc @f
|
|
|
|
|
; mov [IO_Read], isaRead
|
|
|
|
|
; mov [IO_Write], isaWrite
|
|
|
|
|
; @@:
|
2006-11-02 17:18:23 +03:00
|
|
|
|
ret
|
2006-11-28 18:54:36 +03:00
|
|
|
|
|
|
|
|
|
isaClose:
|
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0x295 <EFBFBD> 0x296 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
mov ecx, 0x295
|
|
|
|
|
mov edx, 0x296
|
|
|
|
|
call FreePorts
|
2006-11-02 17:18:23 +03:00
|
|
|
|
ret
|