Hardware/LPC/LPCGroup.cs
changeset 16 e9abdc6e05af
parent 13 d32fc5f2e822
child 19 890e8fca7f33
     1.1 --- a/Hardware/LPC/LPCGroup.cs	Sun Jan 31 22:00:31 2010 +0000
     1.2 +++ b/Hardware/LPC/LPCGroup.cs	Mon Feb 01 20:16:26 2010 +0000
     1.3 @@ -75,12 +75,6 @@
     1.4        WinRing0.WriteIoPortByte(valuePort, logicalDeviceNumber);
     1.5      }
     1.6  
     1.7 -    // IT87
     1.8 -    private const ushort IT8716F_CHIP_ID = 0x8716;
     1.9 -    private const ushort IT8718F_CHIP_ID = 0x8718;
    1.10 -    private const ushort IT8720F_CHIP_ID = 0x8720;
    1.11 -    private const ushort IT8726F_CHIP_ID = 0x8726;
    1.12 -
    1.13      private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04;    
    1.14  
    1.15      private void IT87Enter() {
    1.16 @@ -100,7 +94,9 @@
    1.17      private const ushort FINTEK_VENDOR_ID = 0x1934;
    1.18  
    1.19      private const byte W83627DHG_HARDWARE_MONITOR_LDN = 0x0B;
    1.20 -    private const byte F71882FG_HARDWARE_MONITOR_LDN = 0x04;
    1.21 +
    1.22 +    private const byte F71858_HARDWARE_MONITOR_LDN = 0x02;
    1.23 +    private const byte FINTEK_HARDWARE_MONITOR_LDN = 0x04;
    1.24  
    1.25      private void WinbondFintekEnter() {
    1.26        WinRing0.WriteIoPortByte(registerPort, 0x87);
    1.27 @@ -121,46 +117,79 @@
    1.28  
    1.29          WinbondFintekEnter();
    1.30  
    1.31 -        byte hardwareMonitorLDN;
    1.32 +        byte logicalDeviceNumber;
    1.33          byte id = ReadByte(CHIP_ID_REGISTER);
    1.34          byte revision = ReadByte(CHIP_REVISION_REGISTER);
    1.35          switch (id) {
    1.36 +          case 0x05:
    1.37 +            switch (revision) {
    1.38 +              case 0x41:
    1.39 +                chip = Chip.F71882;
    1.40 +                logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
    1.41 +                break;
    1.42 +              default:
    1.43 +                chip = Chip.Unknown;
    1.44 +                logicalDeviceNumber = 0;
    1.45 +                break;
    1.46 +            } break;
    1.47 +          case 0x06:
    1.48 +            switch (revision) {             
    1.49 +              case 0x01:
    1.50 +                chip = Chip.F71862;
    1.51 +                logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
    1.52 +                break;
    1.53 +              default:
    1.54 +                chip = Chip.Unknown;
    1.55 +                logicalDeviceNumber = 0;
    1.56 +                break;
    1.57 +            } break;
    1.58 +          case 0x07:
    1.59 +            switch (revision) {
    1.60 +              case 0x23:
    1.61 +                chip = Chip.F71889;
    1.62 +                logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
    1.63 +                break;
    1.64 +              default:
    1.65 +                chip = Chip.Unknown;
    1.66 +                logicalDeviceNumber = 0;
    1.67 +                break;
    1.68 +            } break;
    1.69 +          case 0x08:
    1.70 +            switch (revision) {
    1.71 +              case 0x14:
    1.72 +                chip = Chip.F71869;
    1.73 +                logicalDeviceNumber = FINTEK_HARDWARE_MONITOR_LDN;
    1.74 +                break;
    1.75 +              default:
    1.76 +                chip = Chip.Unknown;
    1.77 +                logicalDeviceNumber = 0;
    1.78 +                break;
    1.79 +            } break;
    1.80            case 0xA0:
    1.81              switch (revision & 0xF0) {
    1.82                case 0x20: 
    1.83                  chip = Chip.W83627DHG;
    1.84 -                hardwareMonitorLDN = W83627DHG_HARDWARE_MONITOR_LDN;  
    1.85 +                logicalDeviceNumber = W83627DHG_HARDWARE_MONITOR_LDN;  
    1.86                  break;
    1.87                default: 
    1.88                  chip = Chip.Unknown;
    1.89 -                hardwareMonitorLDN = 0;
    1.90 +                logicalDeviceNumber = 0;
    1.91                  break;
    1.92 -            } break;
    1.93 -          case 0x05:
    1.94 -            switch (revision) {
    1.95 -              case 0x41: 
    1.96 -                chip = Chip.F71882FG;
    1.97 -                hardwareMonitorLDN = F71882FG_HARDWARE_MONITOR_LDN; 
    1.98 -                break;
    1.99 -              default: 
   1.100 -                chip = Chip.Unknown; 
   1.101 -                hardwareMonitorLDN = 0;
   1.102 -                break;
   1.103 -            } break;
   1.104 +            } break;          
   1.105            default:
   1.106              chip = Chip.Unknown; 
   1.107 -            hardwareMonitorLDN = 0;
   1.108 +            logicalDeviceNumber = 0;
   1.109              break;
   1.110          }
   1.111          if (chip != Chip.Unknown) {
   1.112  
   1.113 -          Select(hardwareMonitorLDN);
   1.114 +          Select(logicalDeviceNumber);
   1.115            ushort address = ReadWord(BASE_ADDRESS_REGISTER);
   1.116            Thread.Sleep(1);
   1.117            ushort verify = ReadWord(BASE_ADDRESS_REGISTER);
   1.118  
   1.119            ushort vendorID = 0;
   1.120 -          if (chip == Chip.F71882FG)
   1.121 +          if (chip == Chip.F71862 || chip == Chip.F71882 || chip == Chip.F71889)
   1.122              vendorID = ReadWord(FINTEK_VENDOR_ID_REGISTER);
   1.123  
   1.124            WinbondFintekExit();
   1.125 @@ -174,9 +203,14 @@
   1.126                if (w83627dhg.IsAvailable)
   1.127                  hardware.Add(w83627dhg);
   1.128                break;
   1.129 -            case Chip.F71882FG:  
   1.130 +            case Chip.F71862:
   1.131 +            case Chip.F71882:
   1.132 +            case Chip.F71889: 
   1.133                if (vendorID == FINTEK_VENDOR_ID)
   1.134 -                hardware.Add(new F71882(address));
   1.135 +                hardware.Add(new F718XX(chip, address));
   1.136 +              break;
   1.137 +            case Chip.F71869:
   1.138 +              hardware.Add(new F718XX(chip, address));
   1.139                break;
   1.140              default: break;
   1.141            }
   1.142 @@ -187,10 +221,10 @@
   1.143          IT87Enter();
   1.144  
   1.145          switch (ReadWord(CHIP_ID_REGISTER)) {
   1.146 -          case 0x8716: chip = Chip.IT8716F; break;
   1.147 -          case 0x8718: chip = Chip.IT8718F; break;
   1.148 -          case 0x8720: chip = Chip.IT8720F; break;
   1.149 -          case 0x8726: chip = Chip.IT8726F; break;
   1.150 +          case 0x8716: chip = Chip.IT8716; break;
   1.151 +          case 0x8718: chip = Chip.IT8718; break;
   1.152 +          case 0x8720: chip = Chip.IT8720; break;
   1.153 +          case 0x8726: chip = Chip.IT8726; break;
   1.154            default: chip = Chip.Unknown; break;
   1.155          }
   1.156  
   1.157 @@ -205,7 +239,7 @@
   1.158            if (address != verify || address == 0 || (address & 0xF007) != 0)
   1.159              return;
   1.160  
   1.161 -          IT87 it87 = new IT87(chip, address);
   1.162 +          IT87XX it87 = new IT87XX(chip, address);
   1.163            if (it87.IsAvailable)
   1.164              hardware.Add(it87);
   1.165