Added support for Winbond W83687THF and improved report output for LPC detection.
authormoel.mich
Mon, 01 Mar 2010 22:12:29 +0000
changeset 67bb5696abab23
parent 66 2b537d442924
child 68 d706e16a79c0
Added support for Winbond W83687THF and improved report output for LPC detection.
Hardware/LPC/Chip.cs
Hardware/LPC/LPCGroup.cs
Hardware/LPC/LPCHardware.cs
Hardware/LPC/W836XX.cs
Hardware/Mainboard/Mainboard.cs
Properties/AssemblyInfo.cs
     1.1 --- a/Hardware/LPC/Chip.cs	Sun Feb 28 16:12:55 2010 +0000
     1.2 +++ b/Hardware/LPC/Chip.cs	Mon Mar 01 22:12:29 2010 +0000
     1.3 @@ -18,6 +18,7 @@
     1.4      W83627THF = 0x8283,
     1.5      W83667HG = 0xA510,
     1.6      W83667HGB = 0xB350,
     1.7 +    W83687THF = 0x8541,
     1.8      F71862 = 0x0601, 
     1.9      F71869 = 0x0814,
    1.10      F71882 = 0x0541,
     2.1 --- a/Hardware/LPC/LPCGroup.cs	Sun Feb 28 16:12:55 2010 +0000
     2.2 +++ b/Hardware/LPC/LPCGroup.cs	Mon Mar 01 22:12:29 2010 +0000
     2.3 @@ -42,7 +42,9 @@
     2.4  
     2.5  namespace OpenHardwareMonitor.Hardware.LPC {
     2.6    public class LPCGroup : IGroup {
     2.7 +
     2.8      private List<IHardware> hardware = new List<IHardware>();
     2.9 +    private StringBuilder report = new StringBuilder();
    2.10  
    2.11      private Chip chip = Chip.Unknown;
    2.12  
    2.13 @@ -108,6 +110,15 @@
    2.14        WinRing0.WriteIoPortByte(registerPort, 0xAA);      
    2.15      }
    2.16  
    2.17 +    // SMSC
    2.18 +    private void SMSCEnter() {
    2.19 +      WinRing0.WriteIoPortByte(registerPort, 0x55);
    2.20 +    }
    2.21 +
    2.22 +    private void SMSCExit() {
    2.23 +      WinRing0.WriteIoPortByte(registerPort, 0xAA);
    2.24 +    }
    2.25 +
    2.26      public LPCGroup() {
    2.27        if (!WinRing0.IsAvailable)
    2.28          return;
    2.29 @@ -167,6 +178,13 @@
    2.30                  logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN;
    2.31                  break;
    2.32              } break;
    2.33 +          case 0x85:
    2.34 +            switch (revision) {
    2.35 +              case 0x41:
    2.36 +                chip = Chip.W83687THF;
    2.37 +                logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN;
    2.38 +                break;
    2.39 +            } break;
    2.40            case 0x88:
    2.41              switch (revision & 0xF0) {
    2.42                case 0x60:
    2.43 @@ -203,7 +221,15 @@
    2.44                  break;
    2.45              } break; 
    2.46          }
    2.47 -        if (chip != Chip.Unknown) {
    2.48 +        if (chip == Chip.Unknown) {
    2.49 +          if (id != 0 && id != 0xff) {
    2.50 +            WinbondFintekExit();
    2.51 +
    2.52 +            report.Append("Chip ID: Unknown Winbond / Fintek with ID 0x"); 
    2.53 +            report.AppendLine(((id << 8) | revision).ToString("X"));
    2.54 +            report.AppendLine();
    2.55 +          }
    2.56 +        } else {
    2.57  
    2.58            Select(logicalDeviceNumber);
    2.59            ushort address = ReadWord(BASE_ADDRESS_REGISTER);          
    2.60 @@ -216,16 +242,31 @@
    2.61  
    2.62            WinbondFintekExit();
    2.63  
    2.64 -          if (address != verify)
    2.65 +          if (address != verify) {            
    2.66 +            report.Append("Chip ID: 0x"); 
    2.67 +            report.AppendLine(chip.ToString("X"));
    2.68 +            report.Append("Chip revision: 0x"); 
    2.69 +            report.AppendLine(revision.ToString("X"));
    2.70 +            report.AppendLine("Error: Address verification failed");
    2.71 +            report.AppendLine();
    2.72              return;
    2.73 +          }
    2.74  
    2.75            // some Fintek chips have address register offset 0x05 added already
    2.76            if ((address & 0x07) == 0x05)
    2.77              address &= 0xFFF8;
    2.78  
    2.79 -          if (address < 0x100 || (address & 0xF007) != 0)
    2.80 +          if (address < 0x100 || (address & 0xF007) != 0) {            
    2.81 +            report.Append("Chip ID: 0x");
    2.82 +            report.AppendLine(chip.ToString("X"));
    2.83 +            report.Append("Chip revision: 0x");
    2.84 +            report.AppendLine(revision.ToString("X"));
    2.85 +            report.Append("Error: Invalid address 0x");
    2.86 +            report.AppendLine(address.ToString("X"));
    2.87 +            report.AppendLine();
    2.88              return;
    2.89 -          
    2.90 +          }
    2.91 +
    2.92            switch (chip) {
    2.93              case Chip.W83627DHG:
    2.94              case Chip.W83627DHGP:
    2.95 @@ -234,6 +275,7 @@
    2.96              case Chip.W83627THF:
    2.97              case Chip.W83667HG:
    2.98              case Chip.W83667HGB:
    2.99 +            case Chip.W83687THF:
   2.100                W836XX w836XX = new W836XX(chip, revision, address);
   2.101                if (w836XX.IsAvailable)
   2.102                  hardware.Add(w836XX);
   2.103 @@ -255,15 +297,23 @@
   2.104  
   2.105          IT87Enter();
   2.106  
   2.107 -        switch (ReadWord(CHIP_ID_REGISTER)) {
   2.108 +        ushort chipID = ReadWord(CHIP_ID_REGISTER);
   2.109 +        switch (chipID) {
   2.110            case 0x8716: chip = Chip.IT8716F; break;
   2.111            case 0x8718: chip = Chip.IT8718F; break;
   2.112            case 0x8720: chip = Chip.IT8720F; break;
   2.113 -          case 0x8726: chip = Chip.IT8726F; break;
   2.114 +          case 0x8726: chip = Chip.IT8726F; break; 
   2.115            default: chip = Chip.Unknown; break;
   2.116          }
   2.117 +        if (chip == Chip.Unknown) {
   2.118 +          if (chipID != 0 && chipID != 0xffff) {
   2.119 +            IT87Exit();
   2.120  
   2.121 -        if (chip != Chip.Unknown) {
   2.122 +            report.Append("Chip ID: Unknown ITE with ID 0x");
   2.123 +            report.AppendLine(chipID.ToString("X"));
   2.124 +            report.AppendLine();
   2.125 +          }
   2.126 +        } else {
   2.127            Select(IT87_ENVIRONMENT_CONTROLLER_LDN);
   2.128            ushort address = ReadWord(BASE_ADDRESS_REGISTER);
   2.129            Thread.Sleep(1);
   2.130 @@ -271,8 +321,14 @@
   2.131  
   2.132            IT87Exit();
   2.133  
   2.134 -          if (address != verify || address < 0x100 || (address & 0xF007) != 0)
   2.135 +          if (address != verify || address < 0x100 || (address & 0xF007) != 0) {
   2.136 +            report.Append("Chip ID: 0x");
   2.137 +            report.AppendLine(chip.ToString("X"));            
   2.138 +            report.Append("Error: Invalid address 0x");
   2.139 +            report.AppendLine(address.ToString("X"));
   2.140 +            report.AppendLine();
   2.141              return;
   2.142 +          }
   2.143  
   2.144            IT87XX it87 = new IT87XX(chip, address);
   2.145            if (it87.IsAvailable)
   2.146 @@ -280,6 +336,26 @@
   2.147  
   2.148            return;
   2.149          }
   2.150 +
   2.151 +        SMSCEnter();
   2.152 +
   2.153 +        chipID = ReadWord(CHIP_ID_REGISTER);
   2.154 +        switch (chipID) {
   2.155 +          default: chip = Chip.Unknown; break;
   2.156 +        }
   2.157 +        if (chip == Chip.Unknown) {
   2.158 +          if (chipID != 0 && chipID != 0xffff) {
   2.159 +            SMSCExit();
   2.160 +
   2.161 +            report.Append("Chip ID: Unknown SMSC with ID 0x");
   2.162 +            report.AppendLine(chipID.ToString("X"));
   2.163 +            report.AppendLine();
   2.164 +          }
   2.165 +        } else {
   2.166 +          SMSCExit();
   2.167 +
   2.168 +          return;
   2.169 +        }
   2.170        }   
   2.171      }
   2.172  
   2.173 @@ -290,7 +366,12 @@
   2.174      }
   2.175  
   2.176      public string GetReport() {
   2.177 -      return null;
   2.178 +      if (report.Length > 0) {
   2.179 +        report.Insert(0, "LPCIO" + Environment.NewLine +
   2.180 +          Environment.NewLine);        
   2.181 +        return report.ToString();
   2.182 +      } else
   2.183 +        return null;
   2.184      }
   2.185  
   2.186      public void Close() { }
     3.1 --- a/Hardware/LPC/LPCHardware.cs	Sun Feb 28 16:12:55 2010 +0000
     3.2 +++ b/Hardware/LPC/LPCHardware.cs	Mon Mar 01 22:12:29 2010 +0000
     3.3 @@ -66,6 +66,7 @@
     3.4          case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
     3.5          case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
     3.6          case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
     3.7 +        case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
     3.8        }
     3.9      }
    3.10  
     4.1 --- a/Hardware/LPC/W836XX.cs	Sun Feb 28 16:12:55 2010 +0000
     4.2 +++ b/Hardware/LPC/W836XX.cs	Mon Mar 01 22:12:29 2010 +0000
     4.3 @@ -167,6 +167,7 @@
     4.4            break;
     4.5          case Chip.W83627HF:
     4.6          case Chip.W83627THF:
     4.7 +        case Chip.W83687THF:
     4.8            fanNames = new string[] { "System", "CPU", "Auxiliary" };
     4.9            voltageGains = new float[] { 2, 1, 2, 1, 1, 1, 1, 2 };
    4.10            voltages = new Sensor[3];
    4.11 @@ -199,7 +200,9 @@
    4.12        foreach (Sensor sensor in voltages) {
    4.13          if (sensor.Index < 7) {
    4.14            // two special VCore measurement modes for W83627THF
    4.15 -          if (chip == Chip.W83627THF && sensor.Index == 0) {
    4.16 +          if ((chip == Chip.W83627HF || chip == Chip.W83627THF || 
    4.17 +            chip == Chip.W83687THF) && sensor.Index == 0) 
    4.18 +          {
    4.19              byte vrmConfiguration = ReadByte(0, 0x18);
    4.20              int value = ReadByte(0, VOLTAGE_BASE_REG);
    4.21              if ((vrmConfiguration & 0x01) == 0)
     5.1 --- a/Hardware/Mainboard/Mainboard.cs	Sun Feb 28 16:12:55 2010 +0000
     5.2 +++ b/Hardware/Mainboard/Mainboard.cs	Mon Mar 01 22:12:29 2010 +0000
     5.3 @@ -84,6 +84,8 @@
     5.4        r.AppendLine();           
     5.5        r.Append(smbios.GetReport());
     5.6  
     5.7 +      r.Append(lpcGroup.GetReport());
     5.8 +
     5.9        return r.ToString();
    5.10      }
    5.11  
     6.1 --- a/Properties/AssemblyInfo.cs	Sun Feb 28 16:12:55 2010 +0000
     6.2 +++ b/Properties/AssemblyInfo.cs	Mon Mar 01 22:12:29 2010 +0000
     6.3 @@ -69,5 +69,5 @@
     6.4  // You can specify all the values or you can default the Build and Revision Numbers 
     6.5  // by using the '*' as shown below:
     6.6  // [assembly: AssemblyVersion("1.0.*")]
     6.7 -[assembly: AssemblyVersion("0.1.24.1")]
     6.8 -[assembly: AssemblyFileVersion("0.1.24.1")]
     6.9 +[assembly: AssemblyVersion("0.1.24.3")]
    6.10 +[assembly: AssemblyFileVersion("0.1.24.3")]