Subversion Repositories Kolibri OS

Rev

Rev 205 | Rev 250 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ; Integrated Technology Express
  2. ;       Chip    Temp    Volt    Fan   ISA   SMBus
  3. ;       it8705   3       8       3     +      +
  4. ;       it8712   3       8       3     +      +
  5.  
  6. ; SiS
  7. ;       Chip    Temp    Volt    Fan   ISA   SMBus
  8. ;       sis950   3       8       3     +      +
  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
  29.         cmp     byte[acc_type], 2       ; Only ISA and SMBus
  30.         jae     it87_no
  31.         ;--- Ïðîâåðÿåì IT87* --------
  32.         mov     al, IT87_REGCHIP
  33.         call    [IO_Read]
  34.         cmp     al, IT87_CHIPID
  35.         jne     it87_no         ; ýòî íå it87 !!!
  36.         ; -~- not tested ~-~-
  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
  50.         ; -~-~-~-~-~-~-~-~-~-
  51.         clc
  52.         ret
  53. it87_no:stc
  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
  63. ;-----------------------------------
  64. it87_get_temp:
  65.         xor     ecx, ecx
  66.         mov     esi, hwm_temps
  67. @@:     mov     eax, ecx
  68.         add     al, 0x29
  69.         call    [IO_Read]
  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
  80.         call    [IO_Read]
  81.  
  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
  88.  
  89.         xor     ecx, ecx
  90. @@:     mov     al, 0x0D
  91.         add     al, cl
  92.         call    [IO_Read]
  93.  
  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
  102.         mov     [hwm_rpms + 4 * ecx], eax
  103.         inc     ecx
  104.         cmp     ecx, 3
  105.         jb      @b
  106.  
  107.         ret
  108. ;--------------------------------------------------------------------------
  109.