Added the ITE chip version to the report.

This commit is contained in:
Michael Möller
2010-06-28 20:39:49 +00:00
parent a4f6aae482
commit 6968062d71
2 changed files with 10 additions and 4 deletions
+4 -1
View File
@@ -45,6 +45,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
private ushort address;
private Chip chip;
private byte version;
private readonly ushort addressReg;
private readonly ushort dataReg;
@@ -78,10 +79,11 @@ namespace OpenHardwareMonitor.Hardware.LPC {
return value;
}
public IT87XX(Chip chip, ushort address) {
public IT87XX(Chip chip, ushort address, byte version) {
this.address = address;
this.chip = chip;
this.version = version;
this.addressReg = (ushort)(address + ADDRESS_REGISTER_OFFSET);
this.dataReg = (ushort)(address + DATA_REGISTER_OFFSET);
@@ -113,6 +115,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
r.AppendLine("LPC " + this.GetType().Name);
r.AppendLine();
r.Append("Chip ID: 0x"); r.AppendLine(chip.ToString("X"));
r.Append("Chip Version: 0x"); r.AppendLine(version.ToString("X"));
r.Append("Base Address: 0x"); r.AppendLine(address.ToString("X4"));
r.AppendLine();
r.AppendLine("Environment Controller Registers");
+6 -3
View File
@@ -78,7 +78,8 @@ namespace OpenHardwareMonitor.Hardware.LPC {
}
// ITE
private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04;
private const byte IT87_ENVIRONMENT_CONTROLLER_LDN = 0x04;
private const byte IT87_CHIP_VERSION_REGISTER = 0x22;
private void IT87Enter() {
WinRing0.WriteIoPortByte(registerPort, 0x87);
@@ -332,12 +333,14 @@ namespace OpenHardwareMonitor.Hardware.LPC {
report.AppendLine(chipID.ToString("X"));
report.AppendLine();
}
} else {
} else {
Select(IT87_ENVIRONMENT_CONTROLLER_LDN);
ushort address = ReadWord(BASE_ADDRESS_REGISTER);
Thread.Sleep(1);
ushort verify = ReadWord(BASE_ADDRESS_REGISTER);
byte version = (byte)(ReadByte(IT87_CHIP_VERSION_REGISTER) & 0x0F);
IT87Exit();
if (address != verify || address < 0x100 || (address & 0xF007) != 0) {
@@ -349,7 +352,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
return;
}
superIOs.Add(new IT87XX(chip, address));
superIOs.Add(new IT87XX(chip, address, version));
return;
}