Added support for Winbond W83687THF and improved report output for LPC detection.

This commit is contained in:
Michael Möller
2010-03-01 22:12:29 +00:00
parent cebd4a79c9
commit b839e338d6
6 changed files with 100 additions and 12 deletions

View File

@@ -18,6 +18,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
W83627THF = 0x8283, W83627THF = 0x8283,
W83667HG = 0xA510, W83667HG = 0xA510,
W83667HGB = 0xB350, W83667HGB = 0xB350,
W83687THF = 0x8541,
F71862 = 0x0601, F71862 = 0x0601,
F71869 = 0x0814, F71869 = 0x0814,
F71882 = 0x0541, F71882 = 0x0541,

View File

@@ -42,7 +42,9 @@ using System.Threading;
namespace OpenHardwareMonitor.Hardware.LPC { namespace OpenHardwareMonitor.Hardware.LPC {
public class LPCGroup : IGroup { public class LPCGroup : IGroup {
private List<IHardware> hardware = new List<IHardware>(); private List<IHardware> hardware = new List<IHardware>();
private StringBuilder report = new StringBuilder();
private Chip chip = Chip.Unknown; private Chip chip = Chip.Unknown;
@@ -108,6 +110,15 @@ namespace OpenHardwareMonitor.Hardware.LPC {
WinRing0.WriteIoPortByte(registerPort, 0xAA); WinRing0.WriteIoPortByte(registerPort, 0xAA);
} }
// SMSC
private void SMSCEnter() {
WinRing0.WriteIoPortByte(registerPort, 0x55);
}
private void SMSCExit() {
WinRing0.WriteIoPortByte(registerPort, 0xAA);
}
public LPCGroup() { public LPCGroup() {
if (!WinRing0.IsAvailable) if (!WinRing0.IsAvailable)
return; return;
@@ -167,6 +178,13 @@ namespace OpenHardwareMonitor.Hardware.LPC {
logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN; logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN;
break; break;
} break; } break;
case 0x85:
switch (revision) {
case 0x41:
chip = Chip.W83687THF;
logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN;
break;
} break;
case 0x88: case 0x88:
switch (revision & 0xF0) { switch (revision & 0xF0) {
case 0x60: case 0x60:
@@ -203,7 +221,15 @@ namespace OpenHardwareMonitor.Hardware.LPC {
break; break;
} break; } break;
} }
if (chip != Chip.Unknown) { if (chip == Chip.Unknown) {
if (id != 0 && id != 0xff) {
WinbondFintekExit();
report.Append("Chip ID: Unknown Winbond / Fintek with ID 0x");
report.AppendLine(((id << 8) | revision).ToString("X"));
report.AppendLine();
}
} else {
Select(logicalDeviceNumber); Select(logicalDeviceNumber);
ushort address = ReadWord(BASE_ADDRESS_REGISTER); ushort address = ReadWord(BASE_ADDRESS_REGISTER);
@@ -216,16 +242,31 @@ namespace OpenHardwareMonitor.Hardware.LPC {
WinbondFintekExit(); WinbondFintekExit();
if (address != verify) if (address != verify) {
report.Append("Chip ID: 0x");
report.AppendLine(chip.ToString("X"));
report.Append("Chip revision: 0x");
report.AppendLine(revision.ToString("X"));
report.AppendLine("Error: Address verification failed");
report.AppendLine();
return; return;
}
// some Fintek chips have address register offset 0x05 added already // some Fintek chips have address register offset 0x05 added already
if ((address & 0x07) == 0x05) if ((address & 0x07) == 0x05)
address &= 0xFFF8; address &= 0xFFF8;
if (address < 0x100 || (address & 0xF007) != 0) if (address < 0x100 || (address & 0xF007) != 0) {
report.Append("Chip ID: 0x");
report.AppendLine(chip.ToString("X"));
report.Append("Chip revision: 0x");
report.AppendLine(revision.ToString("X"));
report.Append("Error: Invalid address 0x");
report.AppendLine(address.ToString("X"));
report.AppendLine();
return; return;
}
switch (chip) { switch (chip) {
case Chip.W83627DHG: case Chip.W83627DHG:
case Chip.W83627DHGP: case Chip.W83627DHGP:
@@ -234,6 +275,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
case Chip.W83627THF: case Chip.W83627THF:
case Chip.W83667HG: case Chip.W83667HG:
case Chip.W83667HGB: case Chip.W83667HGB:
case Chip.W83687THF:
W836XX w836XX = new W836XX(chip, revision, address); W836XX w836XX = new W836XX(chip, revision, address);
if (w836XX.IsAvailable) if (w836XX.IsAvailable)
hardware.Add(w836XX); hardware.Add(w836XX);
@@ -255,15 +297,23 @@ namespace OpenHardwareMonitor.Hardware.LPC {
IT87Enter(); IT87Enter();
switch (ReadWord(CHIP_ID_REGISTER)) { ushort chipID = ReadWord(CHIP_ID_REGISTER);
switch (chipID) {
case 0x8716: chip = Chip.IT8716F; break; case 0x8716: chip = Chip.IT8716F; break;
case 0x8718: chip = Chip.IT8718F; break; case 0x8718: chip = Chip.IT8718F; break;
case 0x8720: chip = Chip.IT8720F; break; case 0x8720: chip = Chip.IT8720F; break;
case 0x8726: chip = Chip.IT8726F; break; case 0x8726: chip = Chip.IT8726F; break;
default: chip = Chip.Unknown; break; default: chip = Chip.Unknown; break;
} }
if (chip == Chip.Unknown) {
if (chipID != 0 && chipID != 0xffff) {
IT87Exit();
if (chip != Chip.Unknown) { report.Append("Chip ID: Unknown ITE with ID 0x");
report.AppendLine(chipID.ToString("X"));
report.AppendLine();
}
} else {
Select(IT87_ENVIRONMENT_CONTROLLER_LDN); Select(IT87_ENVIRONMENT_CONTROLLER_LDN);
ushort address = ReadWord(BASE_ADDRESS_REGISTER); ushort address = ReadWord(BASE_ADDRESS_REGISTER);
Thread.Sleep(1); Thread.Sleep(1);
@@ -271,8 +321,14 @@ namespace OpenHardwareMonitor.Hardware.LPC {
IT87Exit(); IT87Exit();
if (address != verify || address < 0x100 || (address & 0xF007) != 0) if (address != verify || address < 0x100 || (address & 0xF007) != 0) {
report.Append("Chip ID: 0x");
report.AppendLine(chip.ToString("X"));
report.Append("Error: Invalid address 0x");
report.AppendLine(address.ToString("X"));
report.AppendLine();
return; return;
}
IT87XX it87 = new IT87XX(chip, address); IT87XX it87 = new IT87XX(chip, address);
if (it87.IsAvailable) if (it87.IsAvailable)
@@ -280,6 +336,26 @@ namespace OpenHardwareMonitor.Hardware.LPC {
return; return;
} }
SMSCEnter();
chipID = ReadWord(CHIP_ID_REGISTER);
switch (chipID) {
default: chip = Chip.Unknown; break;
}
if (chip == Chip.Unknown) {
if (chipID != 0 && chipID != 0xffff) {
SMSCExit();
report.Append("Chip ID: Unknown SMSC with ID 0x");
report.AppendLine(chipID.ToString("X"));
report.AppendLine();
}
} else {
SMSCExit();
return;
}
} }
} }
@@ -290,7 +366,12 @@ namespace OpenHardwareMonitor.Hardware.LPC {
} }
public string GetReport() { public string GetReport() {
return null; if (report.Length > 0) {
report.Insert(0, "LPCIO" + Environment.NewLine +
Environment.NewLine);
return report.ToString();
} else
return null;
} }
public void Close() { } public void Close() { }

View File

@@ -66,6 +66,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
case Chip.W83627THF: this.name = "Winbond W83627THF"; break; case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
case Chip.W83667HG: this.name = "Winbond W83667HG"; break; case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break; case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
} }
} }

View File

@@ -167,6 +167,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
break; break;
case Chip.W83627HF: case Chip.W83627HF:
case Chip.W83627THF: case Chip.W83627THF:
case Chip.W83687THF:
fanNames = new string[] { "System", "CPU", "Auxiliary" }; fanNames = new string[] { "System", "CPU", "Auxiliary" };
voltageGains = new float[] { 2, 1, 2, 1, 1, 1, 1, 2 }; voltageGains = new float[] { 2, 1, 2, 1, 1, 1, 1, 2 };
voltages = new Sensor[3]; voltages = new Sensor[3];
@@ -199,7 +200,9 @@ namespace OpenHardwareMonitor.Hardware.LPC {
foreach (Sensor sensor in voltages) { foreach (Sensor sensor in voltages) {
if (sensor.Index < 7) { if (sensor.Index < 7) {
// two special VCore measurement modes for W83627THF // two special VCore measurement modes for W83627THF
if (chip == Chip.W83627THF && sensor.Index == 0) { if ((chip == Chip.W83627HF || chip == Chip.W83627THF ||
chip == Chip.W83687THF) && sensor.Index == 0)
{
byte vrmConfiguration = ReadByte(0, 0x18); byte vrmConfiguration = ReadByte(0, 0x18);
int value = ReadByte(0, VOLTAGE_BASE_REG); int value = ReadByte(0, VOLTAGE_BASE_REG);
if ((vrmConfiguration & 0x01) == 0) if ((vrmConfiguration & 0x01) == 0)

View File

@@ -84,6 +84,8 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
r.AppendLine(); r.AppendLine();
r.Append(smbios.GetReport()); r.Append(smbios.GetReport());
r.Append(lpcGroup.GetReport());
return r.ToString(); return r.ToString();
} }

View File

@@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.1.24.1")] [assembly: AssemblyVersion("0.1.24.3")]
[assembly: AssemblyFileVersion("0.1.24.1")] [assembly: AssemblyFileVersion("0.1.24.3")]