Fixed an issue with the Nuvoton NCT6791D (hardware monitor i/o space lock wasn't disabled before attempting to read data).

This commit is contained in:
Michael Möller 2013-09-07 08:07:11 +00:00
parent 9f28081100
commit bf0e26c554
2 changed files with 22 additions and 2 deletions

View File

@ -39,6 +39,11 @@ namespace OpenHardwareMonitor.Hardware.LPC {
return Ring0.ReadIoPort(valuePort);
}
private void WriteByte(byte register, byte value) {
Ring0.WriteIoPort(registerPort, register);
Ring0.WriteIoPort(valuePort, value);
}
private ushort ReadWord(byte register) {
return (ushort)((ReadByte(register) << 8) |
ReadByte((byte)(register + 1)));
@ -71,6 +76,8 @@ namespace OpenHardwareMonitor.Hardware.LPC {
private const byte F71858_HARDWARE_MONITOR_LDN = 0x02;
private const byte FINTEK_HARDWARE_MONITOR_LDN = 0x04;
private const byte NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK = 0x28;
private void WinbondNuvotonFintekEnter() {
Ring0.WriteIoPort(registerPort, 0x87);
Ring0.WriteIoPort(registerPort, 0x87);
@ -246,6 +253,19 @@ namespace OpenHardwareMonitor.Hardware.LPC {
ushort vendorID = ReadWord(FINTEK_VENDOR_ID_REGISTER);
// disable the hardware monitor i/o space lock on NCT6791D chips
if (address == verify && chip == Chip.NCT6791D) {
byte options = ReadByte(NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK);
// if the i/o space lock is enabled
if ((options & 0x10) > 0) {
// disable the i/o space lock
WriteByte(NUVOTON_HARDWARE_MONITOR_IO_SPACE_LOCK,
(byte)(options & ~0x10));
}
}
WinbondNuvotonFintekExit();
if (address != verify) {

View File

@ -10,5 +10,5 @@
using System.Reflection;
[assembly: AssemblyVersion("0.6.0.10")]
[assembly: AssemblyInformationalVersion("0.6.0.10 Alpha")]
[assembly: AssemblyVersion("0.6.0.11")]
[assembly: AssemblyInformationalVersion("0.6.0.11 Alpha")]