mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 13:57:38 +00:00
Added support for Winbond W83687THF and improved report output for LPC detection.
This commit is contained in:
parent
cebd4a79c9
commit
b839e338d6
@ -18,6 +18,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
W83627THF = 0x8283,
|
||||
W83667HG = 0xA510,
|
||||
W83667HGB = 0xB350,
|
||||
W83687THF = 0x8541,
|
||||
F71862 = 0x0601,
|
||||
F71869 = 0x0814,
|
||||
F71882 = 0x0541,
|
||||
|
@ -42,7 +42,9 @@ using System.Threading;
|
||||
|
||||
namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
public class LPCGroup : IGroup {
|
||||
|
||||
private List<IHardware> hardware = new List<IHardware>();
|
||||
private StringBuilder report = new StringBuilder();
|
||||
|
||||
private Chip chip = Chip.Unknown;
|
||||
|
||||
@ -108,6 +110,15 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
WinRing0.WriteIoPortByte(registerPort, 0xAA);
|
||||
}
|
||||
|
||||
// SMSC
|
||||
private void SMSCEnter() {
|
||||
WinRing0.WriteIoPortByte(registerPort, 0x55);
|
||||
}
|
||||
|
||||
private void SMSCExit() {
|
||||
WinRing0.WriteIoPortByte(registerPort, 0xAA);
|
||||
}
|
||||
|
||||
public LPCGroup() {
|
||||
if (!WinRing0.IsAvailable)
|
||||
return;
|
||||
@ -167,6 +178,13 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN;
|
||||
break;
|
||||
} break;
|
||||
case 0x85:
|
||||
switch (revision) {
|
||||
case 0x41:
|
||||
chip = Chip.W83687THF;
|
||||
logicalDeviceNumber = WINBOND_HARDWARE_MONITOR_LDN;
|
||||
break;
|
||||
} break;
|
||||
case 0x88:
|
||||
switch (revision & 0xF0) {
|
||||
case 0x60:
|
||||
@ -203,7 +221,15 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
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);
|
||||
ushort address = ReadWord(BASE_ADDRESS_REGISTER);
|
||||
@ -216,15 +242,30 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
// some Fintek chips have address register offset 0x05 added already
|
||||
if ((address & 0x07) == 0x05)
|
||||
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;
|
||||
}
|
||||
|
||||
switch (chip) {
|
||||
case Chip.W83627DHG:
|
||||
@ -234,6 +275,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
case Chip.W83627THF:
|
||||
case Chip.W83667HG:
|
||||
case Chip.W83667HGB:
|
||||
case Chip.W83687THF:
|
||||
W836XX w836XX = new W836XX(chip, revision, address);
|
||||
if (w836XX.IsAvailable)
|
||||
hardware.Add(w836XX);
|
||||
@ -255,15 +297,23 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
|
||||
IT87Enter();
|
||||
|
||||
switch (ReadWord(CHIP_ID_REGISTER)) {
|
||||
ushort chipID = ReadWord(CHIP_ID_REGISTER);
|
||||
switch (chipID) {
|
||||
case 0x8716: chip = Chip.IT8716F; break;
|
||||
case 0x8718: chip = Chip.IT8718F; break;
|
||||
case 0x8720: chip = Chip.IT8720F; break;
|
||||
case 0x8726: chip = Chip.IT8726F; 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);
|
||||
ushort address = ReadWord(BASE_ADDRESS_REGISTER);
|
||||
Thread.Sleep(1);
|
||||
@ -271,8 +321,14 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
IT87XX it87 = new IT87XX(chip, address);
|
||||
if (it87.IsAvailable)
|
||||
@ -280,6 +336,26 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
|
||||
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() {
|
||||
return null;
|
||||
if (report.Length > 0) {
|
||||
report.Insert(0, "LPCIO" + Environment.NewLine +
|
||||
Environment.NewLine);
|
||||
return report.ToString();
|
||||
} else
|
||||
return null;
|
||||
}
|
||||
|
||||
public void Close() { }
|
||||
|
@ -66,6 +66,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
case Chip.W83627THF: this.name = "Winbond W83627THF"; break;
|
||||
case Chip.W83667HG: this.name = "Winbond W83667HG"; break;
|
||||
case Chip.W83667HGB: this.name = "Winbond W83667HG-B"; break;
|
||||
case Chip.W83687THF: this.name = "Winbond W83687THF"; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,6 +167,7 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
break;
|
||||
case Chip.W83627HF:
|
||||
case Chip.W83627THF:
|
||||
case Chip.W83687THF:
|
||||
fanNames = new string[] { "System", "CPU", "Auxiliary" };
|
||||
voltageGains = new float[] { 2, 1, 2, 1, 1, 1, 1, 2 };
|
||||
voltages = new Sensor[3];
|
||||
@ -199,7 +200,9 @@ namespace OpenHardwareMonitor.Hardware.LPC {
|
||||
foreach (Sensor sensor in voltages) {
|
||||
if (sensor.Index < 7) {
|
||||
// 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);
|
||||
int value = ReadByte(0, VOLTAGE_BASE_REG);
|
||||
if ((vrmConfiguration & 0x01) == 0)
|
||||
|
@ -84,6 +84,8 @@ namespace OpenHardwareMonitor.Hardware.Mainboard {
|
||||
r.AppendLine();
|
||||
r.Append(smbios.GetReport());
|
||||
|
||||
r.Append(lpcGroup.GetReport());
|
||||
|
||||
return r.ToString();
|
||||
}
|
||||
|
||||
|
@ -69,5 +69,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("0.1.24.1")]
|
||||
[assembly: AssemblyFileVersion("0.1.24.1")]
|
||||
[assembly: AssemblyVersion("0.1.24.3")]
|
||||
[assembly: AssemblyFileVersion("0.1.24.3")]
|
||||
|
Loading…
x
Reference in New Issue
Block a user